Changeset 1979
- Timestamp:
- 06/24/15 15:38:07 (9 years ago)
- Location:
- trunk/autoquest-plugin-uml-test/src/test
- Files:
-
- 4 added
- 3 deleted
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-plugin-uml-test/src/test/java/de/ugoe/cs/autoquest/plugin/uml/UMLUtilsTest.java
r1942 r1979 78 78 "deda_ixs_model_scheduling.uml"); 79 79 80 private final static TestData ita_1 = new TestData("ita_properties.prop", 81 "ita_usagejournal.log", 82 "ita_usageprofile.dat", "ita_model.uml", 83 "ita_model_testsuite.uml", 84 "ita_model_scheduling.uml"); 80 private final static TestData ita_1 = new TestData("ita_imported_properties.prop", 81 "ita_imported_usagejournal.log", 82 "ita_imported_usageprofile.dat", 83 "ita_imported_model.uml", 84 "ita_imported_model_testsuite.uml", 85 "ita_imported_model_scheduling.uml"); 85 86 86 87 private static class TestData { … … 123 124 @BeforeClass 124 125 public static void setUpBeforeClass() throws Exception { 125 new TextConsole(Level. SEVERE);126 new TextConsole(Level.FINE); 126 127 } 127 128 … … 141 142 * loadAndPreprocessUsageJournal(testdata, properties); 142 143 * 143 * Model model = 144 * ModelUtils.loadModel(ClassLoader.getSystemResourceAsStream(testdata.dslModelFile));144 * Model model = ModelUtils.loadModel(new 145 * File(ClassLoader.getSystemResource(testdata.dslModelFile).getFile())); 145 146 * 146 147 * StateMachine stateMachine = (StateMachine) … … 160 161 161 162 Model model = 162 ModelUtils.loadModel(ClassLoader.getSystemResourceAsStream(testdata.dslModelFile)); 163 ModelUtils.loadModel(new File(ClassLoader.getSystemResource(testdata.dslModelFile) 164 .getFile())); 163 165 164 166 StateMachine stateMachine = … … 177 179 178 180 // TODO make test case run 179 // UMLUtils.createUMLTransitionSequence(manuallyCreatedSequence, stateMachine);181 // UMLUtils.createUMLTransitionSequence(manuallyCreatedSequence, stateMachine); 180 182 } 181 183 … … 183 185 public void testConvertStateMachineToUsageProfile__ITA_1() throws Exception { 184 186 // TODO make test run 185 /*TestData testdata = ita_1; 186 187 assertTrue("test currently not working", false); 188 189 Properties properties = loadProperties(testdata); 190 Collection<List<Event>> sequences = loadAndPreprocessUsageJournal(testdata, properties); 191 Model model = 192 ModelUtils.loadModel(ClassLoader.getSystemResourceAsStream(testdata.dslModelFile)); 193 StateMachine stateMachine = 194 (StateMachine) model.getPackagedElement("StateMachineTransportService", true, 195 UMLPackage.Literals.STATE_MACHINE, true); 196 197 Collection<List<Event>> umlSequences = new LinkedList<>(); 198 199 // remove everything but transport from sequences 200 for (List<Event> sequence : sequences) { 201 for (Iterator<Event> eventIter = sequence.iterator(); eventIter.hasNext();) { 202 Event event = eventIter.next(); 203 if (!"TransportService".equals(SOAPUtils.getServiceNameFromEvent(event))) { 204 eventIter.remove(); 205 } 206 } 207 umlSequences.add(UMLUtils.createUMLTransitionSequence(sequence, stateMachine)); 208 } 209 210 UMLUtils.convertStateMachineToUsageProfile(umlSequences, stateMachine); 211 212 ModelUtils.writeModelToFile(model, OUTPUT_DIR + "ita_v2_result.uml");*/ 187 /* 188 * TestData testdata = ita_1; 189 * 190 * assertTrue("test currently not working", false); 191 * 192 * Properties properties = loadProperties(testdata); Collection<List<Event>> sequences = 193 * loadAndPreprocessUsageJournal(testdata, properties); Model model = 194 * ModelUtils.loadModel(ClassLoader.getSystemResourceAsStream(testdata.dslModelFile)); 195 * StateMachine stateMachine = (StateMachine) 196 * model.getPackagedElement("StateMachineTransportService", true, 197 * UMLPackage.Literals.STATE_MACHINE, true); 198 * 199 * Collection<List<Event>> umlSequences = new LinkedList<>(); 200 * 201 * // remove everything but transport from sequences for (List<Event> sequence : sequences) 202 * { for (Iterator<Event> eventIter = sequence.iterator(); eventIter.hasNext();) { Event 203 * event = eventIter.next(); if 204 * (!"TransportService".equals(SOAPUtils.getServiceNameFromEvent(event))) { 205 * eventIter.remove(); } } umlSequences.add(UMLUtils.createUMLTransitionSequence(sequence, 206 * stateMachine)); } 207 * 208 * UMLUtils.convertStateMachineToUsageProfile(umlSequences, stateMachine); 209 * 210 * ModelUtils.writeModelToFile(model, OUTPUT_DIR + "ita_v2_result.uml"); 211 */ 213 212 } 214 213 … … 277 276 Collection<List<Event>> sequences = loadAndPreprocessUsageJournal(testdata, properties); 278 277 Model model = 279 ModelUtils.loadModel(ClassLoader.getSystemResourceAsStream(testdata.dslModelFile)); 278 ModelUtils.loadModel(new File(ClassLoader.getSystemResource(testdata.dslModelFile) 279 .getFile())); 280 280 281 281 // run validation … … 294 294 Collection<List<Event>> sequences = loadAndPreprocessUsageJournal(testdata, properties); 295 295 Model model = 296 ModelUtils.loadModel(ClassLoader.getSystemResourceAsStream(testdata.dslModelFile)); 296 ModelUtils.loadModel(new File(ClassLoader.getSystemResource(testdata.dslModelFile) 297 .getFile())); 297 298 298 299 // create a test case for each observed sequence … … 313 314 Collection<List<Event>> sequences = loadAndPreprocessUsageJournal(testdata, properties); 314 315 Model model = 315 ModelUtils.loadModel(ClassLoader.getSystemResourceAsStream(testdata.dslModelFile)); 316 ModelUtils.loadModel(new File(ClassLoader.getSystemResource(testdata.dslModelFile) 317 .getFile())); 316 318 IStochasticProcess usageProfile = createUsageProfile(testdata, sequences); 317 319 Collection<List<Event>> generatedSequences = … … 340 342 Collection<List<Event>> sequences = loadAndPreprocessUsageJournal(testdata, properties); 341 343 Model model = 342 ModelUtils.loadModel(ClassLoader.getSystemResourceAsStream(testdata.dslModelFile)); 344 ModelUtils.loadModel(new File(ClassLoader.getSystemResource(testdata.dslModelFile) 345 .getFile())); 343 346 IStochasticProcess usageProfile = createUsageProfile(testdata, sequences); 344 347 Collection<List<Event>> generatedSequences = … … 380 383 Collection<List<Event>> simpleSOAPSequences = new LinkedList<>(); 381 384 for (List<Event> sequence : sequences) { 382 simpleSOAPSequences.add(SOAPUtils.convertToSimpleSOAPEvent(sequence, true)); 385 List<Event> simpleSOAPSequence = SOAPUtils.convertToSimpleSOAPEvent(sequence, true); 386 List<Event> simpleSOAPSequenceWithNormalizedMethodNames = 387 SOAPUtils.normalizeOperationNames(simpleSOAPSequence, properties 388 .getProperty("methodName.prefixToRemove"), properties 389 .getProperty("methodName.suffixToRemove")); 390 simpleSOAPSequences.add(simpleSOAPSequenceWithNormalizedMethodNames); 383 391 } 384 392 … … 397 405 SimpleSOAPEventType eventType = (SimpleSOAPEventType) event.getType(); 398 406 if (ignoredServices.contains(eventType.getServiceName())) { 407 eventIter.remove(); 408 } 409 else if( ignoredServices.contains(eventType.getClientName())) { 399 410 eventIter.remove(); 400 411 }
Note: See TracChangeset
for help on using the changeset viewer.