Search in sources :

Example 46 with Parameters

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

the class TestAMAuthorization method configs.

@Parameters
public static Collection<Object[]> configs() {
    Configuration conf = new Configuration();
    Configuration confWithSecurity = new Configuration();
    confWithSecurity.set(CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHENTICATION, UserGroupInformation.AuthenticationMethod.KERBEROS.toString());
    return Arrays.asList(new Object[][] { { conf }, { confWithSecurity } });
}
Also used : Configuration(org.apache.hadoop.conf.Configuration) YarnConfiguration(org.apache.hadoop.yarn.conf.YarnConfiguration) Parameters(org.junit.runners.Parameterized.Parameters)

Example 47 with Parameters

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

the class SocketSslGreetingTest method data.

@Parameters(name = "{index}: serverEngine = {0}, clientEngine = {1}")
public static Collection<Object[]> data() throws Exception {
    List<SslContext> serverContexts = new ArrayList<SslContext>();
    serverContexts.add(SslContextBuilder.forServer(CERT_FILE, KEY_FILE).sslProvider(SslProvider.JDK).build());
    List<SslContext> clientContexts = new ArrayList<SslContext>();
    clientContexts.add(SslContextBuilder.forClient().sslProvider(SslProvider.JDK).trustManager(CERT_FILE).build());
    boolean hasOpenSsl = OpenSsl.isAvailable();
    if (hasOpenSsl) {
        serverContexts.add(SslContextBuilder.forServer(CERT_FILE, KEY_FILE).sslProvider(SslProvider.OPENSSL).build());
        clientContexts.add(SslContextBuilder.forClient().sslProvider(SslProvider.OPENSSL).trustManager(CERT_FILE).build());
    } else {
        logger.warn("OpenSSL is unavailable and thus will not be tested.", OpenSsl.unavailabilityCause());
    }
    List<Object[]> params = new ArrayList<Object[]>();
    for (SslContext sc : serverContexts) {
        for (SslContext cc : clientContexts) {
            params.add(new Object[] { sc, cc });
        }
    }
    return params;
}
Also used : ArrayList(java.util.ArrayList) SslContext(io.netty.handler.ssl.SslContext) Parameters(org.junit.runners.Parameterized.Parameters)

Example 48 with Parameters

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

the class SocketStartTlsTest method data.

@Parameters(name = "{index}: serverEngine = {0}, clientEngine = {1}")
public static Collection<Object[]> data() throws Exception {
    List<SslContext> serverContexts = new ArrayList<SslContext>();
    serverContexts.add(SslContextBuilder.forServer(CERT_FILE, KEY_FILE).sslProvider(SslProvider.JDK).build());
    List<SslContext> clientContexts = new ArrayList<SslContext>();
    clientContexts.add(SslContextBuilder.forClient().sslProvider(SslProvider.JDK).trustManager(CERT_FILE).build());
    boolean hasOpenSsl = OpenSsl.isAvailable();
    if (hasOpenSsl) {
        serverContexts.add(SslContextBuilder.forServer(CERT_FILE, KEY_FILE).sslProvider(SslProvider.OPENSSL).build());
        clientContexts.add(SslContextBuilder.forClient().sslProvider(SslProvider.OPENSSL).trustManager(CERT_FILE).build());
    } else {
        logger.warn("OpenSSL is unavailable and thus will not be tested.", OpenSsl.unavailabilityCause());
    }
    List<Object[]> params = new ArrayList<Object[]>();
    for (SslContext sc : serverContexts) {
        for (SslContext cc : clientContexts) {
            params.add(new Object[] { sc, cc });
        }
    }
    return params;
}
Also used : ArrayList(java.util.ArrayList) SslContext(io.netty.handler.ssl.SslContext) Parameters(org.junit.runners.Parameterized.Parameters)

Example 49 with Parameters

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

the class SocketSslClientRenegotiateTest method data.

