- Timestamp:
- 10/03/11 23:06:06 (13 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/commands/CMDshowSequences.java
r226 r229 11 11 import de.ugoe.cs.eventbench.data.Event; 12 12 13 /** 14 * <p> 15 * Command to show sequences. 16 * </p> 17 * 18 * @author Jeffrey Hall, Steffen Herbold 19 */ 13 20 public class CMDshowSequences implements Command { 14 21 22 /* 23 * (non-Javadoc) 24 * 25 * @see de.ugoe.cs.util.console.Command#help() 26 */ 27 @Override 15 28 public void help() { 16 29 Console.println("Usage: showSequences"); 17 30 } 18 31 32 /* 33 * (non-Javadoc) 34 * 35 * @see de.ugoe.cs.util.console.Command#run(java.util.List) 36 */ 19 37 @SuppressWarnings("unchecked") 38 @Override 20 39 public void run(List<Object> parameters) { 21 40 … … 36 55 } else { 37 56 57 // TODO use SWT-GUI instead 38 58 DlgSequences.showDialog(); 39 59 -
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/swing/DlgInsert.java
r226 r229 45 45 * @author Jeffrey Hall 46 46 * @version 1.0 47 * @deprecated Use SWT-GUI for modifying sequences. 47 48 */ 48 49 public class DlgInsert extends JDialog { … … 498 499 return false; 499 500 } else { 500 FileEqualsReplay file = new FileEqualsReplay(); 501 file.setActualFile(textFieldActualFile.getText()); 502 file.setExpectedFile(textFieldExpectedFile.getText()); 501 FileEqualsReplay file = new FileEqualsReplay(textFieldExpectedFile.getText(), textFieldActualFile.getText()); 503 502 504 503 AssertEvent<FileEqualsReplay> e = new AssertEvent<FileEqualsReplay>( … … 546 545 // *** 547 546 548 TextEqualsReplay text = new TextEqualsReplay(); 549 text.setExpectedValue(textFieldExpectedValue.getText()); 550 text.setTarget(target); 547 TextEqualsReplay text = new TextEqualsReplay(textFieldExpectedValue.getText(),target); 551 548 552 549 AssertEvent<TextEqualsReplay> e = new AssertEvent<TextEqualsReplay>( -
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/swing/DlgSequenceDetails.java
r214 r229 37 37 * @author Jeffrey Hall 38 38 * @version 1.0 39 * @deprecated Use SWT-GUI for modifying sequences. 39 40 */ 40 41 public class DlgSequenceDetails { -
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/swing/DlgSequences.java
r173 r229 29 29 * @author Jeffrey Hall 30 30 * @version 1.0 31 * @deprecated Use SWT-GUI for modifying sequences. 31 32 */ 32 33 public class DlgSequences { -
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/windows/commands/CMDparseXML.java
r203 r229 4 4 import java.util.Collection; 5 5 import java.util.List; 6 import java.util.SortedSet; 6 7 7 8 import de.ugoe.cs.eventbench.data.GlobalDataContainer; 8 9 import de.ugoe.cs.eventbench.windows.LogParser; 10 import de.ugoe.cs.eventbench.windows.data.WindowTree; 9 11 import de.ugoe.cs.eventbench.windows.data.WindowsEvent; 10 12 import de.ugoe.cs.util.console.Command; … … 60 62 61 63 Collection<List<WindowsEvent>> sequences = parser.getSequences(); 64 SortedSet<String> targets = WindowTree.getInstance().getTargets(); 62 65 63 66 if (GlobalDataContainer.getInstance().addData(sequencesName, sequences)) { 64 67 Console.traceln("Old data \"" + sequencesName + "\" overwritten"); 65 68 } 69 if( GlobalDataContainer.getInstance().addData(sequencesName+"_targets", targets)) { 70 Console.traceln("Old data \"" + sequencesName+"_targets" + "\" overwritten"); 71 } 66 72 } 67 73 -
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/windows/data/WindowTree.java
r228 r229 5 5 import java.util.Map; 6 6 import java.util.SortedSet; 7 import java.util.TreeSet;8 9 import de.ugoe.cs.eventbench.data.GlobalDataContainer;10 import de.ugoe.cs.util.console.Console;11 7 12 8 /** … … 39 35 */ 40 36 private static WindowTree theInstance = null; 37 38 /** 39 * <p> 40 * Maintains a set of all the target strings of all widgets that were at 41 * some point part of the window tree. 42 * </p> 43 */ 44 private SortedSet<String> targets; 41 45 42 46 /** … … 112 116 } 113 117 nodes.put(childHwnd, child); 118 targets.add(child.xmlRepresentation()); 114 119 } 115 116 storeTarget(childHwnd);117 120 } 118 121 … … 172 175 /** 173 176 * <p> 174 * Stores a target in GlobalDataContainer to be able to work on with it in175 * DlgInsert177 * Returns a sorted set of all targets that existed any time in the window 178 * tree. 176 179 * </p> 177 180 * 178 * @param hwnd 179 * hwnd of the window to be stored 181 * @return set of targets 180 182 */ 181 @SuppressWarnings("unchecked") 182 private void storeTarget(int hwnd) { 183 SortedSet<String> targets = new TreeSet<String>(); 184 185 if (GlobalDataContainer.getInstance().getData("ListTargets") == null) { 186 GlobalDataContainer.getInstance().addData("ListTargets", targets); 187 } 188 189 try { 190 targets = (SortedSet<String>) GlobalDataContainer.getInstance().getData("ListTargets"); 191 targets.add(nodes.get(hwnd).xmlRepresentation()); 192 } catch (ClassCastException e) { 193 Console.println("Not able to cast data in GlobalDataContainer to SortedSet of Strings"); 194 } 183 public SortedSet<String> getTargets() { 184 return targets; 195 185 } 196 186 } -
trunk/EventBenchCore/src/de/ugoe/cs/eventbench/assertions/FileEqualsReplay.java
r217 r229 6 6 /** 7 7 * <p> 8 * This class defines the fileEquals assertion type. This type does have two 9 * parameters, actualFile and expectedFile. 8 * This class defines the replay for file equals assertions. 10 9 * </p> 11 10 * 12 * @author jeffrey.hall 13 * @version 1.0 14 * 11 * @author Jeffrey Hall, Steffen Herbold 12 * @version 2.0 15 13 */ 16 14 public class FileEqualsReplay implements IReplayable { … … 27 25 28 26 /** 27 * <p> 29 28 * Id for object serialization. 29 * </p> 30 30 */ 31 31 private static final long serialVersionUID = 1L; 32 32 33 33 /** 34 * <p> 35 * Constructor. Creates a new FileEqualsReplay. 36 * </p> 34 37 * 38 * @param expectedFile 39 * name and path of the expected file 35 40 * @param actualFile 36 * The file that should be equal to expectedFile.41 * name and path of the actual file 37 42 */ 38 public void setActualFile(String actualFile) { 43 public FileEqualsReplay(String expectedFile, String actualFile) { 44 this.expectedFile = expectedFile; 39 45 this.actualFile = actualFile; 40 46 } 41 47 42 /** 43 * @param exptectedFile 44 * The file that is used as the reference. 45 */ 46 public void setExpectedFile(String expectedFile) { 47 this.expectedFile = expectedFile; 48 } 49 50 /** 51 * Returns the string that has to be written to the replay file. 48 /* 49 * (non-Javadoc) 50 * 51 * @see de.ugoe.cs.eventbench.data.IReplayable#getReplay() 52 52 */ 53 53 public String getReplay() { … … 64 64 } 65 65 66 /** 67 * No target used by fileEquals. 66 /* 67 * (non-Javadoc) 68 * 69 * @see de.ugoe.cs.eventbench.data.IReplayable#getTarget() 68 70 */ 71 @Override 69 72 public String getTarget() { 70 73 return "targetNotUsed"; -
trunk/EventBenchCore/src/de/ugoe/cs/eventbench/assertions/TextEqualsReplay.java
r218 r229 6 6 /** 7 7 * <p> 8 * This class defines the textEquals assertion type. This type does have two 9 * parameters, expectedValue and target. 8 * This class defines the replay for a textEquals assertion. 10 9 * </p> 11 10 * 12 * @author jeffrey.hall 13 * @version 1.0 14 * 11 * @author Jeffrey Hall, Steffen Herbold 12 * @version 2.0 15 13 */ 16 14 public class TextEqualsReplay implements IReplayable { 17 15 18 16 /** 19 * The reference value which is compared to the targets text. 17 * <p> 18 * Reference value which is compared to the targets text. 19 * </p> 20 20 */ 21 private String expectedValue = null;21 private String expectedValue; 22 22 23 23 /** 24 * The window which text is compared to expectedValue. 24 * <p> 25 * Target to which the text is compared. 26 * </p> 25 27 */ 26 private String target = null;28 private String target; 27 29 28 30 /** 31 * <p> 29 32 * Id for object serialization. 33 * </p> 30 34 */ 31 35 private static final long serialVersionUID = 1L; 32 36 33 /** 34 * @param expectedValue 35 * The reference value which is compared to the targets text. 36 */ 37 public void setExpectedValue(String expectedValue) { 37 public TextEqualsReplay(String expectedValue, String target) { 38 38 this.expectedValue = expectedValue; 39 }40 41 /**42 * @param target43 * The window which text is compared to expectedValue.44 */45 public void setTarget(String target) {46 39 this.target = target; 47 40 } 48 41 49 /** 50 * Returns the string that has to be written to the replay file. 42 /* 43 * (non-Javadoc) 44 * 45 * @see de.ugoe.cs.eventbench.data.IReplayable#getReplay() 51 46 */ 47 @Override 52 48 public String getReplay() { 53 49 … … 69 65 } 70 66 71 /** 72 * Returns the target window. 67 /* 68 * (non-Javadoc) 69 * 70 * @see de.ugoe.cs.eventbench.data.IReplayable#getTarget() 73 71 */ 72 @Override 74 73 public String getTarget() { 75 74 return target;
Note: See TracChangeset
for help on using the changeset viewer.