本文整理汇总了Java中org.eclipse.xtext.common.types.JvmGenericType.eResource方法的典型用法代码示例。如果您正苦于以下问题:Java JvmGenericType.eResource方法的具体用法?Java JvmGenericType.eResource怎么用?Java JvmGenericType.eResource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.xtext.common.types.JvmGenericType
的用法示例。
在下文中一共展示了JvmGenericType.eResource方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testFindTypeByName_javaUtilList_01
import org.eclipse.xtext.common.types.JvmGenericType; //导入方法依赖的package包/类
@Test
public void testFindTypeByName_javaUtilList_01() {
String typeName = List.class.getName();
JvmGenericType type = (JvmGenericType) getTypeProvider().findTypeByName(typeName);
assertNotNull(type);
assertEquals(typeName, type.getIdentifier());
assertEquals(1, type.getTypeParameters().size());
JvmTypeParameter typeVariable = type.getTypeParameters().get(0);
assertEquals("E", typeVariable.getName());
assertEquals(1, typeVariable.getConstraints().size());
JvmTypeConstraint typeConstraint = typeVariable.getConstraints().get(0);
assertTrue(typeConstraint instanceof JvmUpperBound);
JvmUpperBound upperBound = (JvmUpperBound) typeConstraint;
assertSame(typeVariable, upperBound.getOwner());
assertNotNull(upperBound.getTypeReference());
assertFalse(upperBound.getTypeReference().getType().eIsProxy());
assertEquals(Object.class.getName(), upperBound.getTypeReference().getIdentifier());
diagnose(type);
Resource resource = type.eResource();
getAndResolveAllFragments(resource);
recomputeAndCheckIdentifiers(resource);
}
示例2: testMemberCount_04
import org.eclipse.xtext.common.types.JvmGenericType; //导入方法依赖的package包/类
@Test
public void testMemberCount_04() {
String typeName = NestedTypes.class.getName();
JvmGenericType type = (JvmGenericType) getTypeProvider().findTypeByName(typeName);
int methodCount = NestedTypes.class.getDeclaredMethods().length;
assertEquals(1, methodCount);
int constructorCount = NestedTypes.class.getDeclaredConstructors().length;
assertEquals(1, constructorCount); // default constructor
int nestedTypesCount = NestedTypes.class.getClasses().length;
assertEquals(1, nestedTypesCount);
assertEquals(methodCount + constructorCount + nestedTypesCount, type.getMembers().size());
diagnose(type);
Resource resource = type.eResource();
getAndResolveAllFragments(resource);
recomputeAndCheckIdentifiers(resource);
}
示例3: testMemberCount_07
import org.eclipse.xtext.common.types.JvmGenericType; //导入方法依赖的package包/类
@Test
public void testMemberCount_07() {
String typeName = StaticNestedTypes.class.getName();
JvmGenericType type = (JvmGenericType) getTypeProvider().findTypeByName(typeName);
int methodCount = StaticNestedTypes.class.getDeclaredMethods().length;
assertEquals(1, methodCount);
int constructorCount = StaticNestedTypes.class.getDeclaredConstructors().length;
assertEquals(1, constructorCount); // default constructor
int nestedTypesCount = StaticNestedTypes.class.getClasses().length;
assertEquals(1, nestedTypesCount);
assertEquals(methodCount + constructorCount + nestedTypesCount, type.getMembers().size());
diagnose(type);
Resource resource = type.eResource();
getAndResolveAllFragments(resource);
recomputeAndCheckIdentifiers(resource);
}
示例4: apply
import org.eclipse.xtext.common.types.JvmGenericType; //导入方法依赖的package包/类
private void doTestFindTypeByName_$StartsWithDollar(JvmGenericType type) {
assertNotNull(type);
Iterable<String> innerTypes = Iterables.transform(Iterables.filter(type.getMembers(), JvmType.class),
new Function<JvmType, String>() {
@Override
public String apply(JvmType input) {
return input.getSimpleName();
}
});
assertTrue("Missing member type $Builder", Iterables.contains(innerTypes, "Builder"));
assertEquals(1, Iterables.size(innerTypes));
diagnose(type);
Resource resource = type.eResource();
getAndResolveAllFragments(resource);
recomputeAndCheckIdentifiers(resource);
}
示例5: testFindTypeByName_javaLangNumber_01
import org.eclipse.xtext.common.types.JvmGenericType; //导入方法依赖的package包/类
@Test
public void testFindTypeByName_javaLangNumber_01() {
String typeName = Number.class.getName();
JvmGenericType type = (JvmGenericType) getTypeProvider().findTypeByName(typeName);
assertFalse("toplevel type is not static", type.isStatic());
assertEquals(type.getSuperTypes().toString(), 2, type.getSuperTypes().size());
JvmType objectType = type.getSuperTypes().get(0).getType();
assertFalse("isProxy: " + objectType, objectType.eIsProxy());
assertEquals(Object.class.getName(), objectType.getIdentifier());
JvmType serializableType = type.getSuperTypes().get(1).getType();
assertFalse("isProxy: " + serializableType, serializableType.eIsProxy());
assertEquals(Serializable.class.getName(), serializableType.getIdentifier());
diagnose(type);
Resource resource = type.eResource();
getAndResolveAllFragments(resource);
recomputeAndCheckIdentifiers(resource);
}
示例6: testMemberCount_01
import org.eclipse.xtext.common.types.JvmGenericType; //导入方法依赖的package包/类
@Test
public void testMemberCount_01() {
String typeName = ParameterizedMethods.class.getName();
JvmGenericType type = (JvmGenericType) getTypeProvider().findTypeByName(typeName);
int methodCount = ParameterizedMethods.class.getDeclaredMethods().length;
assertEquals(10, methodCount);
int constructorCount = ParameterizedMethods.class.getDeclaredConstructors().length;
assertEquals(1, constructorCount);
assertEquals(methodCount + constructorCount, type.getMembers().size());
diagnose(type);
Resource resource = type.eResource();
getAndResolveAllFragments(resource);
recomputeAndCheckIdentifiers(resource);
}
示例7: testMemberCount_02
import org.eclipse.xtext.common.types.JvmGenericType; //导入方法依赖的package包/类
@Test
public void testMemberCount_02() {
String typeName = InitializerWithConstructor.class.getName();
JvmGenericType type = (JvmGenericType) getTypeProvider().findTypeByName(typeName);
int methodCount = InitializerWithConstructor.class.getDeclaredMethods().length;
assertEquals(0, methodCount);
int constructorCount = InitializerWithConstructor.class.getDeclaredConstructors().length;
assertEquals(1, constructorCount);
assertEquals(methodCount + constructorCount, type.getMembers().size());
diagnose(type);
Resource resource = type.eResource();
getAndResolveAllFragments(resource);
recomputeAndCheckIdentifiers(resource);
}
示例8: testMemberCount_03
import org.eclipse.xtext.common.types.JvmGenericType; //导入方法依赖的package包/类
@Test
public void testMemberCount_03() {
String typeName = InitializerWithoutConstructor.class.getName();
JvmGenericType type = (JvmGenericType) getTypeProvider().findTypeByName(typeName);
int methodCount = InitializerWithoutConstructor.class.getDeclaredMethods().length;
assertEquals(0, methodCount);
int constructorCount = InitializerWithoutConstructor.class.getDeclaredConstructors().length;
assertEquals(1, constructorCount); // default constructor
assertEquals(methodCount + constructorCount, type.getMembers().size());
diagnose(type);
Resource resource = type.eResource();
getAndResolveAllFragments(resource);
recomputeAndCheckIdentifiers(resource);
}
示例9: testBug347739_06
import org.eclipse.xtext.common.types.JvmGenericType; //导入方法依赖的package包/类
@Test
public void testBug347739_06() {
String typeNameList = List.class.getName();
JvmGenericType type = (JvmGenericType) getTypeProvider().findTypeByName(typeNameList);
Resource resource = type.eResource();
getAndResolveAllFragments(resource);
recomputeAndCheckIdentifiers(resource);
diagnose(type);
}
示例10: testBug347739_01
import org.eclipse.xtext.common.types.JvmGenericType; //导入方法依赖的package包/类
@Test
public void testBug347739_01() {
String typeName = Bug347739.class.getName();
JvmGenericType type = (JvmGenericType) getTypeProvider().findTypeByName(typeName);
Resource resource = type.eResource();
getAndResolveAllFragments(resource);
recomputeAndCheckIdentifiers(resource);
diagnose(type);
}
示例11: testBug347739_02
import org.eclipse.xtext.common.types.JvmGenericType; //导入方法依赖的package包/类
@Test
public void testBug347739_02() {
String typeName = Bug347739OneTypeParam.class.getName();
JvmGenericType type = (JvmGenericType) getTypeProvider().findTypeByName(typeName);
Resource resource = type.eResource();
getAndResolveAllFragments(resource);
recomputeAndCheckIdentifiers(resource);
diagnose(type);
}
示例12: testBug347739_03
import org.eclipse.xtext.common.types.JvmGenericType; //导入方法依赖的package包/类
@Test
public void testBug347739_03() {
String typeName = Bug347739ThreeTypeParams.class.getName();
JvmGenericType type = (JvmGenericType) getTypeProvider().findTypeByName(typeName);
Resource resource = type.eResource();
getAndResolveAllFragments(resource);
recomputeAndCheckIdentifiers(resource);
diagnose(type);
}
示例13: testFindTypeByName_AbstractMultimap
import org.eclipse.xtext.common.types.JvmGenericType; //导入方法依赖的package包/类
@Test
public void testFindTypeByName_AbstractMultimap() {
String typeName = "com.google.common.collect.AbstractMultimap";
JvmGenericType type = (JvmGenericType) getTypeProvider().findTypeByName(typeName);
assertNotNull(type);
diagnose(type, "java:/Objects/javax.annotation.Nullable#javax.annotation.Nullable");
Resource resource = type.eResource();
getAndResolveAllFragments(resource);
recomputeAndCheckIdentifiers(resource);
}
示例14: testBug347739_05
import org.eclipse.xtext.common.types.JvmGenericType; //导入方法依赖的package包/类
@Test
public void testBug347739_05() {
String typeName = Bug347739ThreeTypeParamsSuperSuper.class.getName();
JvmGenericType type = (JvmGenericType) getTypeProvider().findTypeByName(typeName);
Resource resource = type.eResource();
getAndResolveAllFragments(resource);
recomputeAndCheckIdentifiers(resource);
diagnose(type);
}
示例15: testFindTypeByName_TypeParamEndsWithDollar
import org.eclipse.xtext.common.types.JvmGenericType; //导入方法依赖的package包/类
@Test
public void testFindTypeByName_TypeParamEndsWithDollar() {
String typeName = "org.eclipse.xtext.common.types.testSetups.TypeParamEndsWithDollar";
JvmGenericType type = (JvmGenericType) getTypeProvider().findTypeByName(typeName);
assertNotNull(type);
diagnose(type);
Resource resource = type.eResource();
getAndResolveAllFragments(resource);
recomputeAndCheckIdentifiers(resource);
}