Search in sources :

Example 1 with DataPoints

use of org.junit.experimental.theories.DataPoints in project RoboBinding by RoboBinding.

the class ElementWrapperTest method unsupportedElements.

@DataPoints("unsupportedElements")
public static Element[] unsupportedElements() {
    Elements elements = compilation.getElements();
    PackageElement packageElement = elements.getPackageElement("java.lang");
    TypeElement typeElement = elements.getTypeElement(MethodsAndFields.class.getName());
    VariableElement variableElement = ElementFilter.fieldsIn(typeElement.getEnclosedElements()).get(0);
    return new Element[] { packageElement, variableElement };
}
Also used : TypeElement(javax.lang.model.element.TypeElement) PackageElement(javax.lang.model.element.PackageElement) ExecutableElement(javax.lang.model.element.ExecutableElement) VariableElement(javax.lang.model.element.VariableElement) Element(javax.lang.model.element.Element) TypeElement(javax.lang.model.element.TypeElement) PackageElement(javax.lang.model.element.PackageElement) VariableElement(javax.lang.model.element.VariableElement) Elements(javax.lang.model.util.Elements) FromDataPoints(org.junit.experimental.theories.FromDataPoints) DataPoints(org.junit.experimental.theories.DataPoints)

Example 2 with DataPoints

use of org.junit.experimental.theories.DataPoints in project RoboBinding by RoboBinding.

the class ElementWrapperTest method supportedElements.

@DataPoints("supportedElements")
public static ElementToWrapped[] supportedElements() {
    Elements elements = compilation.getElements();
    TypeElement typeElement = elements.getTypeElement(MethodsAndFields.class.getName());
    ExecutableElement methodElement = ElementFilter.methodsIn(typeElement.getEnclosedElements()).get(0);
    return new ElementToWrapped[] { a(typeElement).itsWrapped(WrappedTypeElement.class), a(methodElement).itsWrapped(MethodElement.class) };
}
Also used : TypeElement(javax.lang.model.element.TypeElement) ExecutableElement(javax.lang.model.element.ExecutableElement) Elements(javax.lang.model.util.Elements) FromDataPoints(org.junit.experimental.theories.FromDataPoints) DataPoints(org.junit.experimental.theories.DataPoints)

Example 3 with DataPoints

use of org.junit.experimental.theories.DataPoints in project RoboBinding by RoboBinding.

the class TypeMirrorWrapperTest method unsupportedTypeMirrors.

@DataPoints("unsupportedTypeMirrors")
public static TypeMirror[] unsupportedTypeMirrors() {
    Types types = compilation.getTypes();
    NullType nullType = types.getNullType();
    NoType noneType = types.getNoType(TypeKind.NONE);
    return new TypeMirror[] { nullType, noneType };
}
Also used : Types(javax.lang.model.util.Types) NoType(javax.lang.model.type.NoType) TypeMirror(javax.lang.model.type.TypeMirror) NullType(javax.lang.model.type.NullType) FromDataPoints(org.junit.experimental.theories.FromDataPoints) DataPoints(org.junit.experimental.theories.DataPoints)

Example 4 with DataPoints

use of org.junit.experimental.theories.DataPoints in project netty by netty.

the class AbstractDecoderTest method smallData.

@DataPoints("smallData")
public static ByteBuf[] smallData() {
    ByteBuf heap = Unpooled.wrappedBuffer(compressedBytesSmall);
    ByteBuf direct = Unpooled.directBuffer(compressedBytesSmall.length);
    direct.writeBytes(compressedBytesSmall);
    return new ByteBuf[] { heap, direct };
}
Also used : CompositeByteBuf(io.netty.buffer.CompositeByteBuf) ByteBuf(io.netty.buffer.ByteBuf) FromDataPoints(org.junit.experimental.theories.FromDataPoints) DataPoints(org.junit.experimental.theories.DataPoints)

Example 5 with DataPoints

use of org.junit.experimental.theories.DataPoints in project netty by netty.

the class AbstractEncoderTest method largeData.

@DataPoints("largeData")
public static ByteBuf[] largeData() {
    ByteBuf heap = Unpooled.wrappedBuffer(BYTES_LARGE);
    ByteBuf direct = Unpooled.directBuffer(BYTES_LARGE.length);
    direct.writeBytes(BYTES_LARGE);
    return new ByteBuf[] { heap, direct };
}
Also used : CompositeByteBuf(io.netty.buffer.CompositeByteBuf) ByteBuf(io.netty.buffer.ByteBuf) FromDataPoints(org.junit.experimental.theories.FromDataPoints) DataPoints(org.junit.experimental.theories.DataPoints)

Aggregations

DataPoints (org.junit.experimental.theories.DataPoints)8 FromDataPoints (org.junit.experimental.theories.FromDataPoints)8 ByteBuf (io.netty.buffer.ByteBuf)4 CompositeByteBuf (io.netty.buffer.CompositeByteBuf)4 Elements (javax.lang.model.util.Elements)3 ExecutableElement (javax.lang.model.element.ExecutableElement)2 TypeElement (javax.lang.model.element.TypeElement)2 NoType (javax.lang.model.type.NoType)2 Types (javax.lang.model.util.Types)2 Element (javax.lang.model.element.Element)1 PackageElement (javax.lang.model.element.PackageElement)1 VariableElement (javax.lang.model.element.VariableElement)1 ArrayType (javax.lang.model.type.ArrayType)1 DeclaredType (javax.lang.model.type.DeclaredType)1 NullType (javax.lang.model.type.NullType)1 PrimitiveType (javax.lang.model.type.PrimitiveType)1 TypeMirror (javax.lang.model.type.TypeMirror)1