Search in sources :

Example 1 with Parameters

use of org.junit.runners.Parameterized.Parameters in project flink by apache.

the class TypeHintITCase method getConfigurations.

@Parameters
public static Collection<Object[]> getConfigurations() throws FileNotFoundException, IOException {
    LinkedList<Configuration> tConfigs = new LinkedList<Configuration>();
    for (int i = 1; i <= NUM_PROGRAMS; i++) {
        Configuration config = new Configuration();
        config.setInteger("ProgramId", i);
        tConfigs.add(config);
    }
    return toParameterList(tConfigs);
}
Also used : Configuration(org.apache.flink.configuration.Configuration) LinkedList(java.util.LinkedList) Parameters(org.junit.runners.Parameterized.Parameters)

Example 2 with Parameters

use of org.junit.runners.Parameterized.Parameters in project hadoop by apache.

the class TestDatasetVolumeChecker method data.

/**
   * Run each test case for each possible value of {@link VolumeCheckResult}.
   * Including "null" for 'throw exception'.
   * @return
   */
@Parameters(name = "{0}")
public static Collection<Object[]> data() {
    List<Object[]> values = new ArrayList<>();
    for (VolumeCheckResult result : VolumeCheckResult.values()) {
        values.add(new Object[] { result });
    }
    values.add(new Object[] { null });
    return values;
}
Also used : ArrayList(java.util.ArrayList) VolumeCheckResult(org.apache.hadoop.hdfs.server.datanode.checker.VolumeCheckResult) Parameters(org.junit.runners.Parameterized.Parameters)

Example 3 with Parameters

use of org.junit.runners.Parameterized.Parameters in project hbase by apache.

the class TestHFileDataBlockEncoder method getAllConfigurations.

/**
   * @return All possible data block encoding configurations
   */
@Parameters
public static Collection<Object[]> getAllConfigurations() {
    List<Object[]> configurations = new ArrayList<>();
    for (DataBlockEncoding diskAlgo : DataBlockEncoding.values()) {
        for (boolean includesMemstoreTS : new boolean[] { false, true }) {
            HFileDataBlockEncoder dbe = (diskAlgo == DataBlockEncoding.NONE) ? NoOpDataBlockEncoder.INSTANCE : new HFileDataBlockEncoderImpl(diskAlgo);
            configurations.add(new Object[] { dbe, new Boolean(includesMemstoreTS) });
        }
    }
    return configurations;
}
Also used : DataBlockEncoding(org.apache.hadoop.hbase.io.encoding.DataBlockEncoding) ArrayList(java.util.ArrayList) Parameters(org.junit.runners.Parameterized.Parameters)

Example 4 with Parameters

use of org.junit.runners.Parameterized.Parameters in project hackpad by dropbox.

the class MozillaSuiteTest method mozillaSuiteValues.

@Parameters
public static Collection<Object[]> mozillaSuiteValues() throws IOException {
    List<Object[]> result = new ArrayList<Object[]>();
    int[] optLevels = OPT_LEVELS;
    for (int i = 0; i < optLevels.length; i++) {
        File[] tests = getTestFiles(optLevels[i]);
        for (File f : tests) {
            result.add(new Object[] { f, optLevels[i] });
        }
    }
    return result;
}
Also used : ArrayList(java.util.ArrayList) File(java.io.File) Parameters(org.junit.runners.Parameterized.Parameters)

Example 5 with Parameters

use of org.junit.runners.Parameterized.Parameters in project jetty.project by eclipse.

the class ServerAnnotatedEndpointScanner_GoodSignaturesTest method data.

