Changeset 2004
- Timestamp:
- 07/14/15 11:01:03 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-plugin-uml/src/main/java/de/ugoe/cs/autoquest/plugin/uml/UMLUtils.java
r2002 r2004 536 536 getOperationFromName(targetInterface.getOperations(), methodName); 537 537 // get connector 538 Connector connector = inferConnector(msgSourceLifeline, msgTargetLifeline, targetInterface); 539 if( connector==null ) { 540 throw new RuntimeException("Error creating message: could not find connector between the two life lines that supports the target interface at the target lifeline"); 538 Connector connector = 539 inferConnector(msgSourceLifeline, msgTargetLifeline, targetInterface); 540 if (connector == null) { 541 throw new RuntimeException( 542 "Error creating message: could not find connector between the two life lines that supports the target interface at the target lifeline"); 541 543 } 542 544 … … 988 990 * target lifeline of the message 989 991 */ 990 private static Connector inferConnector(Lifeline msgSourceLifeline, Lifeline msgTargetLifeline, Interface targetInterface) 992 private static Connector inferConnector(Lifeline msgSourceLifeline, 993 Lifeline msgTargetLifeline, 994 Interface targetInterface) 991 995 { 992 996 EList<Property> userAttributes = … … 1001 1005 for (Property targetAttribute : targetAttributes) { 1002 1006 if (targetAttribute instanceof Port) { 1003 if ( ((Port) targetAttribute).getProvideds().contains(targetInterface)) {1007 if (((Port) targetAttribute).getProvideds().contains(targetInterface)) { 1004 1008 EList<ConnectorEnd> targetEnds = ((Port) targetAttribute).getEnds(); 1005 1009 for (ConnectorEnd targetEnd : targetEnds) { … … 1084 1088 MutableInt instSpecNumber = new MutableInt(0); 1085 1089 1086 // FOR DEBUGGING1087 // Console.traceln(Level.FINE, "XML structure of path:" + StringTools.ENDLINE +1088 // SOAPUtils.getSerialization(requestBody));1089 // for( Parameter param : calledOperation.getOwnedParameters() ) {1090 // System.out.println(param.getName());1091 // if( param.getType() instanceof DataType ) {1092 // for( Property prop1 : ((DataType) param.getType()).getAllAttributes() ) {1093 // System.out.println(" " + prop1.getName());1094 // if( prop1.getType() instanceof DataType ) {1095 // for( Property prop2 : ((DataType) prop1.getType()).getAllAttributes() ) {1096 // System.out.println(" " + prop2.getName());1097 // if( prop2.getType() instanceof DataType ) {1098 // for( Property prop3 : ((DataType) prop2.getType()).getAllAttributes() ) {1099 // System.out.println(" " + prop3.getName());1100 // if( prop3.getType() instanceof DataType ) {1101 // for( Property prop4 : ((DataType) prop3.getType()).getAllAttributes() ) {1102 // System.out.println(" " + prop4.getName());1103 // }1104 // }1105 // }1106 // }1107 // }1108 // }1109 // }1110 // }1111 // }1112 1113 1090 // Set parameters of operation 1114 1091 for (Parameter param : calledOperation.getOwnedParameters()) { … … 1133 1110 DataType parametersNode = (DataType) param.getType(); 1134 1111 InstanceSpecification instSpecParameters = 1135 (InstanceSpecification) instSpecPkg.createPackagedElement(prefix + "instspec" + instSpecNumber.intValue() + "_" + 1136 param.getType().getName(), UMLPackage.Literals.INSTANCE_SPECIFICATION); 1112 (InstanceSpecification) instSpecPkg 1113 .createPackagedElement(prefix + "instspec" + instSpecNumber.intValue() + 1114 "_" + param.getType().getName(), 1115 UMLPackage.Literals.INSTANCE_SPECIFICATION); 1137 1116 instSpecParameters.getClassifiers().add((DataType) param.getType()); 1138 instSpecNumber.setValue(instSpecNumber.intValue() +1);1117 instSpecNumber.setValue(instSpecNumber.intValue() + 1); 1139 1118 // InstanceValue parametersValue = 1140 1119 // (InstanceValue) argument … … 1185 1164 .setInstance(createInstanceSpecification((DataType) internalParameter 1186 1165 .getType(), 1187 instSpecPkg, prefix, instSpecNumber, 1188 paramNode, path)); 1166 instSpecPkg, prefix, 1167 instSpecNumber, paramNode, 1168 path)); 1189 1169 /* 1190 1170 * InstanceValue value = (InstanceValue) argument .createOperand(null, … … 1242 1222 InstanceSpecification instSpec = 1243 1223 (InstanceSpecification) pkg 1244 .createPackagedElement(prefix + "instspec" + instSpecNumber.intValue() + "_" + type.getName(), 1224 .createPackagedElement(prefix + "instspec" + instSpecNumber.intValue() + "_" + 1225 type.getName(), 1245 1226 UMLPackage.Literals.INSTANCE_SPECIFICATION); 1246 1227 instSpec.getClassifiers().add(type); 1247 instSpecNumber.setValue(instSpecNumber.intValue() +1);1228 instSpecNumber.setValue(instSpecNumber.intValue() + 1); 1248 1229 for (Property prop : type.getAllAttributes()) { 1249 1230 if (prop.getType() instanceof PrimitiveType) { … … 1286 1267 UMLPackage.Literals.INSTANCE_VALUE); 1287 1268 value.setInstance(createInstanceSpecification((DataType) prop.getType(), pkg, 1288 prefix, instSpecNumber, attributeNode, path + 1289 "." + prop.getName())); 1269 prefix, instSpecNumber, 1270 attributeNode, 1271 path + "." + prop.getName())); 1290 1272 } 1291 1273 }
Note: See TracChangeset
for help on using the changeset viewer.