use of org.eclipse.xtext.resource.IEObjectDescription in project xtext-eclipse by eclipse.
the class AbstractConstructorScopeTest method testGetElementsByInstance_04.
@Test
public void testGetElementsByInstance_04() {
QualifiedName qualifiedName = QualifiedName.create("java", "util", "Hashtable", "Entry");
IEObjectDescription hashMapEntry = getConstructorScope().getSingleElement(qualifiedName);
JvmConstructor constructor = (JvmConstructor) hashMapEntry.getEObjectOrProxy();
Iterable<IEObjectDescription> descriptions = getConstructorScope().getElements(constructor);
List<IEObjectDescription> list = Lists.newArrayList(descriptions);
assertEquals(2, list.size());
assertEquals(qualifiedName, list.get(0).getName());
QualifiedName qualifiedNameWithDollar = QualifiedName.create("java", "util", "Hashtable$Entry");
assertEquals(qualifiedNameWithDollar, list.get(1).getName());
}
use of org.eclipse.xtext.resource.IEObjectDescription in project xtext-eclipse by eclipse.
the class AbstractConstructorScopeTest method testGetElementByInstance_04.
@Test
public void testGetElementByInstance_04() {
QualifiedName qualifiedName = QualifiedName.create("java", "util", "Hashtable", "Entry");
IEObjectDescription hashMapEntry = getConstructorScope().getSingleElement(qualifiedName);
JvmConstructor constructor = (JvmConstructor) hashMapEntry.getEObjectOrProxy();
IEObjectDescription element = getConstructorScope().getSingleElement(constructor);
assertNotNull(element);
assertEquals(qualifiedName, element.getName());
}
use of org.eclipse.xtext.resource.IEObjectDescription in project xtext-eclipse by eclipse.
the class AbstractTypeScopeTest method testGetElementsByInstance_01.
@Test
public void testGetElementsByInstance_01() {
IEObjectDescription mapEntryDescription = getTypeScope().getSingleElement(QualifiedName.create("java", "util", "Map$Entry"));
EObject mapEntry = mapEntryDescription.getEObjectOrProxy();
Iterable<IEObjectDescription> lookupDescriptions = getTypeScope().getElements(mapEntry);
List<IEObjectDescription> list = Lists.newArrayList(lookupDescriptions);
assertEquals(2, list.size());
assertEquals(QualifiedName.create("java", "util", "Map", "Entry"), list.get(0).getName());
assertEquals(QualifiedName.create("java", "util", "Map$Entry"), list.get(1).getName());
}
use of org.eclipse.xtext.resource.IEObjectDescription in project xtext-eclipse by eclipse.
the class AbstractTypeScopeTest method testGetElementByInstance_02.
@Test
public void testGetElementByInstance_02() {
JvmAnnotationReference annotationReference = TypesFactory.eINSTANCE.createJvmAnnotationReference();
IEObjectDescription element = getTypeScope().getSingleElement(annotationReference);
assertNull(element);
}
use of org.eclipse.xtext.resource.IEObjectDescription in project xtext-eclipse by eclipse.
the class AbstractTypeScopeTest method testGetElementByInstance_03.
@Test
public void testGetElementByInstance_03() {
IEObjectDescription mapEntryDescription = getTypeScope().getSingleElement(QualifiedName.create("java", "util", "Map$Entry"));
EObject mapEntry = mapEntryDescription.getEObjectOrProxy();
IEObjectDescription lookupDescription = getTypeScope().getSingleElement(mapEntry);
assertNotNull(lookupDescription);
assertEquals(QualifiedName.create("java", "util", "Map", "Entry"), lookupDescription.getName());
}
Aggregations