@Parameters
public static Collection<Case[]> data() throws Exception {
    List<Case[]> data = new ArrayList<>();
    Field fOpen = findFieldRef(AnnotatedServerEndpointMetadata.class, "onOpen");
    Field fClose = findFieldRef(AnnotatedServerEndpointMetadata.class, "onClose");
    Field fError = findFieldRef(AnnotatedServerEndpointMetadata.class, "onError");
    Field fText = findFieldRef(AnnotatedServerEndpointMetadata.class, "onText");
    Field fTextStream = findFieldRef(AnnotatedServerEndpointMetadata.class, "onTextStream");
    Field fBinary = findFieldRef(AnnotatedServerEndpointMetadata.class, "onBinary");
    @SuppressWarnings("unused") Field fBinaryStream = findFieldRef(AnnotatedServerEndpointMetadata.class, "onBinaryStream");
    Field fPong = findFieldRef(AnnotatedServerEndpointMetadata.class, "onPong");
    // @formatter:off
    // -- Open Events
    Case.add(data, BasicOpenSocket.class, fOpen);
    Case.add(data, BasicOpenSessionSocket.class, fOpen, Session.class);
    // -- Close Events
    Case.add(data, BasicCloseSocket.class, fClose);
    Case.add(data, BasicCloseReasonSocket.class, fClose, CloseReason.class);
    Case.add(data, BasicCloseReasonSessionSocket.class, fClose, CloseReason.class, Session.class);
    Case.add(data, BasicCloseSessionReasonSocket.class, fClose, Session.class, CloseReason.class);
    // -- Error Events
    Case.add(data, BasicErrorSocket.class, fError);
    Case.add(data, BasicErrorSessionSocket.class, fError, Session.class);
    Case.add(data, BasicErrorSessionThrowableSocket.class, fError, Session.class, Throwable.class);
    Case.add(data, BasicErrorThrowableSocket.class, fError, Throwable.class);
    Case.add(data, BasicErrorThrowableSessionSocket.class, fError, Throwable.class, Session.class);
    // -- Text Events
    Case.add(data, BasicTextMessageStringSocket.class, fText, String.class);
    Case.add(data, StatelessTextMessageStringSocket.class, fText, Session.class, String.class);
    // -- Primitives
    Case.add(data, BooleanTextSocket.class, fText, Boolean.TYPE);
    Case.add(data, BooleanObjectTextSocket.class, fText, Boolean.class);
    Case.add(data, ByteTextSocket.class, fText, Byte.TYPE);
    Case.add(data, ByteObjectTextSocket.class, fText, Byte.class);
    Case.add(data, CharTextSocket.class, fText, Character.TYPE);
    Case.add(data, CharacterObjectTextSocket.class, fText, Character.class);
    Case.add(data, DoubleTextSocket.class, fText, Double.TYPE);
    Case.add(data, DoubleObjectTextSocket.class, fText, Double.class);
    Case.add(data, FloatTextSocket.class, fText, Float.TYPE);
    Case.add(data, FloatObjectTextSocket.class, fText, Float.class);
    Case.add(data, IntTextSocket.class, fText, Integer.TYPE);
    Case.add(data, IntegerObjectTextSocket.class, fText, Integer.class);
    Case.add(data, ShortTextSocket.class, fText, Short.TYPE);
    Case.add(data, ShortObjectTextSocket.class, fText, Short.class);
    // -- Beans
    Case.add(data, DateTextSocket.class, fText, Date.class);
    // -- Reader Events
    Case.add(data, ReaderParamSocket.class, fTextStream, Reader.class, String.class);
    Case.add(data, StringReturnReaderParamSocket.class, fTextStream, Reader.class, String.class);
    // -- Binary Events
    Case.add(data, BasicBinaryMessageByteBufferSocket.class, fBinary, ByteBuffer.class);
    // -- Pong Events
    Case.add(data, BasicPongMessageSocket.class, fPong, PongMessage.class);
    return data;
}
Also used : Field(java.lang.reflect.Field) ArrayList(java.util.ArrayList) Parameters(org.junit.runners.Parameterized.Parameters)

Aggregations

Parameters (org.junit.runners.Parameterized.Parameters)70 ArrayList (java.util.ArrayList)41 File (java.io.File)20 TestCaseContext (org.apache.asterix.testframework.context.TestCaseContext)6 Date (java.util.Date)5 SslContext (io.netty.handler.ssl.SslContext)4 ExpiredCRLException (org.apereo.cas.adaptors.x509.authentication.ExpiredCRLException)4 ThresholdExpiredCRLRevocationPolicy (org.apereo.cas.adaptors.x509.authentication.revocation.policy.ThresholdExpiredCRLRevocationPolicy)4 RunWith (org.junit.runner.RunWith)4 ClassPathResource (org.springframework.core.io.ClassPathResource)4 ZonedDateTime (java.time.ZonedDateTime)3 Configuration (org.apache.hadoop.conf.Configuration)3 YarnConfiguration (org.apache.hadoop.yarn.conf.YarnConfiguration)3 RevokedCertificateException (org.apereo.cas.adaptors.x509.authentication.revocation.RevokedCertificateException)3 Parameterized (org.junit.runners.Parameterized)3 CollectionAgentDTO (org.opennms.netmgt.collection.dto.CollectionAgentDTO)3 FileFilter (java.io.FileFilter)2 Field (java.lang.reflect.Field)2 BigInteger (java.math.BigInteger)2 GeneralSecurityException (java.security.GeneralSecurityException)2