Changeset 206 for trunk/EventBenchConsole/src/de/ugoe/cs/eventbench
- Timestamp:
- 09/27/11 20:52:26 (13 years ago)
- Location:
- trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/efg/commands
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/efg/commands/CMDefgTestCasesToSequences.java
r205 r206 16 16 import edu.umd.cs.guitar.model.data.TestCase; 17 17 18 /** 19 * <p> 20 * Command to load a set of sequences from a set of GUITAR test cases. 21 * </p> 22 * 23 * @author Steffen Herbold 24 * @version 1.0 25 */ 18 26 public class CMDefgTestCasesToSequences implements Command { 19 27 28 /* 29 * (non-Javadoc) 30 * 31 * @see de.ugoe.cs.util.console.Command#run(java.util.List) 32 */ 20 33 @Override 21 34 public void run(List<Object> parameters) { … … 24 37 try { 25 38 foldername = (String) parameters.get(0); 26 if ( parameters.size()>=2) {39 if (parameters.size() >= 2) { 27 40 sequencesName = (String) parameters.get(1); 28 41 } … … 30 43 throw new InvalidParameterException(); 31 44 } 32 45 33 46 File folder = new File(foldername); 34 47 // TODO would be more robust with filter 35 48 File[] testcaseFiles = folder.listFiles(); 36 49 Collection<List<Event<?>>> sequences = new LinkedList<List<Event<?>>>(); 37 for( File testcaseFile : testcaseFiles ) { 38 Console.traceln("Loading from file " + testcaseFile.getAbsolutePath()); 39 TestCase testcase = (TestCase) IO.readObjFromFile(testcaseFile.getAbsolutePath(), TestCase.class); 50 for (File testcaseFile : testcaseFiles) { 51 Console.traceln("Loading from file " 52 + testcaseFile.getAbsolutePath()); 53 TestCase testcase = (TestCase) IO.readObjFromFile( 54 testcaseFile.getAbsolutePath(), TestCase.class); 40 55 List<StepType> steps = testcase.getStep(); 41 56 List<Event<?>> sequence = new LinkedList<Event<?>>(); 42 for ( StepType step : steps) {57 for (StepType step : steps) { 43 58 step.getEventId(); 44 59 sequence.add(new EFGEvent(step.getEventId())); 45 60 /* 46 * Problem: widgetId unknown! 47 * Therefore, the events will not be equal to those in the 48 * generated from a EFG. 49 */ 61 * Problem: widgetId unknown! Therefore, the events will not be 62 * equal to those in the generated from a EFG. 63 */ 50 64 } 51 65 sequences.add(sequence); … … 54 68 Console.traceln("Old data \"" + sequencesName + "\" overwritten"); 55 69 } 56 70 57 71 } 58 72 73 /* 74 * (non-Javadoc) 75 * 76 * @see de.ugoe.cs.util.console.Command#help() 77 */ 59 78 @Override 60 79 public void help() { -
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/efg/commands/CMDefgToMM.java
r205 r206 54 54 for (EventType event : efgEvents) { 55 55 /* 56 * the widgetId and eventId are only hash values, 57 * the "interpretation" is found in the GUI file.56 * the widgetId and eventId are only hash values, the 57 * "interpretation" is found in the GUI file. 58 58 */ 59 59 Event<?> myEvent = new EFGEvent(event.getEventId()); … … 61 61 * The target is currently not set to event.widgetId() because the 62 62 * WidgetId is not available when loading sequences in form of test 63 * cases. 63 * cases. 64 64 */ 65 // myEvent.setTarget(event.getWidgetId(););65 // myEvent.setTarget(event.getWidgetId();); 66 66 myEvents.add(myEvent); 67 67 }
Note: See TracChangeset
for help on using the changeset viewer.