61
 What do YOU want UML to be?  |  Long Talk  |  © Copyright 2007 by IBM Corp.; made available under the EPL v1.0
Featherweight Extensions – Example
org.eclipse.uml2.uml.Package testSuite = UMLFactory.eINSTANCE.createPackage();
resource.getContents().add(testSuite);
testSuite.addKeyword("testSuite");
testSuite.setName("FeatherweightTests");
org.eclipse.uml2.uml.Class testContext = testSuite.createOwnedClass("FeatherweightExample", false);
testContext.addKeyword("testContext");
Operation testCase = testContext.createOwnedOperation("testExtension", null, null);
testCase.addKeyword("testCase");
Comment objective = testCase.createOwnedComment();
objective.addKeyword("objective");
objective.getAnnotatedElements().add(testCase);
objective.setBody("Test featherweight extension of UML2.");