@Override protected void setUp() throws Exception { if (!initialized) { if (!EMFPlugin.IS_ECLIPSE_RUNNING) { @SuppressWarnings("unused") EPackage pkg = UMLPackage.eINSTANCE; Resource.Factory.Registry.INSTANCE .getExtensionToFactoryMap() .put(UMLResource.FILE_EXTENSION, UMLResource.Factory.INSTANCE); } resourceSet = new ResourceSetImpl(); Resource resource = new ResourceImpl(); resourceSet.getResources().add(resource); TYPE_STRING = UMLFactory.eINSTANCE.createPrimitiveType(); TYPE_STRING.setName(PRIMITIVE_TYPE_STRING); resource.getContents().add(TYPE_STRING); TYPE_INTEGER = UMLFactory.eINSTANCE.createPrimitiveType(); TYPE_INTEGER.setName(PRIMITIVE_TYPE_INTEGER); resource.getContents().add(TYPE_INTEGER); initialized = true; } }
public Operation createOwnedPrimitiveOperation( PrimitiveType aPrimitiveType, String name, EList<String> paramNames, EList<Type> paramTypes, Type type, boolean isQuery) { Operation operation = aPrimitiveType.createOwnedOperation(name, paramNames, paramTypes, type); if (isQuery) { operation.setIsQuery(true); } return operation; }