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
This commit is contained in:
Norman Maurer 2021-08-31 08:07:56 +02:00
parent 887526374b
commit c039f82483
10 changed files with 173 additions and 15 deletions

View File

@ -21,6 +21,8 @@ import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.condition.DisabledIf; 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 javax.crypto.Cipher;
import java.security.Security; import java.security.Security;
@ -79,11 +81,15 @@ public class AmazonCorrettoSslEngineTest extends SSLEngineTest {
assertNull(Security.getProvider(AmazonCorrettoCryptoProvider.PROVIDER_NAME)); assertNull(Security.getProvider(AmazonCorrettoCryptoProvider.PROVIDER_NAME));
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Disabled /* Does the JDK support a "max certificate chain length"? */ @Disabled /* Does the JDK support a "max certificate chain length"? */
@Override @Override
public void testMutualAuthValidClientCertChainTooLongFailOptionalClientAuth(SSLEngineTestParam param) { public void testMutualAuthValidClientCertChainTooLongFailOptionalClientAuth(SSLEngineTestParam param) {
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Disabled /* Does the JDK support a "max certificate chain length"? */ @Disabled /* Does the JDK support a "max certificate chain length"? */
@Override @Override
public void testMutualAuthValidClientCertChainTooLongFailRequireClientAuth(SSLEngineTestParam param) { public void testMutualAuthValidClientCertChainTooLongFailRequireClientAuth(SSLEngineTestParam param) {

View File

@ -19,6 +19,8 @@ import java.security.Provider;
import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.condition.DisabledIf; 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 javax.net.ssl.SSLSessionContext;
@ -49,18 +51,24 @@ public class ConscryptJdkSslEngineInteropTest extends SSLEngineTest {
return Java8SslTestUtils.conscryptProvider(); return Java8SslTestUtils.conscryptProvider();
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Disabled /* Does the JDK support a "max certificate chain length"? */ @Disabled /* Does the JDK support a "max certificate chain length"? */
@Override @Override
public void testMutualAuthValidClientCertChainTooLongFailOptionalClientAuth(SSLEngineTestParam param) public void testMutualAuthValidClientCertChainTooLongFailOptionalClientAuth(SSLEngineTestParam param)
throws Exception { throws Exception {
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Disabled /* Does the JDK support a "max certificate chain length"? */ @Disabled /* Does the JDK support a "max certificate chain length"? */
@Override @Override
public void testMutualAuthValidClientCertChainTooLongFailRequireClientAuth(SSLEngineTestParam param) public void testMutualAuthValidClientCertChainTooLongFailRequireClientAuth(SSLEngineTestParam param)
throws Exception { throws Exception {
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Override @Override
protected boolean mySetupMutualAuthServerIsValidServerException(Throwable cause) { protected boolean mySetupMutualAuthServerIsValidServerException(Throwable cause) {
// TODO(scott): work around for a JDK issue. The exception should be SSLHandshakeException. // TODO(scott): work around for a JDK issue. The exception should be SSLHandshakeException.

View File

@ -65,14 +65,18 @@ public class ConscryptOpenSslEngineInteropTest extends ConscryptSslEngineTest {
return null; return null;
} }
@Override @MethodSource("newTestParams")
@ParameterizedTest
@Disabled("TODO: Make this work with Conscrypt") @Disabled("TODO: Make this work with Conscrypt")
@Override
public void testMutualAuthValidClientCertChainTooLongFailOptionalClientAuth(SSLEngineTestParam param) { public void testMutualAuthValidClientCertChainTooLongFailOptionalClientAuth(SSLEngineTestParam param) {
super.testMutualAuthValidClientCertChainTooLongFailOptionalClientAuth(param); super.testMutualAuthValidClientCertChainTooLongFailOptionalClientAuth(param);
} }
@Override @MethodSource("newTestParams")
@ParameterizedTest
@Disabled("TODO: Make this work with Conscrypt") @Disabled("TODO: Make this work with Conscrypt")
@Override
public void testMutualAuthValidClientCertChainTooLongFailRequireClientAuth(SSLEngineTestParam param) { public void testMutualAuthValidClientCertChainTooLongFailRequireClientAuth(SSLEngineTestParam param) {
super.testMutualAuthValidClientCertChainTooLongFailRequireClientAuth(param); super.testMutualAuthValidClientCertChainTooLongFailRequireClientAuth(param);
} }
@ -83,6 +87,8 @@ public class ConscryptOpenSslEngineInteropTest extends ConscryptSslEngineTest {
return super.mySetupMutualAuthServerIsValidClientException(cause) || causedBySSLException(cause); return super.mySetupMutualAuthServerIsValidClientException(cause) || causedBySSLException(cause);
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Override @Override
public void testMutualAuthInvalidIntermediateCASucceedWithOptionalClientAuth(SSLEngineTestParam param) public void testMutualAuthInvalidIntermediateCASucceedWithOptionalClientAuth(SSLEngineTestParam param)
throws Exception { throws Exception {
@ -90,6 +96,8 @@ public class ConscryptOpenSslEngineInteropTest extends ConscryptSslEngineTest {
super.testMutualAuthInvalidIntermediateCASucceedWithOptionalClientAuth(param); super.testMutualAuthInvalidIntermediateCASucceedWithOptionalClientAuth(param);
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Override @Override
public void testMutualAuthInvalidIntermediateCAFailWithOptionalClientAuth(SSLEngineTestParam param) public void testMutualAuthInvalidIntermediateCAFailWithOptionalClientAuth(SSLEngineTestParam param)
throws Exception { throws Exception {
@ -97,6 +105,8 @@ public class ConscryptOpenSslEngineInteropTest extends ConscryptSslEngineTest {
super.testMutualAuthInvalidIntermediateCAFailWithOptionalClientAuth(param); super.testMutualAuthInvalidIntermediateCAFailWithOptionalClientAuth(param);
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Override @Override
public void testMutualAuthInvalidIntermediateCAFailWithRequiredClientAuth(SSLEngineTestParam param) public void testMutualAuthInvalidIntermediateCAFailWithRequiredClientAuth(SSLEngineTestParam param)
throws Exception { throws Exception {
@ -104,18 +114,24 @@ public class ConscryptOpenSslEngineInteropTest extends ConscryptSslEngineTest {
super.testMutualAuthInvalidIntermediateCAFailWithRequiredClientAuth(param); super.testMutualAuthInvalidIntermediateCAFailWithRequiredClientAuth(param);
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Override @Override
public void testSessionAfterHandshakeKeyManagerFactory(SSLEngineTestParam param) throws Exception { public void testSessionAfterHandshakeKeyManagerFactory(SSLEngineTestParam param) throws Exception {
checkShouldUseKeyManagerFactory(); checkShouldUseKeyManagerFactory();
super.testSessionAfterHandshakeKeyManagerFactory(param); super.testSessionAfterHandshakeKeyManagerFactory(param);
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Override @Override
public void testSessionAfterHandshakeKeyManagerFactoryMutualAuth(SSLEngineTestParam param) throws Exception { public void testSessionAfterHandshakeKeyManagerFactoryMutualAuth(SSLEngineTestParam param) throws Exception {
checkShouldUseKeyManagerFactory(); checkShouldUseKeyManagerFactory();
super.testSessionAfterHandshakeKeyManagerFactoryMutualAuth(param); super.testSessionAfterHandshakeKeyManagerFactoryMutualAuth(param);
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Override @Override
public void testSupportedSignatureAlgorithms(SSLEngineTestParam param) throws Exception { public void testSupportedSignatureAlgorithms(SSLEngineTestParam param) throws Exception {
checkShouldUseKeyManagerFactory(); checkShouldUseKeyManagerFactory();
@ -128,12 +144,16 @@ public class ConscryptOpenSslEngineInteropTest extends ConscryptSslEngineTest {
return super.mySetupMutualAuthServerIsValidServerException(cause) || causedBySSLException(cause); return super.mySetupMutualAuthServerIsValidServerException(cause) || causedBySSLException(cause);
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Override @Override
public void testSessionLocalWhenNonMutualWithKeyManager(SSLEngineTestParam param) throws Exception { public void testSessionLocalWhenNonMutualWithKeyManager(SSLEngineTestParam param) throws Exception {
checkShouldUseKeyManagerFactory(); checkShouldUseKeyManagerFactory();
super.testSessionLocalWhenNonMutualWithKeyManager(param); super.testSessionLocalWhenNonMutualWithKeyManager(param);
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Override @Override
public void testSessionLocalWhenNonMutualWithoutKeyManager(SSLEngineTestParam param) throws Exception { public void testSessionLocalWhenNonMutualWithoutKeyManager(SSLEngineTestParam param) throws Exception {
// This only really works when the KeyManagerFactory is supported as otherwise we not really know when // 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 // Not supported by conscrypt
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Override @Override
public void testSessionCache(SSLEngineTestParam param) throws Exception { public void testSessionCache(SSLEngineTestParam param) throws Exception {
assumeTrue(OpenSsl.isSessionCacheSupported()); assumeTrue(OpenSsl.isSessionCacheSupported());
super.testSessionCache(param); super.testSessionCache(param);
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Override @Override
public void testSessionCacheTimeout(SSLEngineTestParam param) throws Exception { public void testSessionCacheTimeout(SSLEngineTestParam param) throws Exception {
assumeTrue(OpenSsl.isSessionCacheSupported()); assumeTrue(OpenSsl.isSessionCacheSupported());
super.testSessionCacheTimeout(param); super.testSessionCacheTimeout(param);
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Override @Override
public void testSessionCacheSize(SSLEngineTestParam param) throws Exception { public void testSessionCacheSize(SSLEngineTestParam param) throws Exception {
assumeTrue(OpenSsl.isSessionCacheSupported()); assumeTrue(OpenSsl.isSessionCacheSupported());

View File

@ -18,6 +18,8 @@ package io.netty.handler.ssl;
import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.condition.DisabledIf; 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 javax.net.ssl.SSLSessionContext;
import java.security.Provider; import java.security.Provider;
@ -53,11 +55,15 @@ public class ConscryptSslEngineTest extends SSLEngineTest {
return Java8SslTestUtils.conscryptProvider(); return Java8SslTestUtils.conscryptProvider();
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Disabled /* Does the JDK support a "max certificate chain length"? */ @Disabled /* Does the JDK support a "max certificate chain length"? */
@Override @Override
public void testMutualAuthValidClientCertChainTooLongFailOptionalClientAuth(SSLEngineTestParam param) { public void testMutualAuthValidClientCertChainTooLongFailOptionalClientAuth(SSLEngineTestParam param) {
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Disabled /* Does the JDK support a "max certificate chain length"? */ @Disabled /* Does the JDK support a "max certificate chain length"? */
@Override @Override
public void testMutualAuthValidClientCertChainTooLongFailRequireClientAuth(SSLEngineTestParam param) { public void testMutualAuthValidClientCertChainTooLongFailRequireClientAuth(SSLEngineTestParam param) {
@ -68,6 +74,8 @@ public class ConscryptSslEngineTest extends SSLEngineTest {
// Not supported by conscrypt // Not supported by conscrypt
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Disabled("Possible Conscrypt bug") @Disabled("Possible Conscrypt bug")
@Override @Override
public void testSessionCacheTimeout(SSLEngineTestParam param) throws Exception { public void testSessionCacheTimeout(SSLEngineTestParam param) throws Exception {

View File

@ -19,6 +19,8 @@ import java.security.Provider;
import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.condition.DisabledIf; 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 javax.net.ssl.SSLSessionContext;
@ -48,15 +50,19 @@ public class JdkConscryptSslEngineInteropTest extends SSLEngineTest {
return Java8SslTestUtils.conscryptProvider(); return Java8SslTestUtils.conscryptProvider();
} }
@Override @MethodSource("newTestParams")
@ParameterizedTest
@Disabled("TODO: Make this work with Conscrypt") @Disabled("TODO: Make this work with Conscrypt")
@Override
public void testMutualAuthValidClientCertChainTooLongFailOptionalClientAuth(SSLEngineTestParam param) public void testMutualAuthValidClientCertChainTooLongFailOptionalClientAuth(SSLEngineTestParam param)
throws Exception { throws Exception {
super.testMutualAuthValidClientCertChainTooLongFailOptionalClientAuth(param); super.testMutualAuthValidClientCertChainTooLongFailOptionalClientAuth(param);
} }
@Override @MethodSource("newTestParams")
@ParameterizedTest
@Disabled("TODO: Make this work with Conscrypt") @Disabled("TODO: Make this work with Conscrypt")
@Override
public void testMutualAuthValidClientCertChainTooLongFailRequireClientAuth(SSLEngineTestParam param) public void testMutualAuthValidClientCertChainTooLongFailRequireClientAuth(SSLEngineTestParam param)
throws Exception { throws Exception {
super.testMutualAuthValidClientCertChainTooLongFailRequireClientAuth(param); super.testMutualAuthValidClientCertChainTooLongFailRequireClientAuth(param);
@ -68,6 +74,8 @@ public class JdkConscryptSslEngineInteropTest extends SSLEngineTest {
return super.mySetupMutualAuthServerIsValidClientException(cause) || causedBySSLException(cause); return super.mySetupMutualAuthServerIsValidClientException(cause) || causedBySSLException(cause);
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Disabled("Ignore due bug in Conscrypt") @Disabled("Ignore due bug in Conscrypt")
@Override @Override
public void testHandshakeSession(SSLEngineTestParam param) throws Exception { public void testHandshakeSession(SSLEngineTestParam param) throws Exception {
@ -80,6 +88,8 @@ public class JdkConscryptSslEngineInteropTest extends SSLEngineTest {
// Not supported by conscrypt // Not supported by conscrypt
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Disabled("Possible Conscrypt bug") @Disabled("Possible Conscrypt bug")
@Override @Override
public void testSessionCacheTimeout(SSLEngineTestParam param) { public void testSessionCacheTimeout(SSLEngineTestParam param) {

View File

@ -62,76 +62,98 @@ public class JdkOpenSslEngineInteroptTest extends SSLEngineTest {
return SslProvider.OPENSSL; return SslProvider.OPENSSL;
} }
@Override @MethodSource("newTestParams")
@ParameterizedTest
@DisabledOnOs(value = OS.WINDOWS, disabledReason = "Disable until figured out why this sometimes fail on the CI") @DisabledOnOs(value = OS.WINDOWS, disabledReason = "Disable until figured out why this sometimes fail on the CI")
@Override
public void testMutualAuthSameCerts(SSLEngineTestParam param) throws Throwable { public void testMutualAuthSameCerts(SSLEngineTestParam param) throws Throwable {
super.testMutualAuthSameCerts(param); super.testMutualAuthSameCerts(param);
} }
@Override @MethodSource("newTestParams")
@ParameterizedTest
@DisabledOnOs(value = OS.WINDOWS, disabledReason = "Disable until figured out why this sometimes fail on the CI") @DisabledOnOs(value = OS.WINDOWS, disabledReason = "Disable until figured out why this sometimes fail on the CI")
@Override
public void testMutualAuthDiffCerts(SSLEngineTestParam param) throws Exception { public void testMutualAuthDiffCerts(SSLEngineTestParam param) throws Exception {
super.testMutualAuthDiffCerts(param); super.testMutualAuthDiffCerts(param);
} }
@Override @MethodSource("newTestParams")
@ParameterizedTest
@DisabledOnOs(value = OS.WINDOWS, disabledReason = "Disable until figured out why this sometimes fail on the CI") @DisabledOnOs(value = OS.WINDOWS, disabledReason = "Disable until figured out why this sometimes fail on the CI")
@Override
public void testMutualAuthDiffCertsServerFailure(SSLEngineTestParam param) throws Exception { public void testMutualAuthDiffCertsServerFailure(SSLEngineTestParam param) throws Exception {
super.testMutualAuthDiffCertsServerFailure(param); super.testMutualAuthDiffCertsServerFailure(param);
} }
@Override @MethodSource("newTestParams")
@ParameterizedTest
@DisabledOnOs(value = OS.WINDOWS, disabledReason = "Disable until figured out why this sometimes fail on the CI") @DisabledOnOs(value = OS.WINDOWS, disabledReason = "Disable until figured out why this sometimes fail on the CI")
@Override
public void testMutualAuthDiffCertsClientFailure(SSLEngineTestParam param) throws Exception { public void testMutualAuthDiffCertsClientFailure(SSLEngineTestParam param) throws Exception {
super.testMutualAuthDiffCertsClientFailure(param); super.testMutualAuthDiffCertsClientFailure(param);
} }
@Override @MethodSource("newTestParams")
@ParameterizedTest
@DisabledOnOs(value = OS.WINDOWS, disabledReason = "Disable until figured out why this sometimes fail on the CI") @DisabledOnOs(value = OS.WINDOWS, disabledReason = "Disable until figured out why this sometimes fail on the CI")
@Override
public void testMutualAuthInvalidIntermediateCASucceedWithOptionalClientAuth(SSLEngineTestParam param) public void testMutualAuthInvalidIntermediateCASucceedWithOptionalClientAuth(SSLEngineTestParam param)
throws Exception { throws Exception {
checkShouldUseKeyManagerFactory(); checkShouldUseKeyManagerFactory();
super.testMutualAuthInvalidIntermediateCASucceedWithOptionalClientAuth(param); super.testMutualAuthInvalidIntermediateCASucceedWithOptionalClientAuth(param);
} }
@Override @MethodSource("newTestParams")
@ParameterizedTest
@DisabledOnOs(value = OS.WINDOWS, disabledReason = "Disable until figured out why this sometimes fail on the CI") @DisabledOnOs(value = OS.WINDOWS, disabledReason = "Disable until figured out why this sometimes fail on the CI")
@Override
public void testMutualAuthInvalidIntermediateCAFailWithOptionalClientAuth(SSLEngineTestParam param) public void testMutualAuthInvalidIntermediateCAFailWithOptionalClientAuth(SSLEngineTestParam param)
throws Exception { throws Exception {
checkShouldUseKeyManagerFactory(); checkShouldUseKeyManagerFactory();
super.testMutualAuthInvalidIntermediateCAFailWithOptionalClientAuth(param); super.testMutualAuthInvalidIntermediateCAFailWithOptionalClientAuth(param);
} }
@Override @MethodSource("newTestParams")
@ParameterizedTest
@DisabledOnOs(value = OS.WINDOWS, disabledReason = "Disable until figured out why this sometimes fail on the CI") @DisabledOnOs(value = OS.WINDOWS, disabledReason = "Disable until figured out why this sometimes fail on the CI")
@Override
public void testMutualAuthInvalidIntermediateCAFailWithRequiredClientAuth(SSLEngineTestParam param) public void testMutualAuthInvalidIntermediateCAFailWithRequiredClientAuth(SSLEngineTestParam param)
throws Exception { throws Exception {
checkShouldUseKeyManagerFactory(); checkShouldUseKeyManagerFactory();
super.testMutualAuthInvalidIntermediateCAFailWithRequiredClientAuth(param); super.testMutualAuthInvalidIntermediateCAFailWithRequiredClientAuth(param);
} }
@Override @MethodSource("newTestParams")
@ParameterizedTest
@DisabledOnOs(value = OS.WINDOWS, disabledReason = "Disable until figured out why this sometimes fail on the CI") @DisabledOnOs(value = OS.WINDOWS, disabledReason = "Disable until figured out why this sometimes fail on the CI")
@Override
public void testMutualAuthValidClientCertChainTooLongFailOptionalClientAuth(SSLEngineTestParam param) public void testMutualAuthValidClientCertChainTooLongFailOptionalClientAuth(SSLEngineTestParam param)
throws Exception { throws Exception {
checkShouldUseKeyManagerFactory(); checkShouldUseKeyManagerFactory();
super.testMutualAuthValidClientCertChainTooLongFailOptionalClientAuth(param); super.testMutualAuthValidClientCertChainTooLongFailOptionalClientAuth(param);
} }
@Override @MethodSource("newTestParams")
@ParameterizedTest
@DisabledOnOs(value = OS.WINDOWS, disabledReason = "Disable until figured out why this sometimes fail on the CI") @DisabledOnOs(value = OS.WINDOWS, disabledReason = "Disable until figured out why this sometimes fail on the CI")
@Override
public void testMutualAuthValidClientCertChainTooLongFailRequireClientAuth(SSLEngineTestParam param) public void testMutualAuthValidClientCertChainTooLongFailRequireClientAuth(SSLEngineTestParam param)
throws Exception { throws Exception {
checkShouldUseKeyManagerFactory(); checkShouldUseKeyManagerFactory();
super.testMutualAuthValidClientCertChainTooLongFailRequireClientAuth(param); super.testMutualAuthValidClientCertChainTooLongFailRequireClientAuth(param);
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Override @Override
public void testSessionAfterHandshakeKeyManagerFactoryMutualAuth(SSLEngineTestParam param) throws Exception { public void testSessionAfterHandshakeKeyManagerFactoryMutualAuth(SSLEngineTestParam param) throws Exception {
checkShouldUseKeyManagerFactory(); checkShouldUseKeyManagerFactory();
super.testSessionAfterHandshakeKeyManagerFactoryMutualAuth(param); super.testSessionAfterHandshakeKeyManagerFactoryMutualAuth(param);
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Override @Override
public void testSessionAfterHandshakeKeyManagerFactory(SSLEngineTestParam param) throws Exception { public void testSessionAfterHandshakeKeyManagerFactory(SSLEngineTestParam param) throws Exception {
checkShouldUseKeyManagerFactory(); checkShouldUseKeyManagerFactory();
@ -150,24 +172,32 @@ public class JdkOpenSslEngineInteroptTest extends SSLEngineTest {
return super.mySetupMutualAuthServerIsValidClientException(cause) || causedBySSLException(cause); return super.mySetupMutualAuthServerIsValidClientException(cause) || causedBySSLException(cause);
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Override @Override
public void testHandshakeSession(SSLEngineTestParam param) throws Exception { public void testHandshakeSession(SSLEngineTestParam param) throws Exception {
checkShouldUseKeyManagerFactory(); checkShouldUseKeyManagerFactory();
super.testHandshakeSession(param); super.testHandshakeSession(param);
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Override @Override
public void testSupportedSignatureAlgorithms(SSLEngineTestParam param) throws Exception { public void testSupportedSignatureAlgorithms(SSLEngineTestParam param) throws Exception {
checkShouldUseKeyManagerFactory(); checkShouldUseKeyManagerFactory();
super.testSupportedSignatureAlgorithms(param); super.testSupportedSignatureAlgorithms(param);
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Override @Override
public void testSessionLocalWhenNonMutualWithKeyManager(SSLEngineTestParam param) throws Exception { public void testSessionLocalWhenNonMutualWithKeyManager(SSLEngineTestParam param) throws Exception {
checkShouldUseKeyManagerFactory(); checkShouldUseKeyManagerFactory();
super.testSessionLocalWhenNonMutualWithKeyManager(param); super.testSessionLocalWhenNonMutualWithKeyManager(param);
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Override @Override
public void testSessionLocalWhenNonMutualWithoutKeyManager(SSLEngineTestParam param) throws Exception { public void testSessionLocalWhenNonMutualWithoutKeyManager(SSLEngineTestParam param) throws Exception {
// This only really works when the KeyManagerFactory is supported as otherwise we not really know when // 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); super.testSessionLocalWhenNonMutualWithoutKeyManager(param);
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Override @Override
public void testSessionCache(SSLEngineTestParam param) throws Exception { public void testSessionCache(SSLEngineTestParam param) throws Exception {
assumeTrue(OpenSsl.isSessionCacheSupported()); assumeTrue(OpenSsl.isSessionCacheSupported());
super.testSessionCache(param); super.testSessionCache(param);
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Override @Override
public void testSessionCacheTimeout(SSLEngineTestParam param) throws Exception { public void testSessionCacheTimeout(SSLEngineTestParam param) throws Exception {
assumeTrue(OpenSsl.isSessionCacheSupported()); assumeTrue(OpenSsl.isSessionCacheSupported());
super.testSessionCacheTimeout(param); super.testSessionCacheTimeout(param);
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Override @Override
public void testSessionCacheSize(SSLEngineTestParam param) throws Exception { public void testSessionCacheSize(SSLEngineTestParam param) throws Exception {
assumeTrue(OpenSsl.isSessionCacheSupported()); assumeTrue(OpenSsl.isSessionCacheSupported());

View File

@ -310,12 +310,16 @@ public class JdkSslEngineTest extends SSLEngineTest {
testEnablingAnAlreadyDisabledSslProtocol(param, new String[]{}, new String[]{ SslProtocols.TLS_v1_2 }); testEnablingAnAlreadyDisabledSslProtocol(param, new String[]{}, new String[]{ SslProtocols.TLS_v1_2 });
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Disabled /* Does the JDK support a "max certificate chain length"? */ @Disabled /* Does the JDK support a "max certificate chain length"? */
@Override @Override
public void testMutualAuthValidClientCertChainTooLongFailOptionalClientAuth(SSLEngineTestParam param) public void testMutualAuthValidClientCertChainTooLongFailOptionalClientAuth(SSLEngineTestParam param)
throws Exception { throws Exception {
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Disabled /* Does the JDK support a "max certificate chain length"? */ @Disabled /* Does the JDK support a "max certificate chain length"? */
@Override @Override
public void testMutualAuthValidClientCertChainTooLongFailRequireClientAuth(SSLEngineTestParam param) public void testMutualAuthValidClientCertChainTooLongFailRequireClientAuth(SSLEngineTestParam param)

View File

@ -18,6 +18,8 @@ package io.netty.handler.ssl;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.condition.DisabledIf; 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.SSLEngine;
import javax.net.ssl.SSLSessionContext; import javax.net.ssl.SSLSessionContext;
@ -61,14 +63,18 @@ public class OpenSslConscryptSslEngineInteropTest extends ConscryptSslEngineTest
return null; return null;
} }
@Override @MethodSource("newTestParams")
@ParameterizedTest
@Disabled("TODO: Make this work with Conscrypt") @Disabled("TODO: Make this work with Conscrypt")
@Override
public void testMutualAuthValidClientCertChainTooLongFailOptionalClientAuth(SSLEngineTestParam param) { public void testMutualAuthValidClientCertChainTooLongFailOptionalClientAuth(SSLEngineTestParam param) {
super.testMutualAuthValidClientCertChainTooLongFailOptionalClientAuth(param); super.testMutualAuthValidClientCertChainTooLongFailOptionalClientAuth(param);
} }
@Override @MethodSource("newTestParams")
@ParameterizedTest
@Disabled("TODO: Make this work with Conscrypt") @Disabled("TODO: Make this work with Conscrypt")
@Override
public void testMutualAuthValidClientCertChainTooLongFailRequireClientAuth(SSLEngineTestParam param) { public void testMutualAuthValidClientCertChainTooLongFailRequireClientAuth(SSLEngineTestParam param) {
super.testMutualAuthValidClientCertChainTooLongFailRequireClientAuth(param); super.testMutualAuthValidClientCertChainTooLongFailRequireClientAuth(param);
} }
@ -79,6 +85,8 @@ public class OpenSslConscryptSslEngineInteropTest extends ConscryptSslEngineTest
return super.mySetupMutualAuthServerIsValidClientException(cause) || causedBySSLException(cause); return super.mySetupMutualAuthServerIsValidClientException(cause) || causedBySSLException(cause);
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Override @Override
public void testMutualAuthInvalidIntermediateCASucceedWithOptionalClientAuth(SSLEngineTestParam param) public void testMutualAuthInvalidIntermediateCASucceedWithOptionalClientAuth(SSLEngineTestParam param)
throws Exception { throws Exception {
@ -86,6 +94,8 @@ public class OpenSslConscryptSslEngineInteropTest extends ConscryptSslEngineTest
super.testMutualAuthInvalidIntermediateCASucceedWithOptionalClientAuth(param); super.testMutualAuthInvalidIntermediateCASucceedWithOptionalClientAuth(param);
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Override @Override
public void testMutualAuthInvalidIntermediateCAFailWithOptionalClientAuth(SSLEngineTestParam param) public void testMutualAuthInvalidIntermediateCAFailWithOptionalClientAuth(SSLEngineTestParam param)
throws Exception { throws Exception {
@ -93,6 +103,8 @@ public class OpenSslConscryptSslEngineInteropTest extends ConscryptSslEngineTest
super.testMutualAuthInvalidIntermediateCAFailWithOptionalClientAuth(param); super.testMutualAuthInvalidIntermediateCAFailWithOptionalClientAuth(param);
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Override @Override
public void testMutualAuthInvalidIntermediateCAFailWithRequiredClientAuth(SSLEngineTestParam param) public void testMutualAuthInvalidIntermediateCAFailWithRequiredClientAuth(SSLEngineTestParam param)
throws Exception { throws Exception {
@ -100,12 +112,16 @@ public class OpenSslConscryptSslEngineInteropTest extends ConscryptSslEngineTest
super.testMutualAuthInvalidIntermediateCAFailWithRequiredClientAuth(param); super.testMutualAuthInvalidIntermediateCAFailWithRequiredClientAuth(param);
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Override @Override
public void testSessionAfterHandshakeKeyManagerFactoryMutualAuth(SSLEngineTestParam param) throws Exception { public void testSessionAfterHandshakeKeyManagerFactoryMutualAuth(SSLEngineTestParam param) throws Exception {
checkShouldUseKeyManagerFactory(); checkShouldUseKeyManagerFactory();
super.testSessionAfterHandshakeKeyManagerFactoryMutualAuth(param); super.testSessionAfterHandshakeKeyManagerFactoryMutualAuth(param);
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Override @Override
public void testSupportedSignatureAlgorithms(SSLEngineTestParam param) throws Exception { public void testSupportedSignatureAlgorithms(SSLEngineTestParam param) throws Exception {
checkShouldUseKeyManagerFactory(); checkShouldUseKeyManagerFactory();
@ -118,24 +134,32 @@ public class OpenSslConscryptSslEngineInteropTest extends ConscryptSslEngineTest
return super.mySetupMutualAuthServerIsValidServerException(cause) || causedBySSLException(cause); return super.mySetupMutualAuthServerIsValidServerException(cause) || causedBySSLException(cause);
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Override @Override
public void testSessionLocalWhenNonMutualWithKeyManager(SSLEngineTestParam param) throws Exception { public void testSessionLocalWhenNonMutualWithKeyManager(SSLEngineTestParam param) throws Exception {
checkShouldUseKeyManagerFactory(); checkShouldUseKeyManagerFactory();
super.testSessionLocalWhenNonMutualWithKeyManager(param); super.testSessionLocalWhenNonMutualWithKeyManager(param);
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Override @Override
public void testSessionCache(SSLEngineTestParam param) throws Exception { public void testSessionCache(SSLEngineTestParam param) throws Exception {
assumeTrue(OpenSsl.isSessionCacheSupported()); assumeTrue(OpenSsl.isSessionCacheSupported());
super.testSessionCache(param); super.testSessionCache(param);
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Override @Override
public void testSessionCacheTimeout(SSLEngineTestParam param) throws Exception { public void testSessionCacheTimeout(SSLEngineTestParam param) throws Exception {
assumeTrue(OpenSsl.isSessionCacheSupported()); assumeTrue(OpenSsl.isSessionCacheSupported());
super.testSessionCacheTimeout(param); super.testSessionCacheTimeout(param);
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Override @Override
public void testSessionCacheSize(SSLEngineTestParam param) throws Exception { public void testSessionCacheSize(SSLEngineTestParam param) throws Exception {
assumeTrue(OpenSsl.isSessionCacheSupported()); assumeTrue(OpenSsl.isSessionCacheSupported());

View File

@ -1397,12 +1397,16 @@ public class OpenSslEngineTest extends SSLEngineTest {
} }
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Override @Override
public void testSessionLocalWhenNonMutualWithKeyManager(SSLEngineTestParam param) throws Exception { public void testSessionLocalWhenNonMutualWithKeyManager(SSLEngineTestParam param) throws Exception {
checkShouldUseKeyManagerFactory(); checkShouldUseKeyManagerFactory();
super.testSessionLocalWhenNonMutualWithKeyManager(param); super.testSessionLocalWhenNonMutualWithKeyManager(param);
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Override @Override
public void testSessionLocalWhenNonMutualWithoutKeyManager(SSLEngineTestParam param) throws Exception { public void testSessionLocalWhenNonMutualWithoutKeyManager(SSLEngineTestParam param) throws Exception {
// This only really works when the KeyManagerFactory is supported as otherwise we not really know when // 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; return context;
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Override @Override
public void testSessionCache(SSLEngineTestParam param) throws Exception { public void testSessionCache(SSLEngineTestParam param) throws Exception {
assumeTrue(OpenSsl.isSessionCacheSupported()); assumeTrue(OpenSsl.isSessionCacheSupported());
@ -1522,12 +1528,16 @@ public class OpenSslEngineTest extends SSLEngineTest {
assertSessionContext(serverSslCtx); assertSessionContext(serverSslCtx);
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Override @Override
public void testSessionCacheTimeout(SSLEngineTestParam param) throws Exception { public void testSessionCacheTimeout(SSLEngineTestParam param) throws Exception {
assumeTrue(OpenSsl.isSessionCacheSupported()); assumeTrue(OpenSsl.isSessionCacheSupported());
super.testSessionCacheTimeout(param); super.testSessionCacheTimeout(param);
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Override @Override
public void testSessionCacheSize(SSLEngineTestParam param) throws Exception { public void testSessionCacheSize(SSLEngineTestParam param) throws Exception {
assumeTrue(OpenSsl.isSessionCacheSupported()); assumeTrue(OpenSsl.isSessionCacheSupported());

View File

@ -61,18 +61,24 @@ public class OpenSslJdkSslEngineInteroptTest extends SSLEngineTest {
return SslProvider.JDK; return SslProvider.JDK;
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Disabled /* Does the JDK support a "max certificate chain length"? */ @Disabled /* Does the JDK support a "max certificate chain length"? */
@Override @Override
public void testMutualAuthValidClientCertChainTooLongFailOptionalClientAuth(SSLEngineTestParam param) public void testMutualAuthValidClientCertChainTooLongFailOptionalClientAuth(SSLEngineTestParam param)
throws Exception { throws Exception {
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Disabled /* Does the JDK support a "max certificate chain length"? */ @Disabled /* Does the JDK support a "max certificate chain length"? */
@Override @Override
public void testMutualAuthValidClientCertChainTooLongFailRequireClientAuth(SSLEngineTestParam param) public void testMutualAuthValidClientCertChainTooLongFailRequireClientAuth(SSLEngineTestParam param)
throws Exception { throws Exception {
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Override @Override
public void testMutualAuthInvalidIntermediateCASucceedWithOptionalClientAuth(SSLEngineTestParam param) public void testMutualAuthInvalidIntermediateCASucceedWithOptionalClientAuth(SSLEngineTestParam param)
throws Exception { throws Exception {
@ -80,6 +86,8 @@ public class OpenSslJdkSslEngineInteroptTest extends SSLEngineTest {
super.testMutualAuthInvalidIntermediateCASucceedWithOptionalClientAuth(param); super.testMutualAuthInvalidIntermediateCASucceedWithOptionalClientAuth(param);
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Override @Override
public void testMutualAuthInvalidIntermediateCAFailWithOptionalClientAuth(SSLEngineTestParam param) public void testMutualAuthInvalidIntermediateCAFailWithOptionalClientAuth(SSLEngineTestParam param)
throws Exception { throws Exception {
@ -87,6 +95,8 @@ public class OpenSslJdkSslEngineInteroptTest extends SSLEngineTest {
super.testMutualAuthInvalidIntermediateCAFailWithOptionalClientAuth(param); super.testMutualAuthInvalidIntermediateCAFailWithOptionalClientAuth(param);
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Override @Override
public void testMutualAuthInvalidIntermediateCAFailWithRequiredClientAuth(SSLEngineTestParam param) public void testMutualAuthInvalidIntermediateCAFailWithRequiredClientAuth(SSLEngineTestParam param)
throws Exception { throws Exception {
@ -94,6 +104,8 @@ public class OpenSslJdkSslEngineInteroptTest extends SSLEngineTest {
super.testMutualAuthInvalidIntermediateCAFailWithRequiredClientAuth(param); super.testMutualAuthInvalidIntermediateCAFailWithRequiredClientAuth(param);
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Override @Override
public void testSessionAfterHandshakeKeyManagerFactoryMutualAuth(SSLEngineTestParam param) throws Exception { public void testSessionAfterHandshakeKeyManagerFactoryMutualAuth(SSLEngineTestParam param) throws Exception {
checkShouldUseKeyManagerFactory(); checkShouldUseKeyManagerFactory();
@ -106,24 +118,32 @@ public class OpenSslJdkSslEngineInteroptTest extends SSLEngineTest {
return super.mySetupMutualAuthServerIsValidServerException(cause) || causedBySSLException(cause); return super.mySetupMutualAuthServerIsValidServerException(cause) || causedBySSLException(cause);
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Override @Override
public void testHandshakeSession(SSLEngineTestParam param) throws Exception { public void testHandshakeSession(SSLEngineTestParam param) throws Exception {
checkShouldUseKeyManagerFactory(); checkShouldUseKeyManagerFactory();
super.testHandshakeSession(param); super.testHandshakeSession(param);
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Override @Override
public void testSupportedSignatureAlgorithms(SSLEngineTestParam param) throws Exception { public void testSupportedSignatureAlgorithms(SSLEngineTestParam param) throws Exception {
checkShouldUseKeyManagerFactory(); checkShouldUseKeyManagerFactory();
super.testSupportedSignatureAlgorithms(param); super.testSupportedSignatureAlgorithms(param);
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Override @Override
public void testSessionLocalWhenNonMutualWithKeyManager(SSLEngineTestParam param) throws Exception { public void testSessionLocalWhenNonMutualWithKeyManager(SSLEngineTestParam param) throws Exception {
checkShouldUseKeyManagerFactory(); checkShouldUseKeyManagerFactory();
super.testSessionLocalWhenNonMutualWithKeyManager(param); super.testSessionLocalWhenNonMutualWithKeyManager(param);
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Override @Override
public void testSessionLocalWhenNonMutualWithoutKeyManager(SSLEngineTestParam param) throws Exception { public void testSessionLocalWhenNonMutualWithoutKeyManager(SSLEngineTestParam param) throws Exception {
// This only really works when the KeyManagerFactory is supported as otherwise we not really know when // 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); super.testSessionLocalWhenNonMutualWithoutKeyManager(param);
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Override @Override
public void testSessionCache(SSLEngineTestParam param) throws Exception { public void testSessionCache(SSLEngineTestParam param) throws Exception {
assumeTrue(OpenSsl.isSessionCacheSupported()); assumeTrue(OpenSsl.isSessionCacheSupported());
super.testSessionCache(param); super.testSessionCache(param);
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Override @Override
public void testSessionCacheTimeout(SSLEngineTestParam param) throws Exception { public void testSessionCacheTimeout(SSLEngineTestParam param) throws Exception {
assumeTrue(OpenSsl.isSessionCacheSupported()); assumeTrue(OpenSsl.isSessionCacheSupported());
super.testSessionCacheTimeout(param); super.testSessionCacheTimeout(param);
} }
@MethodSource("newTestParams")
@ParameterizedTest
@Override @Override
public void testSessionCacheSize(SSLEngineTestParam param) throws Exception { public void testSessionCacheSize(SSLEngineTestParam param) throws Exception {
assumeTrue(OpenSsl.isSessionCacheSupported()); assumeTrue(OpenSsl.isSessionCacheSupported());