use of org.apache.drill.test.ConfigBuilder in project drill by apache.
the class TestHttpProxy method testHttpsConfig.
@Test
public void testHttpsConfig() {
Config config = new ConfigBuilder().put(ExecConstants.HTTPS_PROXY_URL, "").put(ExecConstants.HTTPS_PROXY_TYPE, "socks").put(ExecConstants.HTTPS_PROXY_HOST, "foo.com").put(ExecConstants.HTTPS_PROXY_PORT, 1234).put(ExecConstants.HTTPS_PROXY_USER_NAME, "bob").put(ExecConstants.HTTPS_PROXY_PASSWORD, "secret").build();
HttpProxyConfig proxy = HttpProxyConfig.builder().fromHttpsConfig(config).build();
assertEquals(ProxyType.SOCKS, proxy.type);
assertEquals("foo.com", proxy.host);
assertEquals(1234, proxy.port);
assertEquals("bob", proxy.username);
assertEquals("secret", proxy.password);
}
use of org.apache.drill.test.ConfigBuilder in project drill by apache.
the class TestHttpProxy method testHttpConfig.
@Test
public void testHttpConfig() {
Config config = new ConfigBuilder().put(ExecConstants.HTTP_PROXY_URL, "http://bob:secret@foo.com:1234").build();
HttpProxyConfig proxy = HttpProxyConfig.builder().fromHttpConfig(config).build();
assertEquals(ProxyType.HTTP, proxy.type);
assertEquals("foo.com", proxy.host);
assertEquals(1234, proxy.port);
assertEquals("bob", proxy.username);
assertEquals("secret", proxy.password);
}
use of org.apache.drill.test.ConfigBuilder in project drill by apache.
the class TestHttpProxy method testEnvVar.
// To run this test, set two env vars in your run/debug
// configuration, then comment out the @Ignore:
// http_proxy=http://bob:secret@foo.com:1234
// https_proxy=http://alice:s3cr3t@bar.com:2345
@Test
@Ignore("Requires manual setup")
public void testEnvVar() {
Config config = new ConfigBuilder().build();
doTestConfigForUrl(config);
}
Aggregations