- Timestamp:
- 08/27/12 17:54:07 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/quest-plugin-mfc-test/src/test/java/de/ugoe/cs/quest/plugin/mfc/MFCLogParserTest.java
r622 r649 14 14 import java.io.File; 15 15 import java.io.FileInputStream; 16 import java.io.FileOutputStream; 16 17 import java.io.InputStreamReader; 18 import java.io.PrintStream; 17 19 import java.util.Collection; 18 20 import java.util.List; … … 25 27 import de.ugoe.cs.quest.eventcore.Event; 26 28 import de.ugoe.cs.quest.eventcore.guimodel.GUIModel; 27 import de.ugoe.cs. quest.eventcore.guimodel.IGUIElement;28 import de.ugoe.cs. quest.plugin.mfc.guimodel.MFCGUIElement;29 import de.ugoe.cs.util.console.Console; 30 import de.ugoe.cs.util.console.listener.IOutputListener; 29 31 30 32 /** … … 34 36 * @author 2011, last modified by $Author: $ 35 37 */ 36 public class MFCLogParserTest {38 public class MFCLogParserTest implements IOutputListener { 37 39 38 40 /** */ 39 41 private File tmpFile; 40 42 43 /** */ 44 private PrintStream outputStream; 45 41 46 /** 42 47 * … … 44 49 @Before 45 50 public void setUp() throws Exception { 51 outputStream = new PrintStream(new FileOutputStream("blub.log")); 52 Console.getInstance().registerOutputListener(this); 53 46 54 tmpFile = new File("tmp.xml"); 47 55 … … 56 64 @After 57 65 public void tearDown() throws Exception { 66 if (!System.out.equals(outputStream) && !System.err.equals(outputStream)) { 67 outputStream.close(); 68 } 69 58 70 if (tmpFile.exists()) { 59 71 assertTrue(tmpFile.delete()); … … 96 108 assertNotSame(0, guiModel.getRootElements().size()); 97 109 98 for (IGUIElement root : guiModel.getRootElements()) { 99 dumpGUIElement(root, guiModel, ""); 100 } 110 guiModel.dump(System.err); 101 111 } 102 112 … … 131 141 assertNotNull(guiModel); 132 142 133 for (IGUIElement root : guiModel.getRootElements()) { 134 dumpGUIElement(root, guiModel, ""); 135 } 143 guiModel.dump(System.err); 136 144 137 145 ReplayGenerator generator = new ReplayGenerator(); … … 157 165 } 158 166 159 /** 160 * TODO: comment 161 * 162 * @param root 163 * @param guiModel 167 /* (non-Javadoc) 168 * @see de.ugoe.cs.util.console.listener.IOutputListener#outputMsg(java.lang.String) 164 169 */ 165 private void dumpGUIElement(IGUIElement guiElement, GUIModel guiModel, String indent) { 166 assertTrue(guiElement instanceof MFCGUIElement); 167 168 System.err.print(indent); 169 System.err.print(guiElement); 170 171 List<IGUIElement> children = guiModel.getChildren(guiElement); 172 173 if ((children != null) && (children.size() > 0)) { 174 System.err.println(" {"); 175 176 for (IGUIElement child : children) { 177 dumpGUIElement(child, guiModel, indent + " "); 178 } 179 180 System.err.print(indent); 181 System.err.print("}"); 182 } 183 184 System.err.println(); 170 @Override 171 public void outputMsg(String newMessage) { 172 outputStream.println(newMessage); 185 173 } 186 174
Note: See TracChangeset
for help on using the changeset viewer.