Search in sources :

Example 6 with DataPoints

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

the class AbstractDecoderTest method largeData.

@DataPoints("largeData")
public static ByteBuf[] largeData() {
    ByteBuf heap = Unpooled.wrappedBuffer(compressedBytesLarge);
    ByteBuf direct = Unpooled.directBuffer(compressedBytesLarge.length);
    direct.writeBytes(compressedBytesLarge);
    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 7 with DataPoints

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

the class AbstractEncoderTest method smallData.

@DataPoints("smallData")
public static ByteBuf[] smallData() {
    ByteBuf heap = Unpooled.wrappedBuffer(BYTES_SMALL);
    ByteBuf direct = Unpooled.directBuffer(BYTES_SMALL.length);
    direct.writeBytes(BYTES_SMALL);
    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 8 with DataPoints

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

the class TypeMirrorWrapperTest method supportedTypeMirrors.

@DataPoints("supportedTypeMirrors")
public static TypeMirrorToWrapped[] supportedTypeMirrors() {
    Types types = compilation.getTypes();
    NoType voidType = types.getNoType(TypeKind.VOID);
    PrimitiveType primitiveType = types.getPrimitiveType(TypeKind.INT);
    Elements elements = compilation.getElements();
    DeclaredType declaredType = (DeclaredType) elements.getTypeElement(Object.class.getName()).asType();
    ArrayType arrayType = types.getArrayType(declaredType);
    return new TypeMirrorToWrapped[] { a(voidType).itsWrapped(WrappedVoidType.class), a(primitiveType).itsWrapped(WrappedPrimitiveType.class), a(declaredType).itsWrapped(WrappedDeclaredType.class), a(arrayType).itsWrapped(WrappedArrayType.class) };
}
Also used : ArrayType(javax.lang.model.type.ArrayType) Types(javax.lang.model.util.Types) NoType(javax.lang.model.type.NoType) PrimitiveType(javax.lang.model.type.PrimitiveType) Elements(javax.lang.model.util.Elements) DeclaredType(javax.lang.model.type.DeclaredType) 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