use of javax.lang.model.type.TypeMirror in project auto by google.
the class MoreTypesIsTypeOfTest method isTypeOf_Void.
@Test
public void isTypeOf_Void() {
assertTrue(MoreTypes.isType(typeElementFor(DeclaredVoid.class).asType()));
TypeMirror declared = extractReturnTypeFromHolder(typeElementFor(DeclaredVoid.class));
assertThat(MoreTypes.isTypeOf(Void.class, declared)).named("mirror of a void").isTrue();
}
use of javax.lang.model.type.TypeMirror in project auto by google.
the class MoreTypesIsTypeOfTest method isTypeOf_PrimitiveShort.
@Test
public void isTypeOf_PrimitiveShort() {
assertTrue(MoreTypes.isType(typeElementFor(PrimitiveShort.class).asType()));
TypeMirror type = extractReturnTypeFromHolder(typeElementFor(PrimitiveShort.class));
assertThat(MoreTypes.isTypeOf(Short.TYPE, type)).named("mirror of a short").isTrue();
}
use of javax.lang.model.type.TypeMirror in project auto by google.
the class MoreTypesIsTypeOfTest method isTypeOf_ArrayType.
@Test
public void isTypeOf_ArrayType() {
assertTrue(MoreTypes.isType(typeElementFor(ArrayType.class).asType()));
TypeMirror type = extractReturnTypeFromHolder(typeElementFor(ArrayType.class));
assertThat(MoreTypes.isTypeOf(new String[] {}.getClass(), type)).named("array mirror represents an array Class object").isTrue();
}
use of javax.lang.model.type.TypeMirror in project auto by google.
the class MoreTypesIsTypeOfTest method isTypeOf_PrimitiveDouble.
@Test
public void isTypeOf_PrimitiveDouble() {
assertTrue(MoreTypes.isType(typeElementFor(PrimitiveDouble.class).asType()));
TypeMirror type = extractReturnTypeFromHolder(typeElementFor(PrimitiveDouble.class));
assertThat(MoreTypes.isTypeOf(Double.TYPE, type)).named("mirror of a double").isTrue();
}
use of javax.lang.model.type.TypeMirror in project auto by google.
the class MoreTypesIsTypeOfTest method isTypeOf_PrimitiveByte.
@Test
public void isTypeOf_PrimitiveByte() {
assertTrue(MoreTypes.isType(typeElementFor(PrimitiveByte.class).asType()));
TypeMirror type = extractReturnTypeFromHolder(typeElementFor(PrimitiveByte.class));
assertThat(MoreTypes.isTypeOf(Byte.TYPE, type)).named("mirror of a byte").isTrue();
}
Aggregations