@Test public void testSetProperty() { assertThat( provider.getProperty( PROP_KEY ), is( nullValue() ) ); assertThat( provider.getPropertyNames(), is( emptyArray() ) ); provider.setProperty( PROP_KEY, PROP_VALUE ); assertThat( provider.getProperty( PROP_KEY ), is( equalTo( PROP_VALUE ) ) ); assertThat( provider.getPropertyNames(), is( arrayContaining( PROP_KEY ) ) ); provider.setProperty( PROP_KEY, null ); assertThat( provider.getProperty( PROP_KEY ), is( nullValue() ) ); assertThat( provider.getPropertyNames(), is( emptyArray() ) ); }
public Object setProperty( final String key, final String value ) { if ( value == null ) { return properties.remove( key ); } else { return properties.setProperty( key, value ); } }
DriverConnectionProvider implements ConnectionProvider { public Object setProperty( final String key, final String value ) { if ( value == null ) { return properties.remove( key ); } else { return properties.setProperty( key, value ); } } }
DriverConnectionProvider implements ConnectionProvider { public Object setProperty( final String key, final String value ) { if ( value == null ) { return properties.remove( key ); } else { return properties.setProperty( key, value ); } } DriverConnectionProvider(); }
DriverConnectionProvider implements ConnectionProvider { public Object setProperty( final String key, final String value ) { if ( value == null ) { return properties.remove( key ); } else { return properties.setProperty( key, value ); } } 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 setProperty( final String key, final String value ) { if ( value == null ) { return properties.remove( key ); } else { return properties.setProperty( key, value ); } } 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();  }