use of org.apache.hadoop.net.SocksSocketFactory in project hadoop by apache.
the class TestSocketFactory method testSocksSocketFactory.
/**
* Test SocksSocketFactory.
*/
@Test(timeout = 5000)
public void testSocksSocketFactory() throws Exception {
startTestServer();
testSocketFactory(new SocksSocketFactory());
}
use of org.apache.hadoop.net.SocksSocketFactory in project hadoop by apache.
the class TestSocketFactory method testProxy.
/**
* test proxy methods
*/
@Test(timeout = 5000)
public void testProxy() throws Exception {
SocksSocketFactory templateWithoutProxy = new SocksSocketFactory();
Proxy proxy = new Proxy(Type.SOCKS, InetSocketAddress.createUnresolved("localhost", 0));
SocksSocketFactory templateWithProxy = new SocksSocketFactory(proxy);
assertFalse(templateWithoutProxy.equals(templateWithProxy));
Configuration configuration = new Configuration();
configuration.set("hadoop.socks.server", "localhost:0");
templateWithoutProxy.setConf(configuration);
assertTrue(templateWithoutProxy.equals(templateWithProxy));
}
Aggregations