Only run PemEncodedTest if OpenSsl.useKeyManagerFactory() returns false.

Motivation:

Commit b963595988 added a unit that will not work when KeyManagerFactory is used.

Modifications:

Only run the test if OpenSsl.useKeyManagerFactory() returns false.

Result:

Builds with boringssl
This commit is contained in:
Norman Maurer 2016-08-16 13:42:09 +02:00
parent fa6b0e262e
commit fb3dc84e5b

View File

@ -18,6 +18,7 @@ package io.netty.handler.ssl;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeFalse;
import static org.junit.Assume.assumeTrue; import static org.junit.Assume.assumeTrue;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
@ -43,6 +44,7 @@ public class PemEncodedTest {
private static void testPemEncoded(SslProvider provider) throws Exception { private static void testPemEncoded(SslProvider provider) throws Exception {
assumeTrue(OpenSsl.isAvailable()); assumeTrue(OpenSsl.isAvailable());
assumeFalse(OpenSsl.useKeyManagerFactory());
PemPrivateKey pemKey; PemPrivateKey pemKey;
PemX509Certificate pemCert; PemX509Certificate pemCert;
SelfSignedCertificate ssc = new SelfSignedCertificate(); SelfSignedCertificate ssc = new SelfSignedCertificate();
@ -70,6 +72,7 @@ public class PemEncodedTest {
private static void assertRelease(PemEncoded encoded) { private static void assertRelease(PemEncoded encoded) {
assertTrue(encoded.release()); assertTrue(encoded.release());
} }
private static byte[] toByteArray(File file) throws Exception { private static byte[] toByteArray(File file) throws Exception {
FileInputStream in = new FileInputStream(file); FileInputStream in = new FileInputStream(file);
try { try {