Skip to content

Commit

Permalink
fix proxy test and postgres_user for docker (Fixes #51)
Browse files Browse the repository at this point in the history
  • Loading branch information
serenaponta committed Nov 16, 2018
1 parent f5f3a46 commit 5224c31
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ installed_on timestamp without time zone DEFAULT now() NOT NULL,
execution_time integer NOT NULL,
success boolean NOT NULL
);
ALTER TABLE schema_version OWNER TO postgres;
ALTER TABLE schema_version OWNER TO ${POSTGRES_USER};
INSERT INTO schema_version VALUES (1, '20161206.1800', 'Base version', 'BASELINE', 'Base version', NULL, 'postgres', '2016-12-06 18:00:00.000000', 0, true);
EOSQL_B
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,26 @@
public class ConnectionUtilTest {

@Test
public void testsBuildMaps() {
public void testGetProxy() {

RequestConfig g = ConnectionUtil.getProxyConfig();
assertEquals(g,null);
String host = System.getProperty("http.proxyHost");
String port = System.getProperty("http.proxyPort");

System.setProperty("http.proxyPort", "");
g = ConnectionUtil.getProxyConfig();
assertEquals(g,null);
RequestConfig g = ConnectionUtil.getProxyConfig();

System.setProperty("http.proxyHost", "proxy");
System.setProperty("http.proxyPort", "80");
g = ConnectionUtil.getProxyConfig();
assertEquals(g.getProxy().toString(), "http://proxy:80");

System.setProperty("http.proxyPort", "");
g = ConnectionUtil.getProxyConfig();
assertEquals(g,null);
//System.out.println(g.getProxy());

if(host!=null)
System.setProperty("http.proxyHost", host);
if(port!=null)
System.setProperty("http.proxyPort", port);
}
}

0 comments on commit 5224c31

Please sign in to comment.