use of com.github.javaparser.resolution.types.ResolvedTypeVariable in project javaparser by javaparser.
the class InferenceContextTest method placingASingleVariableTopLevel.
@Test
public void placingASingleVariableTopLevel() {
ResolvedType result = new InferenceContext(MyObjectProvider.INSTANCE).addPair(new ResolvedTypeVariable(tpE), listOfString);
assertEquals(new InferenceVariableType(0, MyObjectProvider.INSTANCE), result);
}
use of com.github.javaparser.resolution.types.ResolvedTypeVariable in project javaparser by javaparser.
the class ArrayTypeTest method setup.
@Before
public void setup() {
typeSolver = new ReflectionTypeSolver();
OBJECT = new ReferenceTypeImpl(new ReflectionClassDeclaration(Object.class, typeSolver), typeSolver);
STRING = new ReferenceTypeImpl(new ReflectionClassDeclaration(String.class, typeSolver), typeSolver);
arrayOfBooleans = new ResolvedArrayType(ResolvedPrimitiveType.BOOLEAN);
arrayOfStrings = new ResolvedArrayType(STRING);
tpA = ResolvedTypeParameterDeclaration.onType("A", "foo.Bar", Collections.emptyList());
arrayOfListOfA = new ResolvedArrayType(new ReferenceTypeImpl(new ReflectionInterfaceDeclaration(List.class, typeSolver), ImmutableList.of(new ResolvedTypeVariable(tpA)), typeSolver));
arrayOfListOfStrings = new ResolvedArrayType(new ReferenceTypeImpl(new ReflectionInterfaceDeclaration(List.class, typeSolver), ImmutableList.of(new ReferenceTypeImpl(new ReflectionClassDeclaration(String.class, typeSolver), typeSolver)), typeSolver));
}
use of com.github.javaparser.resolution.types.ResolvedTypeVariable in project javaparser by javaparser.
the class NullTypeTest method setup.
@Before
public void setup() {
typeSolver = new ReflectionTypeSolver();
OBJECT = new ReferenceTypeImpl(new ReflectionClassDeclaration(Object.class, typeSolver), typeSolver);
STRING = new ReferenceTypeImpl(new ReflectionClassDeclaration(String.class, typeSolver), typeSolver);
arrayOfBooleans = new ResolvedArrayType(ResolvedPrimitiveType.BOOLEAN);
arrayOfListOfA = new ResolvedArrayType(new ReferenceTypeImpl(new ReflectionInterfaceDeclaration(List.class, typeSolver), ImmutableList.of(new ResolvedTypeVariable(ResolvedTypeParameterDeclaration.onType("A", "foo.Bar", Collections.emptyList()))), typeSolver));
}
use of com.github.javaparser.resolution.types.ResolvedTypeVariable in project javaparser by javaparser.
the class TypeVariableUsageTest method setup.
@Before
public void setup() {
tpA = new ResolvedTypeVariable(ResolvedTypeParameterDeclaration.onType("A", "foo.Bar", Collections.emptyList()));
typeSolver = new ReflectionTypeSolver();
tpString = new ReferenceTypeImpl(new ReflectionClassDeclaration(String.class, typeSolver), typeSolver);
}
use of com.github.javaparser.resolution.types.ResolvedTypeVariable in project javaparser by javaparser.
the class WildcardUsageTest method setup.
@Before
public void setup() {
typeSolver = new ReflectionTypeSolver();
foo = new ReferenceTypeImpl(new ReflectionClassDeclaration(Foo.class, typeSolver), typeSolver);
bar = new ReferenceTypeImpl(new ReflectionClassDeclaration(Bar.class, typeSolver), typeSolver);
object = new ReferenceTypeImpl(new ReflectionClassDeclaration(Object.class, typeSolver), typeSolver);
string = new ReferenceTypeImpl(new ReflectionClassDeclaration(String.class, typeSolver), typeSolver);
superFoo = ResolvedWildcard.superBound(foo);
superBar = ResolvedWildcard.superBound(bar);
extendsFoo = ResolvedWildcard.extendsBound(foo);
extendsBar = ResolvedWildcard.extendsBound(bar);
a = new ResolvedTypeVariable(ResolvedTypeParameterDeclaration.onType("A", "foo.Bar", Collections.emptyList()));
superA = ResolvedWildcard.superBound(a);
extendsA = ResolvedWildcard.extendsBound(a);
superString = ResolvedWildcard.superBound(string);
extendsString = ResolvedWildcard.extendsBound(string);
}
Aggregations