Search in sources :

Example 61 with Parameters

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);
}
Also used : PCollection(org.apache.beam.sdk.values.PCollection) KV(org.apache.beam.sdk.values.KV) TestPipeline(org.apache.beam.sdk.testing.TestPipeline) Pipeline(org.apache.beam.sdk.Pipeline) Parameters(org.junit.runners.Parameterized.Parameters)

Example 62 with Parameters

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();
}
Also used : TestPipeline(org.apache.beam.sdk.testing.TestPipeline) Parameters(org.junit.runners.Parameterized.Parameters)

Example 63 with Parameters

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;
}
Also used : CloseConnectionResponse(org.apache.calcite.avatica.remote.Service.CloseConnectionResponse) PrepareResponse(org.apache.calcite.avatica.remote.Service.PrepareResponse) FetchResponse(org.apache.calcite.avatica.remote.Service.FetchResponse) RpcMetadataResponse(org.apache.calcite.avatica.remote.Service.RpcMetadataResponse) ExecuteBatchResponse(org.apache.calcite.avatica.remote.Service.ExecuteBatchResponse) DatabasePropertyResponse(org.apache.calcite.avatica.remote.Service.DatabasePropertyResponse) OpenConnectionResponse(org.apache.calcite.avatica.remote.Service.OpenConnectionResponse) RollbackResponse(org.apache.calcite.avatica.remote.Service.RollbackResponse) CloseStatementResponse(org.apache.calcite.avatica.remote.Service.CloseStatementResponse) Response(org.apache.calcite.avatica.remote.Service.Response) CreateStatementResponse(org.apache.calcite.avatica.remote.Service.CreateStatementResponse) ErrorResponse(org.apache.calcite.avatica.remote.Service.ErrorResponse) ConnectionSyncResponse(org.apache.calcite.avatica.remote.Service.ConnectionSyncResponse) ResultSetResponse(org.apache.calcite.avatica.remote.Service.ResultSetResponse) ExecuteResponse(org.apache.calcite.avatica.remote.Service.ExecuteResponse) SyncResultsResponse(org.apache.calcite.avatica.remote.Service.SyncResultsResponse) CommitResponse(org.apache.calcite.avatica.remote.Service.CommitResponse) ArrayList(java.util.ArrayList) ExecuteRequest(org.apache.calcite.avatica.remote.Service.ExecuteRequest) TablesRequest(org.apache.calcite.avatica.remote.Service.TablesRequest) CloseStatementRequest(org.apache.calcite.avatica.remote.Service.CloseStatementRequest) FetchRequest(org.apache.calcite.avatica.remote.Service.FetchRequest) PrepareRequest(org.apache.calcite.avatica.remote.Service.PrepareRequest) CreateStatementRequest(org.apache.calcite.avatica.remote.Service.CreateStatementRequest) CloseConnectionRequest(org.apache.calcite.avatica.remote.Service.CloseConnectionRequest) CatalogsRequest(org.apache.calcite.avatica.remote.Service.CatalogsRequest) SyncResultsRequest(org.apache.calcite.avatica.remote.Service.SyncResultsRequest) Request(org.apache.calcite.avatica.remote.Service.Request) ConnectionSyncRequest(org.apache.calcite.avatica.remote.Service.ConnectionSyncRequest) SchemasRequest(org.apache.calcite.avatica.remote.Service.SchemasRequest) TableTypesRequest(org.apache.calcite.avatica.remote.Service.TableTypesRequest) DatabasePropertyRequest(org.apache.calcite.avatica.remote.Service.DatabasePropertyRequest) PrepareAndExecuteBatchRequest(org.apache.calcite.avatica.remote.Service.PrepareAndExecuteBatchRequest) TypeInfoRequest(org.apache.calcite.avatica.remote.Service.TypeInfoRequest) CommitRequest(org.apache.calcite.avatica.remote.Service.CommitRequest) PrepareAndExecuteRequest(org.apache.calcite.avatica.remote.Service.PrepareAndExecuteRequest) OpenConnectionRequest(org.apache.calcite.avatica.remote.Service.OpenConnectionRequest) ColumnsRequest(org.apache.calcite.avatica.remote.Service.ColumnsRequest) RollbackRequest(org.apache.calcite.avatica.remote.Service.RollbackRequest) Parameters(org.junit.runners.Parameterized.Parameters)

Example 64 with Parameters

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;
}
Also used : ArrayList(java.util.ArrayList) File(java.io.File) Parameters(org.junit.runners.Parameterized.Parameters)

Example 65 with Parameters

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;
}
Also used : TestCaseContext(org.apache.asterix.testframework.context.TestCaseContext) ArrayList(java.util.ArrayList) File(java.io.File) Parameters(org.junit.runners.Parameterized.Parameters)

Aggregations

Parameters (org.junit.runners.Parameterized.Parameters)77 ArrayList (java.util.ArrayList)43 File (java.io.File)24 TestCaseContext (org.apache.asterix.testframework.context.TestCaseContext)6 Date (java.util.Date)5 SslContext (io.netty.handler.ssl.SslContext)4 IOException (java.io.IOException)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 InputStream (java.io.InputStream)2 Field (java.lang.reflect.Field)2