public URI getUri() { DeployedImportResolver importResolver = DeployedImportResolver.INSTANCE; CFile srcFile = importResolver.resolveImport(myId); if (srcFile != null) { return EmfUtil.makeUri(srcFile.toString()); } return URI.createPlatformPluginURI(myId, false); }
@Override public EObject create(EClass class_) { // return super.create(class_); if (myClassifierInitializations.get(class_) == null) { cacheClassifierInitExp(class_); } if (EmfUtil.isAssignableFrom(QvtOperationalStdLibrary.INSTANCE.getExceptionClass(), class_)) { return new ExceptionClassInstance(class_); } else { return new IntermediateClassInstance(class_); } }
public void testInvalidModel() { { URI uri = createWorkspaceUri("invalid.ecore"); // $NON-NLS-1$ assertNotNull(uri); assertTrue(EmfUtil.isUriExists(uri, new ResourceSetImpl(), true)); assertTrue(EmfUtil.isUriExists(uri, new ResourceSetImpl(), false)); assertFalse(EmfUtil.isUriExistsAsEObject(uri, new ResourceSetImpl(), true)); assertFalse(EmfUtil.isUriExistsAsEObject(uri, new ResourceSetImpl(), false)); } { URI uri = createPlatformUri("invalid.ecore"); // $NON-NLS-1$ assertNotNull(uri); assertTrue(EmfUtil.isUriExists(uri, new ResourceSetImpl(), true)); assertTrue(EmfUtil.isUriExists(uri, new ResourceSetImpl(), false)); assertFalse(EmfUtil.isUriExistsAsEObject(uri, new ResourceSetImpl(), true)); assertFalse(EmfUtil.isUriExistsAsEObject(uri, new ResourceSetImpl(), false)); } { URI uri = CustomEmfResourceFactory.createUri(CustomEmfResourceFactory.INVALID_MODEL); assertNotNull(uri); assertFalse(EmfUtil.isUriExists(uri, new ResourceSetImpl(), true)); assertFalse(EmfUtil.isUriExists(uri, new ResourceSetImpl(), false)); assertFalse(EmfUtil.isUriExistsAsEObject(uri, new ResourceSetImpl(), true)); assertFalse(EmfUtil.isUriExistsAsEObject(uri, new ResourceSetImpl(), false)); } }
protected boolean isMatchingPackage(final EPackage ePackage, final String packageQuery) { return matches(EmfUtil.getFullName(ePackage), packageQuery, false); }
public void testNonEmptyModel() { { URI uri = createWorkspaceUri("nonEmpty.ecore"); // $NON-NLS-1$ assertNotNull(uri); assertTrue(EmfUtil.isUriExists(uri, new ResourceSetImpl(), true)); assertTrue(EmfUtil.isUriExists(uri, new ResourceSetImpl(), false)); assertTrue(EmfUtil.isUriExistsAsEObject(uri, new ResourceSetImpl(), true)); assertTrue(EmfUtil.isUriExistsAsEObject(uri, new ResourceSetImpl(), false)); } { URI uri = createPlatformUri("nonEmpty.ecore"); // $NON-NLS-1$ assertNotNull(uri); assertTrue(EmfUtil.isUriExists(uri, new ResourceSetImpl(), true)); assertTrue(EmfUtil.isUriExists(uri, new ResourceSetImpl(), false)); assertTrue(EmfUtil.isUriExistsAsEObject(uri, new ResourceSetImpl(), true)); assertTrue(EmfUtil.isUriExistsAsEObject(uri, new ResourceSetImpl(), false)); } { URI uri = CustomEmfResourceFactory.createUri(CustomEmfResourceFactory.NON_EMPTY_MODEL); assertNotNull(uri); assertTrue(EmfUtil.isUriExists(uri, new ResourceSetImpl(), true)); assertTrue(EmfUtil.isUriExists(uri, new ResourceSetImpl(), false)); assertTrue(EmfUtil.isUriExistsAsEObject(uri, new ResourceSetImpl(), true)); assertTrue(EmfUtil.isUriExistsAsEObject(uri, new ResourceSetImpl(), false)); } }