@Test public void testEquals() throws Exception { JdbcPooledConnectionImpl con = createConnection(); String url = "jdbc:derby:memory:" + GUID.safeUUID() + ";create=true"; con.setConnectUrl(url); assertTrue(con.equals(con)); assertFalse(con.equals(null)); assertFalse(con.equals(new Object())); JdbcPooledConnectionImpl con2 = createConnection(); con2.setConnectUrl(url); assertTrue(con.equals(con2)); }
@Override public boolean equals(Object ajpc) { if (ajpc == null) return false; if (ajpc == this) return true; if (ajpc instanceof AdvancedJdbcPooledConnection) { AdvancedJdbcPooledConnection conn = (AdvancedJdbcPooledConnection) ajpc; return new EqualsBuilder() .append(conn.getConnectUrl(), this.getConnectUrl()) .append(conn.getDriverImp(), this.getDriverImp()) .append(conn.getAlwaysValidateConnection(), this.getAlwaysValidateConnection()) .append(conn.getDebugMode(), this.getDebugMode()) .append(conn.getTestStatement(), this.getTestStatement()) .append(conn.getAutoCommit(), this.getAutoCommit()) .append(conn.getConnectionProperties(), this.getConnectionProperties()) .append(conn.getConnectionPoolProperties(), this.getConnectionPoolProperties()) .isEquals(); } return false; }
AdvancedJdbcPooledConnection extends JdbcPooledConnectionImpl { @Override public boolean equals(Object ajpc) { if (ajpc == null) return false; if (ajpc == this) return true; if (ajpc instanceof AdvancedJdbcPooledConnection) { AdvancedJdbcPooledConnection conn = (AdvancedJdbcPooledConnection) ajpc; return new EqualsBuilder() .append(conn.getConnectUrl(), this.getConnectUrl()) .append(conn.getDriverImp(), this.getDriverImp()) .append(conn.getAlwaysValidateConnection(), this.getAlwaysValidateConnection()) .append(conn.getDebugMode(), this.getDebugMode()) .append(conn.getTestStatement(), this.getTestStatement()) .append(conn.getAutoCommit(), this.getAutoCommit()) .append(conn.getConnectionProperties(), this.getConnectionProperties()) .append(conn.getConnectionPoolProperties(), this.getConnectionPoolProperties()) .isEquals(); } return false; } }
AdvancedJdbcPooledConnection extends JdbcPooledConnectionImpl { @Override public boolean equals(Object ajpc) { if (ajpc == null) return false; if (ajpc == this) return true; if (ajpc instanceof AdvancedJdbcPooledConnection) { AdvancedJdbcPooledConnection conn = (AdvancedJdbcPooledConnection) ajpc; return new EqualsBuilder() .append(conn.getConnectUrl(), this.getConnectUrl()) .append(conn.getDriverImp(), this.getDriverImp()) .append(conn.getAlwaysValidateConnection(), this.getAlwaysValidateConnection()) .append(conn.getDebugMode(), this.getDebugMode()) .append(conn.getTestStatement(), this.getTestStatement()) .append(conn.getAutoCommit(), this.getAutoCommit()) .append(conn.getConnectionProperties(), this.getConnectionProperties()) .append(conn.getConnectionPoolProperties(), this.getConnectionPoolProperties()) .isEquals(); } return false; } AdvancedJdbcPooledConnection(); }
AdvancedJdbcPooledConnection extends JdbcPooledConnectionImpl { @Override public boolean equals(Object ajpc) { if (ajpc == null) return false; if (ajpc == this) return true; if (ajpc instanceof AdvancedJdbcPooledConnection) { AdvancedJdbcPooledConnection conn = (AdvancedJdbcPooledConnection) ajpc; return new EqualsBuilder() .append(conn.getConnectUrl(), this.getConnectUrl()) .append(conn.getDriverImp(), this.getDriverImp()) .append(conn.getAlwaysValidateConnection(), this.getAlwaysValidateConnection()) .append(conn.getDebugMode(), this.getDebugMode()) .append(conn.getTestStatement(), this.getTestStatement()) .append(conn.getAutoCommit(), this.getAutoCommit()) .append(conn.getConnectionProperties(), this.getConnectionProperties()) .append(conn.getConnectionPoolProperties(), this.getConnectionPoolProperties()) .isEquals(); } return false; } AdvancedJdbcPooledConnection(); @Override boolean equals(Object ajpc); @Override int hashCode(); KeyValuePairSet getConnectionPoolProperties(); void setConnectionPoolProperties(KeyValuePairSet kvps); int currentBusyConnectionCount(); int currentConnectionCount(); int currentIdleConnectionCount(); }
AdvancedJdbcPooledConnection extends JdbcPooledConnectionImpl { @Override public boolean equals(Object ajpc) { if (ajpc == null) return false; if (ajpc == this) return true; if (ajpc instanceof AdvancedJdbcPooledConnection) { AdvancedJdbcPooledConnection conn = (AdvancedJdbcPooledConnection) ajpc; return new EqualsBuilder() .append(conn.getConnectUrl(), this.getConnectUrl()) .append(conn.getDriverImp(), this.getDriverImp()) .append(conn.getAlwaysValidateConnection(), this.getAlwaysValidateConnection()) .append(conn.getDebugMode(), this.getDebugMode()) .append(conn.getTestStatement(), this.getTestStatement()) .append(conn.getAutoCommit(), this.getAutoCommit()) .append(conn.getConnectionProperties(), this.getConnectionProperties()) .append(conn.getConnectionPoolProperties(), this.getConnectionPoolProperties()) .isEquals(); } return false; } AdvancedJdbcPooledConnection(); @Override boolean equals(Object ajpc); @Override int hashCode(); KeyValuePairSet getConnectionPoolProperties(); void setConnectionPoolProperties(KeyValuePairSet kvps); int currentBusyConnectionCount(); int currentConnectionCount(); int currentIdleConnectionCount();  }