@SuppressWarnings( "unchecked" ) @Test public void testGetConnectionHash() { provider.setDriver( "test_driver" ); provider.setUrl( "test_url" ); provider.setProperty( PROP_KEY, PROP_VALUE ); Object result = provider.getConnectionHash(); assertThat( result, is( instanceOf( List.class ) ) ); List<Object> list = (List<Object>) result; assertThat( list.size(), is( equalTo( 4 ) ) ); assertThat( (String) list.get( 0 ), is( equalTo( provider.getClass().getName() ) ) ); assertThat( list.get( 1 ), is( instanceOf( Properties.class ) ) ); assertThat( (String) list.get( 2 ), is( equalTo( "test_url" ) ) ); assertThat( (String) list.get( 3 ), is( equalTo( "test_driver" ) ) ); }
public Object getConnectionHash() { final ArrayList<Object> list = new ArrayList<Object>(); list.add( getClass().getName() ); list.add( properties.clone() ); list.add( url ); list.add( driver ); return list; }
DriverConnectionProvider implements ConnectionProvider { public Object getConnectionHash() { final ArrayList<Object> list = new ArrayList<Object>(); list.add( getClass().getName() ); list.add( properties.clone() ); list.add( url ); list.add( driver ); return list; } }
DriverConnectionProvider implements ConnectionProvider { public Object getConnectionHash() { final ArrayList<Object> list = new ArrayList<Object>(); list.add( getClass().getName() ); list.add( properties.clone() ); list.add( url ); list.add( driver ); return list; } DriverConnectionProvider(); }
DriverConnectionProvider implements ConnectionProvider { public Object getConnectionHash() { final ArrayList<Object> list = new ArrayList<Object>(); list.add( getClass().getName() ); list.add( properties.clone() ); list.add( url ); list.add( driver ); return list; } 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 Object getConnectionHash() { final ArrayList<Object> list = new ArrayList<Object>(); list.add( getClass().getName() ); list.add( properties.clone() ); list.add( url ); list.add( driver ); return list; } 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();  }