Code example for Proxy

Methods: address

0
public class OldProxyTest extends TestCase {
 
    private SocketAddress address = new InetSocketAddress("127.0.0.1", 1234);
 
    public void test_address() { 
        Proxy proxy = new Proxy(Proxy.Type.SOCKS, address);
        assertEquals(address, proxy.address());
 
        try { 
            new Proxy(Proxy.Type.SOCKS, null);
            fail("IllegalArgumentException was thrown.");
        } catch(IllegalArgumentException iae) {
            //expected 
        } 
    } 
 
    public void test_hashCode() { 
        SocketAddress address1 = new InetSocketAddress("127.0.0.1", 1234);
 
        Proxy proxy1 = new Proxy(Proxy.Type.HTTP, address1);
        Proxy proxy2 = new Proxy(Proxy.Type.HTTP, address1);