use of com.avaloq.tools.ddk.check.runtime.configuration.ModelLocation in project dsl-devkit by dsldevkit.
the class LibraryChecksStandaloneSetup method doSetup.
/**
* {@inheritDoc}
*/
public void doSetup() {
ICheckValidatorRegistry.INSTANCE.registerValidator(GRAMMAR_NAME, new LibraryChecksCheckImpl());
ICheckCatalogRegistry.INSTANCE.registerCatalog(GRAMMAR_NAME, new ModelLocation(LibraryChecksStandaloneSetup.class.getClassLoader().getResource(CATALOG_FILE_PATH), CATALOG_FILE_PATH));
LOG.info("Standalone setup done for com/avaloq/tools/ddk/check/validation/LibraryChecks.check");
}
use of com.avaloq.tools.ddk.check.runtime.configuration.ModelLocation in project dsl-devkit by dsldevkit.
the class BugAig1314 method testSameScopeUseTwice.
/**
* Tests that querying the same scope twice doesn't make the resource set grow.
*/
@Test
public void testSameScopeUseTwice() {
XtextResourceSet rs = new XtextResourceSet();
URL url = createURL();
ModelLocation modelLocation = createModelLocation(url);
CatalogFromExtensionPointScope scope = new TestScope(modelLocation, rs);
assertResourceSetEmpty(rs);
Iterable<IEObjectDescription> elements = scope.getAllElements();
assertIterableNotEmpty(elements);
int nofResourcesInMap = rs.getURIResourceMap().size();
int nofResourcesInSet = rs.getResources().size();
elements = scope.getAllElements();
assertIterableNotEmpty(elements);
assertResourceSet(rs, nofResourcesInSet, nofResourcesInMap);
}
use of com.avaloq.tools.ddk.check.runtime.configuration.ModelLocation in project dsl-devkit by dsldevkit.
the class BugAig1314 method testDifferentScopeUseTwice.
/**
* Tests that querying two different scopes doesn't make the resource set grow. That one was the real cause of bug AIG-1314.
*/
@Test
public void testDifferentScopeUseTwice() {
XtextResourceSet rs = new XtextResourceSet();
URL url = createURL();
ModelLocation modelLocation = createModelLocation(url);
CatalogFromExtensionPointScope scope = new TestScope(modelLocation, rs);
assertResourceSetEmpty(rs);
Iterable<IEObjectDescription> elements = scope.getAllElements();
assertIterableNotEmpty(elements);
int nofResourcesInMap = rs.getURIResourceMap().size();
int nofResourcesInSet = rs.getResources().size();
CatalogFromExtensionPointScope otherScope = new TestScope(modelLocation, rs);
assertResourceSet(rs, nofResourcesInSet, nofResourcesInMap);
elements = otherScope.getAllElements();
assertIterableNotEmpty(elements);
assertResourceSet(rs, nofResourcesInSet, nofResourcesInMap);
}
use of com.avaloq.tools.ddk.check.runtime.configuration.ModelLocation in project dsl-devkit by dsldevkit.
the class ExecutionEnvironmentStandaloneSetup method doSetup.
/**
* {@inheritDoc}
*/
public void doSetup() {
ICheckValidatorRegistry.INSTANCE.registerValidator(GRAMMAR_NAME, new ExecutionEnvironmentCheckImpl());
ICheckCatalogRegistry.INSTANCE.registerCatalog(GRAMMAR_NAME, new ModelLocation(ExecutionEnvironmentStandaloneSetup.class.getClassLoader().getResource(CATALOG_FILE_PATH), CATALOG_FILE_PATH));
LOG.info("Standalone setup done for com/avaloq/tools/ddk/check/validation/ExecutionEnvironment.check");
}
Aggregations