@Parameters(name = "{index}: serverEngine = {0}, clientEngine = {1}")
public static Collection<Object[]> data() throws Exception {
    List<SslContext> serverContexts = new ArrayList<SslContext>();
    List<SslContext> clientContexts = new ArrayList<SslContext>();
    clientContexts.add(new JdkSslClientContext(CERT_FILE));
    boolean hasOpenSsl = OpenSsl.isAvailable();
    if (hasOpenSsl) {
        OpenSslServerContext context = new OpenSslServerContext(CERT_FILE, KEY_FILE);
        context.setRejectRemoteInitiatedRenegotiation(true);
        serverContexts.add(context);
    } else {
        logger.warn("OpenSSL is unavailable and thus will not be tested.", OpenSsl.unavailabilityCause());
    }
    List<Object[]> params = new ArrayList<Object[]>();
    for (SslContext sc : serverContexts) {
        for (SslContext cc : clientContexts) {
            for (int i = 0; i < 32; i++) {
                params.add(new Object[] { sc, cc });
            }
        }
    }
    return params;
}
Also used : JdkSslClientContext(io.netty.handler.ssl.JdkSslClientContext) OpenSslServerContext(io.netty.handler.ssl.OpenSslServerContext) ArrayList(java.util.ArrayList) SslContext(io.netty.handler.ssl.SslContext) Parameters(org.junit.runners.Parameterized.Parameters)

Example 50 with Parameters

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

the class SocketSslEchoTest method data.

@Parameters(name = "{index}: serverEngine = {0}, clientEngine = {1}, renegotiation = {2}, " + "serverUsesDelegatedTaskExecutor = {3}, clientUsesDelegatedTaskExecutor = {4}, " + "autoRead = {5}, useChunkedWriteHandler = {6}, useCompositeByteBuf = {7}")
public static Collection<Object[]> data() throws Exception {
    List<SslContext> serverContexts = new ArrayList<SslContext>();
    serverContexts.add(SslContextBuilder.forServer(CERT_FILE, KEY_FILE).sslProvider(SslProvider.JDK).build());
    List<SslContext> clientContexts = new ArrayList<SslContext>();
    clientContexts.add(SslContextBuilder.forClient().sslProvider(SslProvider.JDK).trustManager(CERT_FILE).build());
    boolean hasOpenSsl = OpenSsl.isAvailable();
    if (hasOpenSsl) {
        serverContexts.add(SslContextBuilder.forServer(CERT_FILE, KEY_FILE).sslProvider(SslProvider.OPENSSL).build());
        clientContexts.add(SslContextBuilder.forClient().sslProvider(SslProvider.OPENSSL).trustManager(CERT_FILE).build());
    } else {
        logger.warn("OpenSSL is unavailable and thus will not be tested.", OpenSsl.unavailabilityCause());
    }
    List<Object[]> params = new ArrayList<Object[]>();
    for (SslContext sc : serverContexts) {
        for (SslContext cc : clientContexts) {
            for (RenegotiationType rt : RenegotiationType.values()) {
                if (rt != RenegotiationType.NONE && (sc instanceof OpenSslContext || cc instanceof OpenSslContext)) {
                    // TODO: OpenSslEngine does not support renegotiation yet.
                    continue;
                }
                final Renegotiation r;
                switch(rt) {
                    case NONE:
                        r = Renegotiation.NONE;
                        break;
                    case SERVER_INITIATED:
                        r = new Renegotiation(rt, sc.cipherSuites().get(sc.cipherSuites().size() - 1));
                        break;
                    case CLIENT_INITIATED:
                        r = new Renegotiation(rt, cc.cipherSuites().get(cc.cipherSuites().size() - 1));
                        break;
                    default:
                        throw new Error();
                }
                for (int i = 0; i < 32; i++) {
                    params.add(new Object[] { sc, cc, r, (i & 16) != 0, (i & 8) != 0, (i & 4) != 0, (i & 2) != 0, (i & 1) != 0 });
                }
            }
        }
    }
    return params;
}
Also used : OpenSslContext(io.netty.handler.ssl.OpenSslContext) ArrayList(java.util.ArrayList) SslContext(io.netty.handler.ssl.SslContext) OpenSslContext(io.netty.handler.ssl.OpenSslContext) 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