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);
}
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;
}
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;
}
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;
}
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;
}
Aggregations