use of com.avaloq.tools.ddk.xtext.resource.ResourceDescription2 in project dsl-devkit by dsldevkit.
the class BugAig1084 method recursiveLookUp.
/**
* Test that recursive calls to {@link ResourceDescription2#getLookUp()} by {@link ResourceDescription2#computeExportedObjects()} do not cause
* stack-overflow.
*/
@Test
public void recursiveLookUp() {
Resource resource = org.mockito.Mockito.mock(Resource.class);
BasicEList<Adapter> emptyEList = new BasicEList<Adapter>();
org.mockito.Mockito.when(resource.eAdapters()).thenReturn(emptyEList);
IResourceScopeCache cache = new OnChangeEvictingCache();
new ResourceDescription2(resource, null, cache) {
@Override
protected List<IEObjectDescription> computeExportedObjects() {
return Lists.newArrayList(getLookUp().getExportedObjects());
}
}.getExportedObjects();
}
Aggregations