use of org.junit.runners.Parameterized.Parameters in project beam by apache.
the class PCollectionTranslationTest method data.
// Each spec activates tests of all subsets of its fields
@Parameters(name = "{index}: {0}")
public static Iterable<PCollection<?>> data() {
Pipeline pipeline = TestPipeline.create();
PCollection<Integer> ints = pipeline.apply("ints", Create.of(1, 2, 3));
PCollection<Long> longs = pipeline.apply("unbounded longs", GenerateSequence.from(0));
PCollection<Long> windowedLongs = longs.apply("into fixed windows", Window.<Long>into(FixedWindows.of(Duration.standardMinutes(10L))));
PCollection<KV<String, Iterable<String>>> groupedStrings = pipeline.apply("kvs", Create.of(KV.of("foo", "spam"), KV.of("bar", "ham"), KV.of("baz", "eggs"))).apply("group", GroupByKey.<String, String>create());
PCollection<Long> coderLongs = pipeline.apply("counts with alternative coder", GenerateSequence.from(0).to(10)).setCoder(BigEndianLongCoder.of());
PCollection<Integer> allCustomInts = pipeline.apply("intsWithCustomCoder", Create.of(1, 2).withCoder(new AutoValue_PCollectionTranslationTest_CustomIntCoder())).apply("into custom windows", Window.<Integer>into(new CustomWindows()).triggering(AfterWatermark.pastEndOfWindow().withEarlyFirings(AfterFirst.of(AfterPane.elementCountAtLeast(5), AfterProcessingTime.pastFirstElementInPane().plusDelayOf(Duration.millis(227L))))).accumulatingFiredPanes().withAllowedLateness(Duration.standardMinutes(12L)));
return ImmutableList.<PCollection<?>>of(ints, longs, windowedLongs, coderLongs, groupedStrings);
}
use of org.junit.runners.Parameterized.Parameters in project beam by apache.
the class PTransformTranslationTest method data.
@Parameters(name = "{index}: {0}")
public static Iterable<ToAndFromProtoSpec> data() {
// This pipeline exists for construction, not to run any test.
// TODO: Leaf node with understood payload - i.e. validate payloads
ToAndFromProtoSpec readLeaf = ToAndFromProtoSpec.leaf(read(TestPipeline.create()));
ToAndFromProtoSpec readMultipleInAndOut = ToAndFromProtoSpec.leaf(multiMultiParDo(TestPipeline.create()));
TestPipeline compositeReadPipeline = TestPipeline.create();
ToAndFromProtoSpec compositeRead = ToAndFromProtoSpec.composite(generateSequence(compositeReadPipeline), ToAndFromProtoSpec.leaf(read(compositeReadPipeline)));
return ImmutableList.<ToAndFromProtoSpec>builder().add(readLeaf).add(readMultipleInAndOut).add(compositeRead).build();
}
use of org.junit.runners.Parameterized.Parameters in project calcite-avatica by apache.
the class ProtobufTranslationImplTest method parameters.
@Parameters
public static List<Object[]> parameters() {
List<Object[]> params = new ArrayList<>();
// The impl we're testing
ProtobufTranslationImpl translation = new ProtobufTranslationImpl();
// Identity transformation for Requests
RequestFunc requestFunc = new RequestFunc(translation);
// Identity transformation for Responses
ResponseFunc responseFunc = new ResponseFunc(translation);
List<Request> requests = getRequests();
List<Request> requestsWithNulls = getRequestsWithNulls();
List<Response> responses = getResponses();
// Requests
for (Request request : requests) {
params.add(new Object[] { request, requestFunc });
}
// Requests with nulls in parameters
for (Request request : requestsWithNulls) {
params.add(new Object[] { request, requestFunc });
}
// Responses
for (Response response : responses) {
params.add(new Object[] { response, responseFunc });
}
return params;
}
use of org.junit.runners.Parameterized.Parameters in project asterixdb by apache.
the class AdmDataGenTest method tests.
@Parameters
public static Collection<Object[]> tests() {
Collection<Object[]> testArgs = new ArrayList<Object[]>();
suiteBuild(new File(PATH_QUERIES), testArgs, "");
return testArgs;
}
use of org.junit.runners.Parameterized.Parameters in project asterixdb by apache.
the class NCServiceExecutionIT method tests.
@Parameters(name = "NCServiceExecutionTest {index}: {0}")
public static Collection<Object[]> tests() throws Exception {
Collection<Object[]> testArgs = new ArrayList<Object[]>();
TestCaseContext.Builder b = new TestCaseContext.Builder();
for (TestCaseContext ctx : b.build(new File(TESTS_DIR))) {
if (!skip(ctx)) {
testArgs.add(new Object[] { ctx });
}
}
return testArgs;
}
Aggregations