- Timestamp:
- 09/24/14 12:04:59 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-plugin-uml/src/main/java/de/ugoe/cs/autoquest/plugin/uml/UMLUtils.java
r1759 r1761 40 40 import org.eclipse.uml2.uml.Port; 41 41 import org.eclipse.uml2.uml.Profile; 42 import org.eclipse.uml2.uml.Property; 42 43 import org.eclipse.uml2.uml.Region; 43 44 import org.eclipse.uml2.uml.StateMachine; … … 286 287 (Interaction) testContext.createPackagedElement(interactionName + "_Impl", 287 288 UMLPackage.Literals.INTERACTION); 289 290 operation.getMethods().add(interaction); 288 291 289 292 Lifeline userLifeline = interaction.createLifeline("user"); … … 293 296 Component userComponent = 294 297 (Component) model.getPackagedElement("User", true, UMLPackage.Literals.COMPONENT, true); 295 Port userPort = (Port) userComponent.getAttribute("p_user_rlus", null); 298 299 EList<Property> userAttributes = userComponent.getAttributes(); 300 List<Port> userPorts = new LinkedList<>(); 301 for( Property userAttribute : userAttributes ) { 302 if( userAttribute instanceof Port ) { 303 userPorts.add((Port) userAttribute); 304 } 305 } 296 306 297 307 int i = 0; … … 342 352 message.setSendEvent(sendFragment); 343 353 message.setReceiveEvent(recvFragment); 344 345 EList<ConnectorEnd> sourceEnds = userPort.getEnds(); 354 346 355 EList<ConnectorEnd> targetEnds = portMap.get(serviceName).getEnds(); 347 356 348 for (ConnectorEnd sourceEnd : sourceEnds) { 349 Connector sourceConnector = (Connector) sourceEnd.eContainer(); 350 for (ConnectorEnd targetEnd : targetEnds) { 351 Connector targetConnector = (Connector) targetEnd.eContainer(); 352 if (targetConnector == sourceConnector) { 353 message.setConnector(targetConnector); 357 for( Port userPort : userPorts ) { 358 EList<ConnectorEnd> sourceEnds = userPort.getEnds(); 359 for (ConnectorEnd sourceEnd : sourceEnds) { 360 Connector sourceConnector = (Connector) sourceEnd.eContainer(); 361 for (ConnectorEnd targetEnd : targetEnds) { 362 Connector targetConnector = (Connector) targetEnd.eContainer(); 363 if (targetConnector == sourceConnector) { 364 message.setConnector(targetConnector); 365 } 354 366 } 355 367 }
Note: See TracChangeset
for help on using the changeset viewer.