Search in sources :

Example 51 with Parameters

use of org.junit.runners.Parameterized.Parameters in project voldemort by voldemort.

the class VoldemortNativeSocketStoreTest method configs.

@Parameters
public static Collection<Object[]> configs() {
    RequestFormatType[] types = new RequestFormatType[] { RequestFormatType.VOLDEMORT_V1, RequestFormatType.VOLDEMORT_V2, RequestFormatType.VOLDEMORT_V3 };
    List<Object[]> options = new ArrayList<Object[]>();
    boolean[] nioOptions = { true, false };
    for (RequestFormatType type : types) {
        for (boolean nio : nioOptions) {
            options.add(new Object[] { type, nio });
        }
    }
    return options;
}
Also used : ArrayList(java.util.ArrayList) RequestFormatType(voldemort.client.protocol.RequestFormatType) Parameters(org.junit.runners.Parameterized.Parameters)

Example 52 with Parameters

use of org.junit.runners.Parameterized.Parameters in project spring-framework by spring-projects.

the class CronTriggerTests method getParameters.

@Parameters(name = "date [{0}], time zone [{1}]")
public static List<Object[]> getParameters() {
    List<Object[]> list = new ArrayList<>();
    list.add(new Object[] { new Date(), TimeZone.getTimeZone("PST") });
    list.add(new Object[] { new Date(), TimeZone.getTimeZone("CET") });
    return list;
}
Also used : ArrayList(java.util.ArrayList) Date(java.util.Date) Parameters(org.junit.runners.Parameterized.Parameters)

Example 53 with Parameters

use of org.junit.runners.Parameterized.Parameters in project spring-framework by spring-projects.

the class AbstractWebSocketIntegrationTests method arguments.

@Parameters(name = "client[{0}] - server [{1}]")
public static Object[][] arguments() throws IOException {
    Flux<? extends WebSocketClient> clients = Flux.concat(Flux.just(new StandardWebSocketClient()).repeat(5), Flux.just(new JettyWebSocketClient()).repeat(5), Flux.just(new ReactorNettyWebSocketClient()).repeat(5), Flux.just(new RxNettyWebSocketClient()).repeat(5), Flux.just(new UndertowWebSocketClient(Xnio.getInstance().createWorker(OptionMap.EMPTY))).repeat(5));
    Flux<? extends HttpServer> servers = Flux.just(new TomcatHttpServer(TMP_DIR.getAbsolutePath(), WsContextListener.class), new JettyHttpServer(), new ReactorHttpServer(), new RxNettyHttpServer(), new UndertowHttpServer()).repeat(5);
    Flux<? extends Class<?>> configs = Flux.just(TomcatConfig.class, JettyConfig.class, ReactorNettyConfig.class, RxNettyConfig.class, UndertowConfig.class).repeat(5);
    return Flux.zip(clients, servers, configs).map(Tuple3::toArray).collectList().block().toArray(new Object[25][2]);
}
Also used : RxNettyWebSocketClient(org.springframework.web.reactive.socket.client.RxNettyWebSocketClient) ReactorHttpServer(org.springframework.http.server.reactive.bootstrap.ReactorHttpServer) ReactorNettyWebSocketClient(org.springframework.web.reactive.socket.client.ReactorNettyWebSocketClient) StandardWebSocketClient(org.springframework.web.reactive.socket.client.StandardWebSocketClient) RxNettyHttpServer(org.springframework.http.server.reactive.bootstrap.RxNettyHttpServer) UndertowHttpServer(org.springframework.http.server.reactive.bootstrap.UndertowHttpServer) JettyWebSocketClient(org.springframework.web.reactive.socket.client.JettyWebSocketClient) TomcatHttpServer(org.springframework.http.server.reactive.bootstrap.TomcatHttpServer) UndertowWebSocketClient(org.springframework.web.reactive.socket.client.UndertowWebSocketClient) JettyHttpServer(org.springframework.http.server.reactive.bootstrap.JettyHttpServer) Parameters(org.junit.runners.Parameterized.Parameters)

Example 54 with Parameters

use of org.junit.runners.Parameterized.Parameters in project Bukkit by Bukkit.

the class LocationTest method data.

@Parameters(name = "{index}: {0}")
public static List<Object[]> data() {
    // Test is deterministic
    Random RANDOM = new Random(1l);
    int r = 0;
    return ImmutableList.<Object[]>of(new Object[] { "X", 1, 0, 0, 270, 0 }, new Object[] { "-X", -1, 0, 0, 90, 0 }, new Object[] { "Z", 0, 0, 1, 0, 0 }, new Object[] { "-Z", 0, 0, -1, 180, 0 }, new Object[] { "Y", 0, 1, 0, // Zero is here as a "default" value
    0, // Zero is here as a "default" value
    -90 }, new Object[] { "-Y", 0, -1, 0, // Zero is here as a "default" value
    0, // Zero is here as a "default" value
    90 }, new Object[] { "X Z", HALF_UNIT, 0, HALF_UNIT, (270 + 360) / 2, 0 }, new Object[] { "X -Z", HALF_UNIT, 0, -HALF_UNIT, (270 + 180) / 2, 0 }, new Object[] { "-X -Z", -HALF_UNIT, 0, -HALF_UNIT, (90 + 180) / 2, 0 }, new Object[] { "-X Z", -HALF_UNIT, 0, HALF_UNIT, (90 + 0) / 2, 0 }, new Object[] { "X Y Z", HALF_HALF_UNIT, HALF_UNIT, HALF_HALF_UNIT, (270 + 360) / 2, -45 }, new Object[] { "-X -Y -Z", -HALF_HALF_UNIT, -HALF_UNIT, -HALF_HALF_UNIT, (90 + 180) / 2, 45 }, getRandom(RANDOM, r++), getRandom(RANDOM, r++), getRandom(RANDOM, r++), getRandom(RANDOM, r++), getRandom(RANDOM, r++), getRandom(RANDOM, r++), getRandom(RANDOM, r++), getRandom(RANDOM, r++), getRandom(RANDOM, r++), getRandom(RANDOM, r++), getRandom(RANDOM, r++), getRandom(RANDOM, r++), getRandom(RANDOM, r++), getRandom(RANDOM, r++), getRandom(RANDOM, r++), getRandom(RANDOM, r++), getRandom(RANDOM, r++), getRandom(RANDOM, r++));
}
Also used : Random(java.util.Random) Parameters(org.junit.runners.Parameterized.Parameters)

Example 55 with Parameters

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

the class TestSaslRPC method data.

@Parameters
public static Collection<Object[]> data() {
    Collection<Object[]> params = new ArrayList<>();
    for (QualityOfProtection qop : QualityOfProtection.values()) {
        params.add(new Object[] { new QualityOfProtection[] { qop }, qop, null });
    }
    params.add(new Object[] { new QualityOfProtection[] { QualityOfProtection.PRIVACY, QualityOfProtection.AUTHENTICATION }, QualityOfProtection.PRIVACY, null });
    params.add(new Object[] { new QualityOfProtection[] { QualityOfProtection.PRIVACY, QualityOfProtection.AUTHENTICATION }, QualityOfProtection.AUTHENTICATION, "org.apache.hadoop.ipc.TestSaslRPC$AuthSaslPropertiesResolver" });
    return params;
}
Also used : QualityOfProtection(org.apache.hadoop.security.SaslRpcServer.QualityOfProtection) ArrayList(java.util.ArrayList) 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