Search in sources :

Example 11 with PreparedStatementKey

use of com.alibaba.druid.pool.DruidPooledPreparedStatement.PreparedStatementKey in project druid by alibaba.

the class PreparedStatementKeyTest method test_equals_6.

public void test_equals_6() throws Exception {
    PreparedStatementKey k1 = new PreparedStatementKey("x1", null, MethodType.M1);
    PreparedStatementKey k2 = new PreparedStatementKey("x2", null, MethodType.M1);
    PreparedStatementKey k3 = new PreparedStatementKey("x3", null, MethodType.M1);
    k1.hashCode();
    Assert.assertFalse(k1.equals(k2));
    Assert.assertFalse(k1.equals(k3));
    Assert.assertFalse(k2.equals(k1));
    Assert.assertFalse(k2.equals(k3));
    Assert.assertFalse(k3.equals(k2));
    Assert.assertFalse(k3.equals(k1));
}
Also used : PreparedStatementKey(com.alibaba.druid.pool.DruidPooledPreparedStatement.PreparedStatementKey)

Example 12 with PreparedStatementKey

use of com.alibaba.druid.pool.DruidPooledPreparedStatement.PreparedStatementKey in project druid by alibaba.

the class PreparedStatementKeyTest method test_equals_8.

public void test_equals_8() throws Exception {
    PreparedStatementKey k1 = new PreparedStatementKey("x1", null, MethodType.M1, 0, 0, 0);
    PreparedStatementKey k2 = new PreparedStatementKey("x1", null, MethodType.M1, 0, 0, 1);
    PreparedStatementKey k3 = new PreparedStatementKey("x2", null, MethodType.M1, 0, 1, 0);
    k1.hashCode();
    Assert.assertFalse(k1.equals(k2));
    Assert.assertFalse(k1.equals(k3));
    Assert.assertFalse(k2.equals(k1));
    Assert.assertFalse(k2.equals(k3));
    Assert.assertFalse(k3.equals(k2));
    Assert.assertFalse(k3.equals(k1));
}
Also used : PreparedStatementKey(com.alibaba.druid.pool.DruidPooledPreparedStatement.PreparedStatementKey)

Example 13 with PreparedStatementKey

use of com.alibaba.druid.pool.DruidPooledPreparedStatement.PreparedStatementKey in project druid by alibaba.

the class PreparedStatementKeyTest method test_equals_3.

public void test_equals_3() throws Exception {
    PreparedStatementKey k1 = new PreparedStatementKey("x1", "c1", MethodType.M1);
    PreparedStatementKey k2 = new PreparedStatementKey("x1", "c1", MethodType.M2);
    PreparedStatementKey k3 = new PreparedStatementKey("x1", "c1", MethodType.M3);
    Assert.assertFalse(k1.equals(k2));
    Assert.assertFalse(k1.equals(k3));
    Assert.assertFalse(k2.equals(k1));
    Assert.assertFalse(k2.equals(k3));
    Assert.assertFalse(k3.equals(k2));
    Assert.assertFalse(k3.equals(k1));
}
Also used : PreparedStatementKey(com.alibaba.druid.pool.DruidPooledPreparedStatement.PreparedStatementKey)

Example 14 with PreparedStatementKey

use of com.alibaba.druid.pool.DruidPooledPreparedStatement.PreparedStatementKey in project druid by alibaba.

the class PreparedStatementKeyTest method test_equals_4.

public void test_equals_4() throws Exception {
    PreparedStatementKey k1 = new PreparedStatementKey("x1", "c1", MethodType.M1);
    PreparedStatementKey k2 = new PreparedStatementKey("x1", "c2", MethodType.M1);
    PreparedStatementKey k3 = new PreparedStatementKey("x1", null, MethodType.M1);
    Assert.assertFalse(k1.equals(k2));
    Assert.assertFalse(k1.equals(k3));
    Assert.assertFalse(k2.equals(k1));
    Assert.assertFalse(k2.equals(k3));
    Assert.assertFalse(k3.equals(k2));
    Assert.assertFalse(k3.equals(k1));
}
Also used : PreparedStatementKey(com.alibaba.druid.pool.DruidPooledPreparedStatement.PreparedStatementKey)

Example 15 with PreparedStatementKey

use of com.alibaba.druid.pool.DruidPooledPreparedStatement.PreparedStatementKey in project druid by alibaba.

the class PreparedStatementKeyTest method test_equals_9.

public void test_equals_9() throws Exception {
    PreparedStatementKey k1 = new PreparedStatementKey("x1", null, MethodType.M1, 2);
    PreparedStatementKey k2 = new PreparedStatementKey("x1", null, MethodType.M1, new int[] {});
    PreparedStatementKey k3 = new PreparedStatementKey("x2", null, MethodType.M1, new String[] {});
    k1.hashCode();
    Assert.assertFalse(k1.equals(k2));
    Assert.assertFalse(k1.equals(k3));
    Assert.assertFalse(k2.equals(k1));
    Assert.assertFalse(k2.equals(k3));
    Assert.assertFalse(k3.equals(k2));
    Assert.assertFalse(k3.equals(k1));
}
Also used : PreparedStatementKey(com.alibaba.druid.pool.DruidPooledPreparedStatement.PreparedStatementKey)

Aggregations

PreparedStatementKey (com.alibaba.druid.pool.DruidPooledPreparedStatement.PreparedStatementKey)19 SQLException (java.sql.SQLException)8 MockConnection (com.alibaba.druid.mock.MockConnection)3 DruidConnectionHolder (com.alibaba.druid.pool.DruidConnectionHolder)3 PreparedStatementHolder (com.alibaba.druid.pool.PreparedStatementHolder)3 MockPreparedStatement (com.alibaba.druid.mock.MockPreparedStatement)2 DruidDataSource (com.alibaba.druid.pool.DruidDataSource)2 DruidPooledConnection (com.alibaba.druid.pool.DruidPooledConnection)2 MockCallableStatement (com.alibaba.druid.mock.MockCallableStatement)1 DruidPooledCallableStatement (com.alibaba.druid.pool.DruidPooledCallableStatement)1 DruidPooledPreparedStatement (com.alibaba.druid.pool.DruidPooledPreparedStatement)1 PreparedStatementPool (com.alibaba.druid.pool.PreparedStatementPool)1