Skip to content
Permalink
Browse files
test: skip PKCS12KeyTest when enable_ssl_tests is not set
  • Loading branch information
vlsi committed Feb 12, 2020
1 parent 1e4f475 commit 6730f3febda64891ee445fd53a858ce0d9b56ac3
Showing 2 changed files with 7 additions and 1 deletion.
@@ -10,6 +10,7 @@
import org.postgresql.test.jdbc2.BaseTest4;

import org.junit.Assert;
import org.junit.Assume;
import org.junit.Before;
import org.junit.Test;

@@ -30,6 +31,11 @@ protected void updateProperties(Properties props) {
Properties prop = TestUtil.loadPropertyFiles("ssltest.properties");
props.put(TestUtil.DATABASE_PROP, "hostssldb");
PGProperty.SSL_MODE.set(props, "prefer");
String enableSslTests = prop.getProperty("enable_ssl_tests");
Assume.assumeTrue(
"Skipping the test as enable_ssl_tests is not set",
Boolean.parseBoolean(enableSslTests)
);

File certDirFile = TestUtil.getFile(prop.getProperty("certdir"));
String certdir = certDirFile.getAbsolutePath();
@@ -117,7 +117,7 @@ enum ClientRootCertificate {
public static Iterable<Object[]> data() {
Properties prop = TestUtil.loadPropertyFiles("ssltest.properties");
String enableSslTests = prop.getProperty("enable_ssl_tests");
if (!Boolean.valueOf(enableSslTests)) {
if (!Boolean.parseBoolean(enableSslTests)) {
System.out.println("enableSslTests is " + enableSslTests + ", skipping SSL tests");
return Collections.emptyList();
}

0 comments on commit 6730f3f

Please sign in to comment.