Changeset 1914 for trunk/autoquest-plugin-uml-test/src/test/java/de/ugoe
- Timestamp:
- 03/12/15 09:45:52 (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
r1908 r1914 316 316 317 317 @Test 318 public void testValidateModelWithLog_HL7_ v2() throws Exception {318 public void testValidateModelWithLog_HL7_RLUS_v3() throws Exception { 319 319 HTTPLogParser parser = 320 320 new HTTPLogParser(new File(ClassLoader … … 330 330 Model model = 331 331 ModelUtils.loadModel(ClassLoader 332 .getSystemResourceAsStream("hl7model_v2.uml")); 332 .getSystemResourceAsStream("hl7model_v3.uml")); 333 334 int violations = UMLUtils.validateModelWithLog(httpSequences, model, "RLUSTestSuite_1"); 335 if( violations==0 ) { 336 System.out.println("No problems found."); 337 } else { 338 System.out.println(violations + " violations found."); 339 } 340 341 // remove everything but rlusService from sequences 342 for (List<Event> httpSequence : httpSequences) { 343 for (Iterator<Event> eventIter = httpSequence.iterator(); eventIter.hasNext();) { 344 Event event = eventIter.next(); 345 if (!(event.getType() instanceof SOAPEventType)) { 346 eventIter.remove(); 347 } else { 348 SOAPEventType eventType = (SOAPEventType) event.getType(); 349 if( !"rlusService".equals(eventType.getServiceName()) ) { 350 eventIter.remove(); 351 } 352 } 353 } 354 355 UMLUtils.createInteractionFromEventSequence(httpSequence, model, "foo", "RLUSTestSuite_1"); 356 } 357 358 ModelUtils.writeModelToFile(model, OUTPUT_DIR + "hl7_v3_result.uml"); 359 } 360 361 @Test 362 public void testValidateModelWithLog_HL7_IXS_v3() throws Exception { 363 HTTPLogParser parser = 364 new HTTPLogParser(new File(ClassLoader 365 .getSystemResource("hl7_ixs_servicenamemap.txt") 366 .getFile())); 367 parser 368 .parseFile(new File(ClassLoader 369 .getSystemResource("testCreateInteractionFromEventSequence_1_usagedata.log") 370 .getFile())); 371 Collection<List<Event>> httpSequences = parser.getSequences(); 372 373 374 Model model = 375 ModelUtils.loadModel(ClassLoader 376 .getSystemResourceAsStream("hl7model_v3.uml")); 333 377 334 378 int violations = UMLUtils.validateModelWithLog(httpSequences, model, "IXSTestSuite_1"); … … 338 382 System.out.println(violations + " violations found."); 339 383 } 384 385 // remove everything but rlusService from sequences 386 for (List<Event> httpSequence : httpSequences) { 387 for (Iterator<Event> eventIter = httpSequence.iterator(); eventIter.hasNext();) { 388 Event event = eventIter.next(); 389 if (!(event.getType() instanceof SOAPEventType)) { 390 eventIter.remove(); 391 } else { 392 SOAPEventType eventType = (SOAPEventType) event.getType(); 393 if( !"ixsService".equals(eventType.getServiceName()) ) { 394 eventIter.remove(); 395 } 396 } 397 } 398 399 UMLUtils.createInteractionFromEventSequence(httpSequence, model, "foo", "IXSTestSuite_1"); 400 } 401 402 ModelUtils.writeModelToFile(model, OUTPUT_DIR + "hl7_v3_result.uml"); 340 403 } 341 404
Note: See TracChangeset
for help on using the changeset viewer.