Changeset 206 for trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/efg/commands/CMDefgTestCasesToSequences.java
- Timestamp:
- 09/27/11 20:52:26 (13 years ago)
- File:
-
- 1 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() {
Note: See TracChangeset
for help on using the changeset viewer.