Skip to content

Commit

Permalink
test: skip PKCS12KeyTest when enable_ssl_tests is not set
Browse files Browse the repository at this point in the history
  • Loading branch information
vlsi committed Feb 12, 2020
1 parent 1e4f475 commit 6730f3f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion pgjdbc/src/test/java/org/postgresql/test/ssl/SslTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 6730f3f

Please sign in to comment.