@SuppressWarnings( "unchecked" ) @Test public void testGetConnectionHash() { Connection connection = mock( Connection.class ); StaticConnectionProvider provider = new StaticConnectionProvider( connection ); Object result = provider.getConnectionHash(); assertThat( result, is( instanceOf( List.class ) ) ); List<Object> list = (List<Object>) result; assertThat( list.size(), is( equalTo( 3 ) ) ); assertThat( (String) list.get( 0 ), is( equalTo( "org.pentaho.reporting.engine.classic.core.modules.misc.datafactory.sql.StaticConnectionProvider" ) ) ); assertThat( (Integer) list.get( 1 ), is( equalTo( connection.hashCode() ) ) ); assertThat( (String) list.get( 2 ), is( equalTo( connection.toString() ) ) ); }
public Object getConnectionHash() { final ArrayList<Object> list = new ArrayList<Object>(); list.add( getClass().getName() ); list.add( System.identityHashCode( connection ) ); list.add( String.valueOf( connection ) ); return list; }
StaticConnectionProvider implements ConnectionProvider { public Object getConnectionHash() { final ArrayList<Object> list = new ArrayList<Object>(); list.add( getClass().getName() ); list.add( System.identityHashCode( connection ) ); list.add( String.valueOf( connection ) ); return list; } }
StaticConnectionProvider implements ConnectionProvider { public Object getConnectionHash() { final ArrayList<Object> list = new ArrayList<Object>(); list.add( getClass().getName() ); list.add( System.identityHashCode( connection ) ); list.add( String.valueOf( connection ) ); return list; } StaticConnectionProvider( final Connection connection ); }
StaticConnectionProvider implements ConnectionProvider { public Object getConnectionHash() { final ArrayList<Object> list = new ArrayList<Object>(); list.add( getClass().getName() ); list.add( System.identityHashCode( connection ) ); list.add( String.valueOf( connection ) ); return list; } StaticConnectionProvider( final Connection connection ); Connection createConnection( final String user, final String password ); Object getConnectionHash(); }
StaticConnectionProvider implements ConnectionProvider { public Object getConnectionHash() { final ArrayList<Object> list = new ArrayList<Object>(); list.add( getClass().getName() ); list.add( System.identityHashCode( connection ) ); list.add( String.valueOf( connection ) ); return list; } StaticConnectionProvider( final Connection connection ); Connection createConnection( final String user, final String password ); Object getConnectionHash();  }