@Test public void testEquals() { assertThat( provider.equals( provider ), is( equalTo( true ) ) ); assertThat( provider.equals( null ), is( equalTo( false ) ) ); assertThat( provider.equals( "incorrect" ), is( equalTo( false ) ) ); DriverConnectionProvider newProvider = new DriverConnectionProvider(); provider.setProperty( PROP_KEY, PROP_VALUE ); assertThat( provider.equals( newProvider ), is( equalTo( false ) ) ); newProvider.setProperty( PROP_KEY, PROP_VALUE ); assertThat( provider.equals( newProvider ), is( equalTo( true ) ) ); provider.setDriver( "test_driver" ); assertThat( provider.equals( newProvider ), is( equalTo( false ) ) ); newProvider.setDriver( "test_driver_0" ); assertThat( provider.equals( newProvider ), is( equalTo( false ) ) ); newProvider.setDriver( "test_driver" ); assertThat( provider.equals( newProvider ), is( equalTo( true ) ) ); provider.setDriver( null ); assertThat( provider.equals( newProvider ), is( equalTo( false ) ) ); newProvider.setDriver( null ); assertThat( provider.equals( newProvider ), is( equalTo( true ) ) ); provider.setUrl( "test_url" ); assertThat( provider.equals( newProvider ), is( equalTo( false ) ) ); newProvider.setUrl( "test_url_0" ); assertThat( provider.equals( newProvider ), is( equalTo( false ) ) ); newProvider.setUrl( "test_url" ); assertThat( provider.equals( newProvider ), is( equalTo( true ) ) ); provider.setUrl( null ); assertThat( provider.equals( newProvider ), is( equalTo( false ) ) ); newProvider.setUrl( null ); assertThat( provider.equals( newProvider ), is( equalTo( true ) ) ); }
public boolean equals( final Object o ) { if ( this == o ) { return true; } if ( o == null || getClass() != o.getClass() ) { return false; } final DriverConnectionProvider that = (DriverConnectionProvider) o; if ( driver != null ? !driver.equals( that.driver ) : that.driver != null ) { return false; } if ( !properties.equals( that.properties ) ) { return false; } if ( url != null ? !url.equals( that.url ) : that.url != null ) { return false; } return true; }
DriverConnectionProvider implements ConnectionProvider { public boolean equals( final Object o ) { if ( this == o ) { return true; } if ( o == null || getClass() != o.getClass() ) { return false; } final DriverConnectionProvider that = (DriverConnectionProvider) o; if ( driver != null ? !driver.equals( that.driver ) : that.driver != null ) { return false; } if ( !properties.equals( that.properties ) ) { return false; } if ( url != null ? !url.equals( that.url ) : that.url != null ) { return false; } return true; } }
DriverConnectionProvider implements ConnectionProvider { public boolean equals( final Object o ) { if ( this == o ) { return true; } if ( o == null || getClass() != o.getClass() ) { return false; } final DriverConnectionProvider that = (DriverConnectionProvider) o; if ( driver != null ? !driver.equals( that.driver ) : that.driver != null ) { return false; } if ( !properties.equals( that.properties ) ) { return false; } if ( url != null ? !url.equals( that.url ) : that.url != null ) { return false; } return true; } DriverConnectionProvider(); }
DriverConnectionProvider implements ConnectionProvider { public boolean equals( final Object o ) { if ( this == o ) { return true; } if ( o == null || getClass() != o.getClass() ) { return false; } final DriverConnectionProvider that = (DriverConnectionProvider) o; if ( driver != null ? !driver.equals( that.driver ) : that.driver != null ) { return false; } if ( !properties.equals( that.properties ) ) { return false; } if ( url != null ? !url.equals( that.url ) : that.url != null ) { return false; } return true; } DriverConnectionProvider(); String getProperty( final String key ); Object setProperty( final String key, final String value ); String getUrl(); void setUrl( final String url ); String getDriver(); void setDriver( final String driver ); Connection createConnection( final String user, final String password ); Object getConnectionHash(); String[] getPropertyNames(); boolean equals( final Object o ); int hashCode(); }
DriverConnectionProvider implements ConnectionProvider { public boolean equals( final Object o ) { if ( this == o ) { return true; } if ( o == null || getClass() != o.getClass() ) { return false; } final DriverConnectionProvider that = (DriverConnectionProvider) o; if ( driver != null ? !driver.equals( that.driver ) : that.driver != null ) { return false; } if ( !properties.equals( that.properties ) ) { return false; } if ( url != null ? !url.equals( that.url ) : that.url != null ) { return false; } return true; } DriverConnectionProvider(); String getProperty( final String key ); Object setProperty( final String key, final String value ); String getUrl(); void setUrl( final String url ); String getDriver(); void setDriver( final String driver ); Connection createConnection( final String user, final String password ); Object getConnectionHash(); String[] getPropertyNames(); boolean equals( final Object o ); int hashCode();  }