Java Code Examples for org.eclipse.xtext.common.types.JvmArrayType#eResource()

The following examples show how to use org.eclipse.xtext.common.types.JvmArrayType#eResource() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractTypeProviderTest.java    From xtext-extras with Eclipse Public License 2.0 6 votes vote down vote up
@Test
public void testFindTypeByName_javaLangNumber_02() {
	String typeName = Number[][].class.getName();
	JvmArrayType type = (JvmArrayType) getTypeProvider().findTypeByName(typeName);
	JvmOperation longValue = (JvmOperation) type.eResource().getEObject("java.lang.Number.longValue()");
	assertNotNull(longValue);
	JvmDeclaredType number = longValue.getDeclaringType();
	assertNotNull(number.getArrayType());
	assertSame(type, number.getArrayType().getArrayType());
	assertNull(type.eGet(TypesPackage.Literals.JVM_COMPONENT_TYPE__ARRAY_TYPE));
	// array will created on the fly
	assertNotNull(type.getArrayType());
	diagnose(type);
	Resource resource = type.eResource();
	getAndResolveAllFragments(resource);
	recomputeAndCheckIdentifiers(resource);
}
 
Example 2
Source File: AbstractTypeProviderTest.java    From xtext-extras with Eclipse Public License 2.0 6 votes vote down vote up
@Test
public void testFindTypeByName_javaLangNumber_02() {
	String typeName = Number[][].class.getName();
	JvmArrayType type = (JvmArrayType) getTypeProvider().findTypeByName(typeName);
	JvmOperation longValue = (JvmOperation) type.eResource().getEObject("java.lang.Number.longValue()");
	assertNotNull(longValue);
	JvmDeclaredType number = longValue.getDeclaringType();
	assertNotNull(number.getArrayType());
	assertSame(type, number.getArrayType().getArrayType());
	assertNull(type.eGet(TypesPackage.Literals.JVM_COMPONENT_TYPE__ARRAY_TYPE));
	// array will created on the fly
	assertNotNull(type.getArrayType());
	diagnose(type);
	Resource resource = type.eResource();
	getAndResolveAllFragments(resource);
	recomputeAndCheckIdentifiers(resource);
}
 
Example 3
Source File: AbstractTypeProviderTest.java    From xtext-eclipse with Eclipse Public License 2.0 6 votes vote down vote up
@Test
public void testFindTypeByName_javaLangNumber_02() {
	String typeName = Number[][].class.getName();
	JvmArrayType type = (JvmArrayType) getTypeProvider().findTypeByName(typeName);
	JvmOperation longValue = (JvmOperation) type.eResource().getEObject("java.lang.Number.longValue()");
	assertNotNull(longValue);
	JvmDeclaredType number = longValue.getDeclaringType();
	assertNotNull(number.getArrayType());
	assertSame(type, number.getArrayType().getArrayType());
	assertNull(type.eGet(TypesPackage.Literals.JVM_COMPONENT_TYPE__ARRAY_TYPE));
	// array will created on the fly
	assertNotNull(type.getArrayType());
	diagnose(type);
	Resource resource = type.eResource();
	getAndResolveAllFragments(resource);
	recomputeAndCheckIdentifiers(resource);
}