Code example for Proxy

Methods: address, toString, type

0
		// include type String 
		assertTrue(proxy.toString().indexOf(proxy.type().toString()) != -1);
		// include address String 
		assertTrue(proxy.toString().indexOf(proxy.address().toString()) != -1);
 
		proxy = new Proxy(Proxy.Type.SOCKS, address);
		// include type String 
		assertTrue(proxy.toString().indexOf(proxy.type().toString()) != -1);
		// include address String 
		assertTrue(proxy.toString().indexOf(proxy.address().toString()) != -1);
 
		proxy = Proxy.NO_PROXY;
		// include type String 
		assertTrue(proxy.toString().indexOf(proxy.type().toString()) != -1);
 
		proxy = new Proxy(null, address);
		// ensure no NPE is thrown 
		proxy.toString();
 
		// Regression test for Java 6 spec change 
		proxy = new Proxy(Proxy.Type.HTTP, address);