1 32 package net.sf.retrotranslator.runtime.java.net; 33 34 import java.net.*; 35 import junit.framework.TestCase; 36 37 40 public class Proxy_TestCase extends TestCase { 41 42 public void test() throws Exception { 43 Proxy.Type type = Proxy.Type.HTTP; 44 assertNotSame(Proxy.Type.DIRECT, type); 45 assertNotSame(Proxy.Type.SOCKS, type); 46 InetSocketAddress address = new InetSocketAddress("localhost", 80); 47 Proxy proxy = new Proxy(type, address); 48 assertSame(type, proxy.type()); 49 assertEquals(address, proxy.address()); 50 assertEquals(type + " @ " + address, proxy.toString()); 51 assertEquals(proxy.hashCode(), new Proxy(type, address).hashCode()); 52 } 53 54 } | Popular Tags |