Changeset 2005 for trunk/autoquest-plugin-uml/src/main/java/de
- Timestamp:
- 07/14/15 11:09:52 (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
r2004 r2005 53 53 import org.eclipse.uml2.uml.LiteralBoolean; 54 54 import org.eclipse.uml2.uml.LiteralInteger; 55 import org.eclipse.uml2.uml.LiteralNull;56 55 import org.eclipse.uml2.uml.LiteralReal; 57 56 import org.eclipse.uml2.uml.LiteralString; … … 60 59 import org.eclipse.uml2.uml.MessageSort; 61 60 import org.eclipse.uml2.uml.Model; 62 import org.eclipse.uml2.uml.NamedElement;63 61 import org.eclipse.uml2.uml.Operation; 64 62 import org.eclipse.uml2.uml.Package; … … 459 457 } 460 458 for (Property property : fetchAllTestComponentProperties(testContext)) { 461 // TODO check if this is still required462 /*463 * if (userLifeline != null) { throw new RuntimeException(464 * "TestContext must only have one TestComponent for the application of usage-based testing."465 * ); }466 */467 459 userLifeline = interaction.createLifeline(property.getName()); 468 460 userLifeline.setRepresents(property); … … 1094 1086 } 1095 1087 1096 // TODO String path = calledOperation.getName() + ":" + param.getName();1097 1088 String path = calledOperation.getName() + ":" + param.getType().getName(); 1098 // create param node1099 // Expression argument =1100 // (Expression) callMessage.createArgument(param.getName(), param.getType(),1101 // UMLPackage.Literals.EXPRESSION);1102 1089 if ((isInParameter(param) && SOAPUtils.isSOAPRequest(event)) || 1103 1090 (isOutParameter(param) && SOAPUtils.isSOAPResponse(event))) … … 1116 1103 instSpecParameters.getClassifiers().add((DataType) param.getType()); 1117 1104 instSpecNumber.setValue(instSpecNumber.intValue() + 1); 1118 // InstanceValue parametersValue =1119 // (InstanceValue) argument1120 // .createOperand(param.getType().getName(), param.getType(),1121 // UMLPackage.Literals.INSTANCE_VALUE);1122 // parametersValue.setInstance(instSpecParameters);1123 1105 InstanceValue instanceValue = 1124 1106 (InstanceValue) message.createArgument(param.getName(), param.getType(), … … 1131 1113 SOAPUtils.getMatchingChildNode(internalParameter.getType().getName(), 1132 1114 requestBody); 1133 // TODO the mistake is somewhere around here ... probably1134 // List<org.w3c.dom.Element> paramNodes =1135 // SOAPUtils.getMatchingChildNode(param.getName(), requestBody);1136 1115 int multiplicityChosen = paramNodes.size(); 1137 1116 … … 1235 1214 int multiplicityChosen = 0; 1236 1215 if (currentNode != null) { 1237 // TODO attributeNodes = SOAPUtils.getMatchingChildNode(prop.getName(),1238 // currentNode);1239 1216 attributeNodes = SOAPUtils.getMatchingChildNode(prop.getName(), currentNode); 1240 1217 multiplicityChosen = attributeNodes.size(); … … 1275 1252 Console.traceln(Level.SEVERE, "property neither DataType nor PrimitiveType: " + 1276 1253 prop.getType()); 1277 // TODO abort?1254 throw new RuntimeException("can only handle DataType and PrimitiveType properties but was: " + prop.getType().getClass().getName()); 1278 1255 } 1279 1256 } … … 1329 1306 * used for warnings and debug information 1330 1307 */ 1308 1309 @SuppressWarnings("unused") 1310 @Deprecated 1331 1311 private static void createOperandPrimitiveType(Parameter param, 1332 1312 Expression argument, … … 1489 1469 Console.traceln(Level.SEVERE, "could not create literal for primitive type: " + 1490 1470 prop.getType().getName()); 1491 // TODO abort? 1492 } 1493 } 1494 } 1495 1496 /** 1497 * <p> 1498 * Sets values for the parameters of a reply message. The values are, all LiterealNull and to 1499 * the INOUT, OUT and REPLY parameters, the UTP stereotype LiteralAny is applied. 1500 * </p> 1501 * 1502 * @param replyMessage 1503 * reply message for which the parameters are set 1504 * @param calledOperation 1505 * operation that is replied for by the message 1506 */ 1507 private static void setReplyMessageParameters(Message replyMessage, Operation calledOperation) { 1508 for (Parameter param : calledOperation.getOwnedParameters()) { 1509 LiteralNull argument = 1510 (LiteralNull) replyMessage.createArgument(param.getName(), param.getType(), 1511 UMLPackage.Literals.LITERAL_NULL); 1512 1513 if (isOutParameter(param)) { 1514 argument.applyStereotype(UTPUtils.getLiteralAnyStereotype(replyMessage.getModel())); 1471 throw new RuntimeException("unknown primitive type: " + prop.getType().getName()); 1515 1472 } 1516 1473 } … … 1577 1534 */ 1578 1535 private static <K, V extends Comparable<? super V>> Map<K, V> sortByValue(Map<K, V> map) { 1579 // TODO possibly move to another class1580 1536 List<Map.Entry<K, V>> list = new LinkedList<>(map.entrySet()); 1581 1537 Collections.sort(list, new Comparator<Map.Entry<K, V>>() {
Note: See TracChangeset
for help on using the changeset viewer.