From c039f824838529ca132d88b8a8ec386a6808b8f4 Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Tue, 31 Aug 2021 08:07:56 +0200 Subject: [PATCH] Add missing annotations to test overrides (#11630) Motivation: When we override a test with params we also need to ensure we add the correct annotations to the override Modifications: Add the correct annotations so the tests are actually run in intellij Result: Each test can be run --- .../ssl/AmazonCorrettoSslEngineTest.java | 6 +++ .../ssl/ConscryptJdkSslEngineInteropTest.java | 8 +++ .../ConscryptOpenSslEngineInteropTest.java | 30 ++++++++++- .../handler/ssl/ConscryptSslEngineTest.java | 8 +++ .../ssl/JdkConscryptSslEngineInteropTest.java | 14 ++++- .../ssl/JdkOpenSslEngineInteroptTest.java | 54 +++++++++++++++---- .../netty/handler/ssl/JdkSslEngineTest.java | 4 ++ .../OpenSslConscryptSslEngineInteropTest.java | 28 +++++++++- .../netty/handler/ssl/OpenSslEngineTest.java | 10 ++++ .../ssl/OpenSslJdkSslEngineInteroptTest.java | 26 +++++++++ 10 files changed, 173 insertions(+), 15 deletions(-) diff --git a/handler/src/test/java/io/netty/handler/ssl/AmazonCorrettoSslEngineTest.java b/handler/src/test/java/io/netty/handler/ssl/AmazonCorrettoSslEngineTest.java index 09b3d9d6a1..498e734f0d 100644 --- a/handler/src/test/java/io/netty/handler/ssl/AmazonCorrettoSslEngineTest.java +++ b/handler/src/test/java/io/netty/handler/ssl/AmazonCorrettoSslEngineTest.java @@ -21,6 +21,8 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.condition.DisabledIf; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; import javax.crypto.Cipher; import java.security.Security; @@ -79,11 +81,15 @@ public class AmazonCorrettoSslEngineTest extends SSLEngineTest { assertNull(Security.getProvider(AmazonCorrettoCryptoProvider.PROVIDER_NAME)); } + @MethodSource("newTestParams") + @ParameterizedTest @Disabled /* Does the JDK support a "max certificate chain length"? */ @Override public void testMutualAuthValidClientCertChainTooLongFailOptionalClientAuth(SSLEngineTestParam param) { } + @MethodSource("newTestParams") + @ParameterizedTest @Disabled /* Does the JDK support a "max certificate chain length"? */ @Override public void testMutualAuthValidClientCertChainTooLongFailRequireClientAuth(SSLEngineTestParam param) { diff --git a/handler/src/test/java/io/netty/handler/ssl/ConscryptJdkSslEngineInteropTest.java b/handler/src/test/java/io/netty/handler/ssl/ConscryptJdkSslEngineInteropTest.java index fd8db16fd2..9b6a39a7dd 100644 --- a/handler/src/test/java/io/netty/handler/ssl/ConscryptJdkSslEngineInteropTest.java +++ b/handler/src/test/java/io/netty/handler/ssl/ConscryptJdkSslEngineInteropTest.java @@ -19,6 +19,8 @@ import java.security.Provider; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.condition.DisabledIf; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; import javax.net.ssl.SSLSessionContext; @@ -49,18 +51,24 @@ public class ConscryptJdkSslEngineInteropTest extends SSLEngineTest { return Java8SslTestUtils.conscryptProvider(); } + @MethodSource("newTestParams") + @ParameterizedTest @Disabled /* Does the JDK support a "max certificate chain length"? */ @Override public void testMutualAuthValidClientCertChainTooLongFailOptionalClientAuth(SSLEngineTestParam param) throws Exception { } + @MethodSource("newTestParams") + @ParameterizedTest @Disabled /* Does the JDK support a "max certificate chain length"? */ @Override public void testMutualAuthValidClientCertChainTooLongFailRequireClientAuth(SSLEngineTestParam param) throws Exception { } + @MethodSource("newTestParams") + @ParameterizedTest @Override protected boolean mySetupMutualAuthServerIsValidServerException(Throwable cause) { // TODO(scott): work around for a JDK issue. The exception should be SSLHandshakeException. diff --git a/handler/src/test/java/io/netty/handler/ssl/ConscryptOpenSslEngineInteropTest.java b/handler/src/test/java/io/netty/handler/ssl/ConscryptOpenSslEngineInteropTest.java index 9800c21e76..54b13d8a90 100644 --- a/handler/src/test/java/io/netty/handler/ssl/ConscryptOpenSslEngineInteropTest.java +++ b/handler/src/test/java/io/netty/handler/ssl/ConscryptOpenSslEngineInteropTest.java @@ -65,14 +65,18 @@ public class ConscryptOpenSslEngineInteropTest extends ConscryptSslEngineTest { return null; } - @Override + @MethodSource("newTestParams") + @ParameterizedTest @Disabled("TODO: Make this work with Conscrypt") + @Override public void testMutualAuthValidClientCertChainTooLongFailOptionalClientAuth(SSLEngineTestParam param) { super.testMutualAuthValidClientCertChainTooLongFailOptionalClientAuth(param); } - @Override + @MethodSource("newTestParams") + @ParameterizedTest @Disabled("TODO: Make this work with Conscrypt") + @Override public void testMutualAuthValidClientCertChainTooLongFailRequireClientAuth(SSLEngineTestParam param) { super.testMutualAuthValidClientCertChainTooLongFailRequireClientAuth(param); } @@ -83,6 +87,8 @@ public class ConscryptOpenSslEngineInteropTest extends ConscryptSslEngineTest { return super.mySetupMutualAuthServerIsValidClientException(cause) || causedBySSLException(cause); } + @MethodSource("newTestParams") + @ParameterizedTest @Override public void testMutualAuthInvalidIntermediateCASucceedWithOptionalClientAuth(SSLEngineTestParam param) throws Exception { @@ -90,6 +96,8 @@ public class ConscryptOpenSslEngineInteropTest extends ConscryptSslEngineTest { super.testMutualAuthInvalidIntermediateCASucceedWithOptionalClientAuth(param); } + @MethodSource("newTestParams") + @ParameterizedTest @Override public void testMutualAuthInvalidIntermediateCAFailWithOptionalClientAuth(SSLEngineTestParam param) throws Exception { @@ -97,6 +105,8 @@ public class ConscryptOpenSslEngineInteropTest extends ConscryptSslEngineTest { super.testMutualAuthInvalidIntermediateCAFailWithOptionalClientAuth(param); } + @MethodSource("newTestParams") + @ParameterizedTest @Override public void testMutualAuthInvalidIntermediateCAFailWithRequiredClientAuth(SSLEngineTestParam param) throws Exception { @@ -104,18 +114,24 @@ public class ConscryptOpenSslEngineInteropTest extends ConscryptSslEngineTest { super.testMutualAuthInvalidIntermediateCAFailWithRequiredClientAuth(param); } + @MethodSource("newTestParams") + @ParameterizedTest @Override public void testSessionAfterHandshakeKeyManagerFactory(SSLEngineTestParam param) throws Exception { checkShouldUseKeyManagerFactory(); super.testSessionAfterHandshakeKeyManagerFactory(param); } + @MethodSource("newTestParams") + @ParameterizedTest @Override public void testSessionAfterHandshakeKeyManagerFactoryMutualAuth(SSLEngineTestParam param) throws Exception { checkShouldUseKeyManagerFactory(); super.testSessionAfterHandshakeKeyManagerFactoryMutualAuth(param); } + @MethodSource("newTestParams") + @ParameterizedTest @Override public void testSupportedSignatureAlgorithms(SSLEngineTestParam param) throws Exception { checkShouldUseKeyManagerFactory(); @@ -128,12 +144,16 @@ public class ConscryptOpenSslEngineInteropTest extends ConscryptSslEngineTest { return super.mySetupMutualAuthServerIsValidServerException(cause) || causedBySSLException(cause); } + @MethodSource("newTestParams") + @ParameterizedTest @Override public void testSessionLocalWhenNonMutualWithKeyManager(SSLEngineTestParam param) throws Exception { checkShouldUseKeyManagerFactory(); super.testSessionLocalWhenNonMutualWithKeyManager(param); } + @MethodSource("newTestParams") + @ParameterizedTest @Override public void testSessionLocalWhenNonMutualWithoutKeyManager(SSLEngineTestParam param) throws Exception { // This only really works when the KeyManagerFactory is supported as otherwise we not really know when @@ -147,18 +167,24 @@ public class ConscryptOpenSslEngineInteropTest extends ConscryptSslEngineTest { // Not supported by conscrypt } + @MethodSource("newTestParams") + @ParameterizedTest @Override public void testSessionCache(SSLEngineTestParam param) throws Exception { assumeTrue(OpenSsl.isSessionCacheSupported()); super.testSessionCache(param); } + @MethodSource("newTestParams") + @ParameterizedTest @Override public void testSessionCacheTimeout(SSLEngineTestParam param) throws Exception { assumeTrue(OpenSsl.isSessionCacheSupported()); super.testSessionCacheTimeout(param); } + @MethodSource("newTestParams") + @ParameterizedTest @Override public void testSessionCacheSize(SSLEngineTestParam param) throws Exception { assumeTrue(OpenSsl.isSessionCacheSupported()); diff --git a/handler/src/test/java/io/netty/handler/ssl/ConscryptSslEngineTest.java b/handler/src/test/java/io/netty/handler/ssl/ConscryptSslEngineTest.java index 7ecb8fa83f..209aca9062 100644 --- a/handler/src/test/java/io/netty/handler/ssl/ConscryptSslEngineTest.java +++ b/handler/src/test/java/io/netty/handler/ssl/ConscryptSslEngineTest.java @@ -18,6 +18,8 @@ package io.netty.handler.ssl; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.condition.DisabledIf; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; import javax.net.ssl.SSLSessionContext; import java.security.Provider; @@ -53,11 +55,15 @@ public class ConscryptSslEngineTest extends SSLEngineTest { return Java8SslTestUtils.conscryptProvider(); } + @MethodSource("newTestParams") + @ParameterizedTest @Disabled /* Does the JDK support a "max certificate chain length"? */ @Override public void testMutualAuthValidClientCertChainTooLongFailOptionalClientAuth(SSLEngineTestParam param) { } + @MethodSource("newTestParams") + @ParameterizedTest @Disabled /* Does the JDK support a "max certificate chain length"? */ @Override public void testMutualAuthValidClientCertChainTooLongFailRequireClientAuth(SSLEngineTestParam param) { @@ -68,6 +74,8 @@ public class ConscryptSslEngineTest extends SSLEngineTest { // Not supported by conscrypt } + @MethodSource("newTestParams") + @ParameterizedTest @Disabled("Possible Conscrypt bug") @Override public void testSessionCacheTimeout(SSLEngineTestParam param) throws Exception { diff --git a/handler/src/test/java/io/netty/handler/ssl/JdkConscryptSslEngineInteropTest.java b/handler/src/test/java/io/netty/handler/ssl/JdkConscryptSslEngineInteropTest.java index aa44fce740..be453dbbfa 100644 --- a/handler/src/test/java/io/netty/handler/ssl/JdkConscryptSslEngineInteropTest.java +++ b/handler/src/test/java/io/netty/handler/ssl/JdkConscryptSslEngineInteropTest.java @@ -19,6 +19,8 @@ import java.security.Provider; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.condition.DisabledIf; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; import javax.net.ssl.SSLSessionContext; @@ -48,15 +50,19 @@ public class JdkConscryptSslEngineInteropTest extends SSLEngineTest { return Java8SslTestUtils.conscryptProvider(); } - @Override + @MethodSource("newTestParams") + @ParameterizedTest @Disabled("TODO: Make this work with Conscrypt") + @Override public void testMutualAuthValidClientCertChainTooLongFailOptionalClientAuth(SSLEngineTestParam param) throws Exception { super.testMutualAuthValidClientCertChainTooLongFailOptionalClientAuth(param); } - @Override + @MethodSource("newTestParams") + @ParameterizedTest @Disabled("TODO: Make this work with Conscrypt") + @Override public void testMutualAuthValidClientCertChainTooLongFailRequireClientAuth(SSLEngineTestParam param) throws Exception { super.testMutualAuthValidClientCertChainTooLongFailRequireClientAuth(param); @@ -68,6 +74,8 @@ public class JdkConscryptSslEngineInteropTest extends SSLEngineTest { return super.mySetupMutualAuthServerIsValidClientException(cause) || causedBySSLException(cause); } + @MethodSource("newTestParams") + @ParameterizedTest @Disabled("Ignore due bug in Conscrypt") @Override public void testHandshakeSession(SSLEngineTestParam param) throws Exception { @@ -80,6 +88,8 @@ public class JdkConscryptSslEngineInteropTest extends SSLEngineTest { // Not supported by conscrypt } + @MethodSource("newTestParams") + @ParameterizedTest @Disabled("Possible Conscrypt bug") @Override public void testSessionCacheTimeout(SSLEngineTestParam param) { diff --git a/handler/src/test/java/io/netty/handler/ssl/JdkOpenSslEngineInteroptTest.java b/handler/src/test/java/io/netty/handler/ssl/JdkOpenSslEngineInteroptTest.java index 2d2830ba39..0d166a8430 100644 --- a/handler/src/test/java/io/netty/handler/ssl/JdkOpenSslEngineInteroptTest.java +++ b/handler/src/test/java/io/netty/handler/ssl/JdkOpenSslEngineInteroptTest.java @@ -62,76 +62,98 @@ public class JdkOpenSslEngineInteroptTest extends SSLEngineTest { return SslProvider.OPENSSL; } - @Override + @MethodSource("newTestParams") + @ParameterizedTest @DisabledOnOs(value = OS.WINDOWS, disabledReason = "Disable until figured out why this sometimes fail on the CI") + @Override public void testMutualAuthSameCerts(SSLEngineTestParam param) throws Throwable { super.testMutualAuthSameCerts(param); } - @Override + @MethodSource("newTestParams") + @ParameterizedTest @DisabledOnOs(value = OS.WINDOWS, disabledReason = "Disable until figured out why this sometimes fail on the CI") + @Override public void testMutualAuthDiffCerts(SSLEngineTestParam param) throws Exception { super.testMutualAuthDiffCerts(param); } - @Override + @MethodSource("newTestParams") + @ParameterizedTest @DisabledOnOs(value = OS.WINDOWS, disabledReason = "Disable until figured out why this sometimes fail on the CI") + @Override public void testMutualAuthDiffCertsServerFailure(SSLEngineTestParam param) throws Exception { super.testMutualAuthDiffCertsServerFailure(param); } - @Override + @MethodSource("newTestParams") + @ParameterizedTest @DisabledOnOs(value = OS.WINDOWS, disabledReason = "Disable until figured out why this sometimes fail on the CI") + @Override public void testMutualAuthDiffCertsClientFailure(SSLEngineTestParam param) throws Exception { super.testMutualAuthDiffCertsClientFailure(param); } - @Override + @MethodSource("newTestParams") + @ParameterizedTest @DisabledOnOs(value = OS.WINDOWS, disabledReason = "Disable until figured out why this sometimes fail on the CI") + @Override public void testMutualAuthInvalidIntermediateCASucceedWithOptionalClientAuth(SSLEngineTestParam param) throws Exception { checkShouldUseKeyManagerFactory(); super.testMutualAuthInvalidIntermediateCASucceedWithOptionalClientAuth(param); } - @Override + @MethodSource("newTestParams") + @ParameterizedTest @DisabledOnOs(value = OS.WINDOWS, disabledReason = "Disable until figured out why this sometimes fail on the CI") + @Override public void testMutualAuthInvalidIntermediateCAFailWithOptionalClientAuth(SSLEngineTestParam param) throws Exception { checkShouldUseKeyManagerFactory(); super.testMutualAuthInvalidIntermediateCAFailWithOptionalClientAuth(param); } - @Override + @MethodSource("newTestParams") + @ParameterizedTest @DisabledOnOs(value = OS.WINDOWS, disabledReason = "Disable until figured out why this sometimes fail on the CI") + @Override public void testMutualAuthInvalidIntermediateCAFailWithRequiredClientAuth(SSLEngineTestParam param) throws Exception { checkShouldUseKeyManagerFactory(); super.testMutualAuthInvalidIntermediateCAFailWithRequiredClientAuth(param); } - @Override + @MethodSource("newTestParams") + @ParameterizedTest @DisabledOnOs(value = OS.WINDOWS, disabledReason = "Disable until figured out why this sometimes fail on the CI") + @Override public void testMutualAuthValidClientCertChainTooLongFailOptionalClientAuth(SSLEngineTestParam param) throws Exception { checkShouldUseKeyManagerFactory(); super.testMutualAuthValidClientCertChainTooLongFailOptionalClientAuth(param); } - @Override + @MethodSource("newTestParams") + @ParameterizedTest @DisabledOnOs(value = OS.WINDOWS, disabledReason = "Disable until figured out why this sometimes fail on the CI") + @Override public void testMutualAuthValidClientCertChainTooLongFailRequireClientAuth(SSLEngineTestParam param) throws Exception { checkShouldUseKeyManagerFactory(); super.testMutualAuthValidClientCertChainTooLongFailRequireClientAuth(param); } + @MethodSource("newTestParams") + @ParameterizedTest @Override public void testSessionAfterHandshakeKeyManagerFactoryMutualAuth(SSLEngineTestParam param) throws Exception { checkShouldUseKeyManagerFactory(); super.testSessionAfterHandshakeKeyManagerFactoryMutualAuth(param); } + @MethodSource("newTestParams") + @ParameterizedTest @Override public void testSessionAfterHandshakeKeyManagerFactory(SSLEngineTestParam param) throws Exception { checkShouldUseKeyManagerFactory(); @@ -150,24 +172,32 @@ public class JdkOpenSslEngineInteroptTest extends SSLEngineTest { return super.mySetupMutualAuthServerIsValidClientException(cause) || causedBySSLException(cause); } + @MethodSource("newTestParams") + @ParameterizedTest @Override public void testHandshakeSession(SSLEngineTestParam param) throws Exception { checkShouldUseKeyManagerFactory(); super.testHandshakeSession(param); } + @MethodSource("newTestParams") + @ParameterizedTest @Override public void testSupportedSignatureAlgorithms(SSLEngineTestParam param) throws Exception { checkShouldUseKeyManagerFactory(); super.testSupportedSignatureAlgorithms(param); } + @MethodSource("newTestParams") + @ParameterizedTest @Override public void testSessionLocalWhenNonMutualWithKeyManager(SSLEngineTestParam param) throws Exception { checkShouldUseKeyManagerFactory(); super.testSessionLocalWhenNonMutualWithKeyManager(param); } + @MethodSource("newTestParams") + @ParameterizedTest @Override public void testSessionLocalWhenNonMutualWithoutKeyManager(SSLEngineTestParam param) throws Exception { // This only really works when the KeyManagerFactory is supported as otherwise we not really know when @@ -176,18 +206,24 @@ public class JdkOpenSslEngineInteroptTest extends SSLEngineTest { super.testSessionLocalWhenNonMutualWithoutKeyManager(param); } + @MethodSource("newTestParams") + @ParameterizedTest @Override public void testSessionCache(SSLEngineTestParam param) throws Exception { assumeTrue(OpenSsl.isSessionCacheSupported()); super.testSessionCache(param); } + @MethodSource("newTestParams") + @ParameterizedTest @Override public void testSessionCacheTimeout(SSLEngineTestParam param) throws Exception { assumeTrue(OpenSsl.isSessionCacheSupported()); super.testSessionCacheTimeout(param); } + @MethodSource("newTestParams") + @ParameterizedTest @Override public void testSessionCacheSize(SSLEngineTestParam param) throws Exception { assumeTrue(OpenSsl.isSessionCacheSupported()); diff --git a/handler/src/test/java/io/netty/handler/ssl/JdkSslEngineTest.java b/handler/src/test/java/io/netty/handler/ssl/JdkSslEngineTest.java index de8420a1bf..95c7741cbd 100644 --- a/handler/src/test/java/io/netty/handler/ssl/JdkSslEngineTest.java +++ b/handler/src/test/java/io/netty/handler/ssl/JdkSslEngineTest.java @@ -310,12 +310,16 @@ public class JdkSslEngineTest extends SSLEngineTest { testEnablingAnAlreadyDisabledSslProtocol(param, new String[]{}, new String[]{ SslProtocols.TLS_v1_2 }); } + @MethodSource("newTestParams") + @ParameterizedTest @Disabled /* Does the JDK support a "max certificate chain length"? */ @Override public void testMutualAuthValidClientCertChainTooLongFailOptionalClientAuth(SSLEngineTestParam param) throws Exception { } + @MethodSource("newTestParams") + @ParameterizedTest @Disabled /* Does the JDK support a "max certificate chain length"? */ @Override public void testMutualAuthValidClientCertChainTooLongFailRequireClientAuth(SSLEngineTestParam param) diff --git a/handler/src/test/java/io/netty/handler/ssl/OpenSslConscryptSslEngineInteropTest.java b/handler/src/test/java/io/netty/handler/ssl/OpenSslConscryptSslEngineInteropTest.java index 3c9dd65d3f..b5d4903938 100644 --- a/handler/src/test/java/io/netty/handler/ssl/OpenSslConscryptSslEngineInteropTest.java +++ b/handler/src/test/java/io/netty/handler/ssl/OpenSslConscryptSslEngineInteropTest.java @@ -18,6 +18,8 @@ package io.netty.handler.ssl; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.condition.DisabledIf; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; import javax.net.ssl.SSLEngine; import javax.net.ssl.SSLSessionContext; @@ -61,14 +63,18 @@ public class OpenSslConscryptSslEngineInteropTest extends ConscryptSslEngineTest return null; } - @Override + @MethodSource("newTestParams") + @ParameterizedTest @Disabled("TODO: Make this work with Conscrypt") + @Override public void testMutualAuthValidClientCertChainTooLongFailOptionalClientAuth(SSLEngineTestParam param) { super.testMutualAuthValidClientCertChainTooLongFailOptionalClientAuth(param); } - @Override + @MethodSource("newTestParams") + @ParameterizedTest @Disabled("TODO: Make this work with Conscrypt") + @Override public void testMutualAuthValidClientCertChainTooLongFailRequireClientAuth(SSLEngineTestParam param) { super.testMutualAuthValidClientCertChainTooLongFailRequireClientAuth(param); } @@ -79,6 +85,8 @@ public class OpenSslConscryptSslEngineInteropTest extends ConscryptSslEngineTest return super.mySetupMutualAuthServerIsValidClientException(cause) || causedBySSLException(cause); } + @MethodSource("newTestParams") + @ParameterizedTest @Override public void testMutualAuthInvalidIntermediateCASucceedWithOptionalClientAuth(SSLEngineTestParam param) throws Exception { @@ -86,6 +94,8 @@ public class OpenSslConscryptSslEngineInteropTest extends ConscryptSslEngineTest super.testMutualAuthInvalidIntermediateCASucceedWithOptionalClientAuth(param); } + @MethodSource("newTestParams") + @ParameterizedTest @Override public void testMutualAuthInvalidIntermediateCAFailWithOptionalClientAuth(SSLEngineTestParam param) throws Exception { @@ -93,6 +103,8 @@ public class OpenSslConscryptSslEngineInteropTest extends ConscryptSslEngineTest super.testMutualAuthInvalidIntermediateCAFailWithOptionalClientAuth(param); } + @MethodSource("newTestParams") + @ParameterizedTest @Override public void testMutualAuthInvalidIntermediateCAFailWithRequiredClientAuth(SSLEngineTestParam param) throws Exception { @@ -100,12 +112,16 @@ public class OpenSslConscryptSslEngineInteropTest extends ConscryptSslEngineTest super.testMutualAuthInvalidIntermediateCAFailWithRequiredClientAuth(param); } + @MethodSource("newTestParams") + @ParameterizedTest @Override public void testSessionAfterHandshakeKeyManagerFactoryMutualAuth(SSLEngineTestParam param) throws Exception { checkShouldUseKeyManagerFactory(); super.testSessionAfterHandshakeKeyManagerFactoryMutualAuth(param); } + @MethodSource("newTestParams") + @ParameterizedTest @Override public void testSupportedSignatureAlgorithms(SSLEngineTestParam param) throws Exception { checkShouldUseKeyManagerFactory(); @@ -118,24 +134,32 @@ public class OpenSslConscryptSslEngineInteropTest extends ConscryptSslEngineTest return super.mySetupMutualAuthServerIsValidServerException(cause) || causedBySSLException(cause); } + @MethodSource("newTestParams") + @ParameterizedTest @Override public void testSessionLocalWhenNonMutualWithKeyManager(SSLEngineTestParam param) throws Exception { checkShouldUseKeyManagerFactory(); super.testSessionLocalWhenNonMutualWithKeyManager(param); } + @MethodSource("newTestParams") + @ParameterizedTest @Override public void testSessionCache(SSLEngineTestParam param) throws Exception { assumeTrue(OpenSsl.isSessionCacheSupported()); super.testSessionCache(param); } + @MethodSource("newTestParams") + @ParameterizedTest @Override public void testSessionCacheTimeout(SSLEngineTestParam param) throws Exception { assumeTrue(OpenSsl.isSessionCacheSupported()); super.testSessionCacheTimeout(param); } + @MethodSource("newTestParams") + @ParameterizedTest @Override public void testSessionCacheSize(SSLEngineTestParam param) throws Exception { assumeTrue(OpenSsl.isSessionCacheSupported()); diff --git a/handler/src/test/java/io/netty/handler/ssl/OpenSslEngineTest.java b/handler/src/test/java/io/netty/handler/ssl/OpenSslEngineTest.java index 47220f97da..dad26c1561 100644 --- a/handler/src/test/java/io/netty/handler/ssl/OpenSslEngineTest.java +++ b/handler/src/test/java/io/netty/handler/ssl/OpenSslEngineTest.java @@ -1397,12 +1397,16 @@ public class OpenSslEngineTest extends SSLEngineTest { } } + @MethodSource("newTestParams") + @ParameterizedTest @Override public void testSessionLocalWhenNonMutualWithKeyManager(SSLEngineTestParam param) throws Exception { checkShouldUseKeyManagerFactory(); super.testSessionLocalWhenNonMutualWithKeyManager(param); } + @MethodSource("newTestParams") + @ParameterizedTest @Override public void testSessionLocalWhenNonMutualWithoutKeyManager(SSLEngineTestParam param) throws Exception { // This only really works when the KeyManagerFactory is supported as otherwise we not really know when @@ -1514,6 +1518,8 @@ public class OpenSslEngineTest extends SSLEngineTest { return context; } + @MethodSource("newTestParams") + @ParameterizedTest @Override public void testSessionCache(SSLEngineTestParam param) throws Exception { assumeTrue(OpenSsl.isSessionCacheSupported()); @@ -1522,12 +1528,16 @@ public class OpenSslEngineTest extends SSLEngineTest { assertSessionContext(serverSslCtx); } + @MethodSource("newTestParams") + @ParameterizedTest @Override public void testSessionCacheTimeout(SSLEngineTestParam param) throws Exception { assumeTrue(OpenSsl.isSessionCacheSupported()); super.testSessionCacheTimeout(param); } + @MethodSource("newTestParams") + @ParameterizedTest @Override public void testSessionCacheSize(SSLEngineTestParam param) throws Exception { assumeTrue(OpenSsl.isSessionCacheSupported()); diff --git a/handler/src/test/java/io/netty/handler/ssl/OpenSslJdkSslEngineInteroptTest.java b/handler/src/test/java/io/netty/handler/ssl/OpenSslJdkSslEngineInteroptTest.java index 6d4e175b43..0d47fd09b3 100644 --- a/handler/src/test/java/io/netty/handler/ssl/OpenSslJdkSslEngineInteroptTest.java +++ b/handler/src/test/java/io/netty/handler/ssl/OpenSslJdkSslEngineInteroptTest.java @@ -61,18 +61,24 @@ public class OpenSslJdkSslEngineInteroptTest extends SSLEngineTest { return SslProvider.JDK; } + @MethodSource("newTestParams") + @ParameterizedTest @Disabled /* Does the JDK support a "max certificate chain length"? */ @Override public void testMutualAuthValidClientCertChainTooLongFailOptionalClientAuth(SSLEngineTestParam param) throws Exception { } + @MethodSource("newTestParams") + @ParameterizedTest @Disabled /* Does the JDK support a "max certificate chain length"? */ @Override public void testMutualAuthValidClientCertChainTooLongFailRequireClientAuth(SSLEngineTestParam param) throws Exception { } + @MethodSource("newTestParams") + @ParameterizedTest @Override public void testMutualAuthInvalidIntermediateCASucceedWithOptionalClientAuth(SSLEngineTestParam param) throws Exception { @@ -80,6 +86,8 @@ public class OpenSslJdkSslEngineInteroptTest extends SSLEngineTest { super.testMutualAuthInvalidIntermediateCASucceedWithOptionalClientAuth(param); } + @MethodSource("newTestParams") + @ParameterizedTest @Override public void testMutualAuthInvalidIntermediateCAFailWithOptionalClientAuth(SSLEngineTestParam param) throws Exception { @@ -87,6 +95,8 @@ public class OpenSslJdkSslEngineInteroptTest extends SSLEngineTest { super.testMutualAuthInvalidIntermediateCAFailWithOptionalClientAuth(param); } + @MethodSource("newTestParams") + @ParameterizedTest @Override public void testMutualAuthInvalidIntermediateCAFailWithRequiredClientAuth(SSLEngineTestParam param) throws Exception { @@ -94,6 +104,8 @@ public class OpenSslJdkSslEngineInteroptTest extends SSLEngineTest { super.testMutualAuthInvalidIntermediateCAFailWithRequiredClientAuth(param); } + @MethodSource("newTestParams") + @ParameterizedTest @Override public void testSessionAfterHandshakeKeyManagerFactoryMutualAuth(SSLEngineTestParam param) throws Exception { checkShouldUseKeyManagerFactory(); @@ -106,24 +118,32 @@ public class OpenSslJdkSslEngineInteroptTest extends SSLEngineTest { return super.mySetupMutualAuthServerIsValidServerException(cause) || causedBySSLException(cause); } + @MethodSource("newTestParams") + @ParameterizedTest @Override public void testHandshakeSession(SSLEngineTestParam param) throws Exception { checkShouldUseKeyManagerFactory(); super.testHandshakeSession(param); } + @MethodSource("newTestParams") + @ParameterizedTest @Override public void testSupportedSignatureAlgorithms(SSLEngineTestParam param) throws Exception { checkShouldUseKeyManagerFactory(); super.testSupportedSignatureAlgorithms(param); } + @MethodSource("newTestParams") + @ParameterizedTest @Override public void testSessionLocalWhenNonMutualWithKeyManager(SSLEngineTestParam param) throws Exception { checkShouldUseKeyManagerFactory(); super.testSessionLocalWhenNonMutualWithKeyManager(param); } + @MethodSource("newTestParams") + @ParameterizedTest @Override public void testSessionLocalWhenNonMutualWithoutKeyManager(SSLEngineTestParam param) throws Exception { // This only really works when the KeyManagerFactory is supported as otherwise we not really know when @@ -132,18 +152,24 @@ public class OpenSslJdkSslEngineInteroptTest extends SSLEngineTest { super.testSessionLocalWhenNonMutualWithoutKeyManager(param); } + @MethodSource("newTestParams") + @ParameterizedTest @Override public void testSessionCache(SSLEngineTestParam param) throws Exception { assumeTrue(OpenSsl.isSessionCacheSupported()); super.testSessionCache(param); } + @MethodSource("newTestParams") + @ParameterizedTest @Override public void testSessionCacheTimeout(SSLEngineTestParam param) throws Exception { assumeTrue(OpenSsl.isSessionCacheSupported()); super.testSessionCacheTimeout(param); } + @MethodSource("newTestParams") + @ParameterizedTest @Override public void testSessionCacheSize(SSLEngineTestParam param) throws Exception { assumeTrue(OpenSsl.isSessionCacheSupported());