Changeset 1908 for trunk/autoquest-plugin-uml-test/src/test/java
- Timestamp:
- 03/11/15 15:43:03 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-plugin-uml-test/src/test/java/de/ugoe/cs/autoquest/plugin/uml/UMLUtilsTest.java
r1900 r1908 205 205 206 206 @Test 207 public void testHL7v2_1() throws Exception {208 // parse log file209 HTTPLogParser parser =210 new HTTPLogParser(new File(ClassLoader211 .getSystemResource("hl7_servicenamemap.txt")212 .getFile()));213 parser214 .parseFile(new File(ClassLoader215 .getSystemResource("testCreateInteractionFromEventSequence_1_usagedata.log")216 .getFile()));217 Collection<List<Event>> httpSequences = parser.getSequences();218 219 220 Model model =221 ModelUtils.loadModel(ClassLoader222 .getSystemResourceAsStream("hl7model_v2.uml"));223 224 for (List<Event> httpSequence : httpSequences) {225 for (Iterator<Event> eventIter = httpSequence.iterator(); eventIter.hasNext();) {226 Event event = eventIter.next();227 if (!(event.getType() instanceof SOAPEventType)) {228 eventIter.remove();229 }230 }231 232 UMLUtils.createInteractionFromEventSequence(httpSequence, model, "testSequence", "RLUSTestSuite_1");233 }234 235 ModelUtils.writeModelToFile(model, OUTPUT_DIR + "testCreateInteractionFromEventSequence_2_result.uml");236 237 }238 239 @Test240 207 public void testCalculateUsageScore_1() throws Exception { 241 208 // parse log file … … 372 339 } 373 340 } 341 342 @Test 343 public void testValidateModelWithLog_ITA_v2() throws Exception { 344 HTTPLogParser parser = 345 new HTTPLogParser(new File(ClassLoader 346 .getSystemResource("ita_v2_servicenamemap.txt") 347 .getFile())); 348 parser 349 .parseFile(new File(ClassLoader 350 .getSystemResource("ita_usagejournal_v2_2.log") 351 .getFile())); 352 Collection<List<Event>> httpSequences = parser.getSequences(); 353 354 355 Model model = 356 ModelUtils.loadModel(ClassLoader 357 .getSystemResourceAsStream("ita_model_v2.uml")); 358 359 int violations = UMLUtils.validateModelWithLog(httpSequences, model, null); 360 if( violations==0 ) { 361 System.out.println("No problems found."); 362 } else { 363 System.out.println(violations + " violations found."); 364 } 365 366 // remove everything but transport from sequences 367 for (List<Event> httpSequence : httpSequences) { 368 for (Iterator<Event> eventIter = httpSequence.iterator(); eventIter.hasNext();) { 369 Event event = eventIter.next(); 370 if (!(event.getType() instanceof SOAPEventType)) { 371 eventIter.remove(); 372 } else { 373 SOAPEventType eventType = (SOAPEventType) event.getType(); 374 if( !"TransportService".equals(eventType.getServiceName()) ) { 375 eventIter.remove(); 376 } 377 } 378 } 379 380 UMLUtils.createInteractionFromEventSequence(httpSequence, model, "foo", "LogisticsTestSuite"); 381 } 382 383 ModelUtils.writeModelToFile(model, OUTPUT_DIR + "ita_v2_result.uml"); 384 385 } 374 386 375 387 private void deleteFiles(File file) {
Note: See TracChangeset
for help on using the changeset viewer.