1 package org.apache.commons.httpclient; 2 3 import junit.framework.Test; 4 import junit.framework.TestCase; 5 import junit.framework.TestSuite; 6 7 import org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory; 8 import org.apache.commons.httpclient.protocol.Protocol; 9 import org.apache.commons.httpclient.protocol.ProtocolSocketFactory; 10 import org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory; 11 12 /*** 13 */ 14 public class TestEquals extends TestCase { 15 16 public static Test suite() { 17 return new TestSuite(TestEquals.class); 18 } 19 20 /*** 21 * 22 */ 23 public TestEquals() { 24 super(); 25 } 26 27 /*** 28 * @param arg0 29 */ 30 public TestEquals(String arg0) { 31 super(arg0); 32 } 33 34 public void testProtocol() { 35 36 Protocol p1 = new Protocol("test", new DefaultProtocolSocketFactory(), 123); 37 Protocol p2 = new Protocol("test", new DefaultProtocolSocketFactory(), 123); 38 39 assertTrue(p1.equals(p2)); 40 assertTrue(p2.equals(p1)); 41 } 42 43 public void testProtocolSocketFactory() { 44 45 ProtocolSocketFactory p1 = new DefaultProtocolSocketFactory(); 46 ProtocolSocketFactory p2 = new DefaultProtocolSocketFactory(); 47 48 assertTrue(p1.equals(p2)); 49 assertTrue(p2.equals(p1)); 50 51 p1 = new SSLProtocolSocketFactory(); 52 p2 = new SSLProtocolSocketFactory(); 53 54 assertTrue(p1.equals(p2)); 55 assertTrue(p2.equals(p1)); 56 57 } 58 59 public void testHostConfiguration() { 60 61 HostConfiguration hc1 = new HostConfiguration(); 62 hc1.setHost("http", 80, "http"); 63 64 HostConfiguration hc2 = new HostConfiguration(); 65 hc2.setHost("http", 80, "http"); 66 67 assertTrue(hc1.equals(hc2)); 68 assertTrue(hc2.equals(hc1)); 69 } 70 71 }

This page was automatically generated by Maven