public final class AbstractTypesContract extends Object implements org.testng.ITest
AbstractTypes
.
This class should be instantiated and returned by a TestNG factory method (that is, a method annotated with
Factory
).
Constructor and Description |
---|
AbstractTypesContract(AbstractTypesProvider provider)
Constructs a new contract-test instance with the given provider.
|
public AbstractTypesContract(AbstractTypesProvider provider)
provider
- provider of AbstractTypes
instance, must not be nullNullPointerException
- if the argument is nullpublic String getTestName()
getTestName
in interface org.testng.ITest
public void setup()
public void testSetup()
TypeElement
instances in typeElementMap
.
The following is verified:
Element.asType()
returns "a prototypical type" which is "the element's invocation on the
type variables corresponding to its own formal type parameters".
type(Class)
returns a raw type if the given class object represents a generic type declaration.
type(Class)
to
AbstractTypes.toString(TypeMirror)
yields a string equal to the class's name.
public void requireValidElement()
AbstractTypes.requireValidElement(javax.lang.model.element.Element)
throws a
NullPointerException
if passed null.public void requireValidType()
AbstractTypes.requireValidType(TypeMirror)
does not throw an
exception if passed null.public void requireValidTypes()
AbstractTypes.requireValidTypes(TypeMirror[])
throws exceptions if
passed null or an array with null element.public void typeMirror()
public void substitute()
public void resolveActualTypeArguments()
AbstractTypes.resolveActualTypeArguments(TypeElement, TypeMirror)
when the second argument is
a generic type, a non-generic type, or a primitive type.public void resolveActualTypeArgumentsRaw()
AbstractTypes.resolveActualTypeArguments(TypeElement, TypeMirror)
if the second argument is a
raw type.public void resolveActualTypeArgumentsArrays()
AbstractTypes.resolveActualTypeArguments(TypeElement, TypeMirror)
if the second argument
contains an actual type argument that is an array type.public void testIsSubtypePrimitive()
AbstractTypes.isSubtype(TypeMirror, TypeMirror)
if one of the types is a primitive type.public void testIsSubtypeNull()
AbstractTypes.isSubtype(TypeMirror, TypeMirror)
if one of the types is the null type.public void testIsSubtypeArray()
AbstractTypes.isSubtype(TypeMirror, TypeMirror)
if one of the types is an array type.public void testIsSubtypeIntersection()
AbstractTypes.isSubtype(TypeMirror, TypeMirror)
if one of the types is an intersection type.public void testIsSubtypeRaw()
AbstractTypes.isSubtype(TypeMirror, TypeMirror)
if one of the types is a raw type.public void testIsSubtypeArrayTypeParameters()
public void testIsSubtypeSimpleTypeParameters()
public void testIsSubtypeWildcards()
public void capture()
AbstractTypes.capture(TypeMirror)
.public void captureSingleRecursiveBound()
public void captureInterdependentRecursiveBound()
public void testContainsInvalidArguments()
AbstractTypes.contains(TypeMirror, TypeMirror)
throws expected exceptions.public void testContains()
public void testErasureInvalidArguments()
AbstractTypes.erasure(TypeMirror)
throws expected exceptions.public void testErasure()
AbstractTypes.erasure(TypeMirror)
.public void asElementInvalidArguments()
AbstractTypes.asElement(TypeMirror)
throws expected exceptions.public void asElement()
AbstractTypes.asElement(TypeMirror)
.public void asType()
Element.asType()
.public void testIsSameTypeInvalidArguments()
AbstractTypes.isSameType(TypeMirror, TypeMirror)
throws expected exceptions.public void testIsSameType()
public void testGetTypeVariable()
public void createTypeVariable()
public void testSetTypeVariableBounds()
public void testGetIntersectionType()
public void testToString()
public void unboxedType()
Types.unboxedType(TypeMirror)
throws expected exceptions.public void boxedClass()
Types.boxedClass(PrimitiveType)
throws expected exceptions.public void boxingAndUnboxing()
Types.unboxedType(TypeMirror)
and Types.boxedClass(PrimitiveType)
are (essentially) inverse methods of each other.public void testGetPrimitiveType()
Types.getPrimitiveType(TypeKind)
throws expected exceptions.public void testGetNoType()
public void testGetNullType()
public void testEqualsAndHashCode()
public void typeElementTest()
public void typeParameterElementTest()
Copyright © 2014–2015. All rights reserved.