Changeset 2009 for trunk/autoquest-plugin-uml/src/main
- Timestamp:
- 07/14/15 13:20:26 (9 years ago)
- Location:
- trunk/autoquest-plugin-uml/src/main/java/de/ugoe/cs/autoquest/plugin/uml
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-plugin-uml/src/main/java/de/ugoe/cs/autoquest/plugin/uml/UMLInteractionCreator.java
r2008 r2009 15 15 package de.ugoe.cs.autoquest.plugin.uml; 16 16 17 import java.util.HashMap; 17 18 import java.util.Iterator; 18 19 import java.util.List; 20 import java.util.Map; 19 21 import java.util.Set; 20 22 import java.util.logging.Level; … … 45 47 import org.eclipse.uml2.uml.Slot; 46 48 import org.eclipse.uml2.uml.UMLPackage; 49 import org.w3c.dom.Element; 47 50 48 51 import de.ugoe.cs.autoquest.eventcore.Event; … … 75 78 */ 76 79 private final boolean useRandomMsgBodies; 77 80 81 /** 82 * TODO 83 */ 84 private final Map<String, InstanceSpecification> instanceSpecificationCache; 85 78 86 /** 79 87 * <p> … … 93 101 this.testContextName = testContextName; 94 102 this.useRandomMsgBodies = useRandomMsgBodies; 103 instanceSpecificationCache = new HashMap<String, InstanceSpecification>(); 95 104 } 96 105 … … 316 325 String prefix) 317 326 { 318 org.w3c.dom.Element requestBody;327 Element requestBody; 319 328 if (SOAPUtils.isSOAPRequest(event)) { 320 329 requestBody = … … 388 397 internalParameter.getType(), 389 398 UMLPackage.Literals.INSTANCE_VALUE); 390 value391 .setInstance(createInstanceSpecification((DataType) internalParameter392 .getType(),393 instSpecPkg, prefix,394 instSpecNumber, paramNode,395 path));399 InstanceSpecification instSpec = createInstanceSpecification((DataType) internalParameter 400 .getType(), 401 instSpecPkg, prefix, 402 instSpecNumber, paramNode, 403 path); 404 value.setInstance(instSpec); 396 405 /* 397 406 * InstanceValue value = (InstanceValue) argument .createOperand(null, … … 443 452 String path) 444 453 { 454 if( instanceSpecificationCache.containsKey(SOAPUtils.getSerialization(currentNode)) ) { 455 return instanceSpecificationCache.get(SOAPUtils.getSerialization(currentNode)); 456 } 445 457 if ("".equals(path)) { 446 458 path = type.getName(); … … 505 517 } 506 518 } 519 instanceSpecificationCache.put(SOAPUtils.getSerialization(currentNode), instSpec); 507 520 return instSpec; 508 521 } -
trunk/autoquest-plugin-uml/src/main/java/de/ugoe/cs/autoquest/plugin/uml/UMLUtils.java
r2008 r2009 423 423 * defines is random request bodies are used or the body of the associated event 424 424 */ 425 public static Interaction createInteractionFromEventSequence(List<Event> sequence,425 public static List<Interaction> createInteractionFromEventSequence(Collection<List<Event>> sequences, 426 426 Model model, 427 427 String interactionName, … … 429 429 boolean useRandomMsgBodies) 430 430 { 431 List<Interaction> interactions = new LinkedList<>(); 431 432 UMLInteractionCreator interactionCreator = new UMLInteractionCreator(model, testContextName, useRandomMsgBodies); 432 return interactionCreator.createInteraction(sequence, interactionName); 433 int i=0; 434 for( List<Event> sequence : sequences ) { 435 interactions.add(interactionCreator.createInteraction(sequence, interactionName+"_"+i)); 436 i++; 437 } 438 return interactions; 433 439 } 434 440
Note: See TracChangeset
for help on using the changeset viewer.