| Method from org.apache.commons.dbcp.TestDelegatingConnection Detail: |
public void setUp() throws Exception {
delegateConn = new TesterConnection("test", "test");
delegateConn2 = new TesterConnection("test", "test");
conn = new DelegatingConnection(delegateConn);
}
|
public static Test suite() {
return new TestSuite(TestDelegatingConnection.class);
}
|
public void testEquals() {
DelegatingConnection conn = new DelegatingConnection(delegateConn);
DelegatingConnection conn2 = new DelegatingConnection(delegateConn);
DelegatingConnection conn3 = new DelegatingConnection(null);
assertTrue(!conn.equals(null));
assertTrue(conn.equals(conn2));
assertTrue(!conn.equals(conn3));
}
|
public void testGetDelegate() throws Exception {
assertEquals(delegateConn,conn.getDelegate());
}
|
public void testHashCodeEqual() {
DelegatingConnection conn = new DelegatingConnection(delegateConn);
DelegatingConnection conn2 = new DelegatingConnection(delegateConn);
assertEquals(conn.hashCode(), conn2.hashCode());
}
|
public void testHashCodeNotEqual() {
DelegatingConnection conn = new DelegatingConnection(delegateConn);
DelegatingConnection conn2 = new DelegatingConnection(delegateConn2);
assertTrue(conn.hashCode() != conn2.hashCode());
}
|