Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Update testcase to set properties where TestUtil methods look them up.
- Loading branch information
|
@@ -58,6 +58,11 @@ public static String getURL(String server, int port) |
|
|
sendBufferSize = "&sendBufferSize="+getSendBufferSize(); |
|
|
} |
|
|
|
|
|
String ssl = ""; |
|
|
if (getSSL() != null ){ |
|
|
ssl = "&ssl="+getSSL(); |
|
|
} |
|
|
|
|
|
return "jdbc:postgresql://" |
|
|
+ server + ":" |
|
|
+ port + "/" |
|
@@ -66,7 +71,8 @@ public static String getURL(String server, int port) |
|
|
+ protocolVersion |
|
|
+ binaryTransfer |
|
|
+ receiveBufferSize |
|
|
+ sendBufferSize; |
|
|
+ sendBufferSize |
|
|
+ ssl; |
|
|
} |
|
|
|
|
|
/* |
|
@@ -161,6 +167,11 @@ public static int getReceiveBufferSize() |
|
|
return Integer.parseInt(System.getProperty("receiveBufferSize","-1")); |
|
|
} |
|
|
|
|
|
public static String getSSL() |
|
|
{ |
|
|
return System.getProperty("ssl"); |
|
|
} |
|
|
|
|
|
private static boolean initialized = false; |
|
|
public static void initDriver() throws Exception |
|
|
{ |
|
|
|
@@ -204,9 +204,11 @@ public void testIsPresentWithParseURLResult() throws Exception |
|
|
givenProperties.setProperty("user", TestUtil.getUser()); |
|
|
givenProperties.setProperty("password", TestUtil.getPassword()); |
|
|
|
|
|
System.setProperty("ssl", null); |
|
|
Properties parsedProperties = Driver.parseURL(TestUtil.getURL(), givenProperties); |
|
|
Assert.assertFalse("SSL property should not be present", PGProperty.SSL.isPresent(parsedProperties)); |
|
|
Assert.assertTrue("SSL property should not be present", PGProperty.SSL.isPresent(parsedProperties)); |
|
|
|
|
|
System.setProperty("ssl", "true"); |
|
|
givenProperties.setProperty("ssl", "true"); |
|
|
parsedProperties = Driver.parseURL(TestUtil.getURL(), givenProperties); |
|
|
Assert.assertTrue("SSL property should be present", PGProperty.SSL.isPresent(parsedProperties)); |
|
|