use of com.avaloq.tools.ddk.check.scoping.CatalogFromExtensionPointScope 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.scoping.CatalogFromExtensionPointScope 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);
}
Aggregations