core/src/test/java/org/apache/hop/core/database/DatabaseTest.java
@Test
  public void testGetLookupCallPSpassed() throws SQLException, HopDatabaseException {
    when( ps.executeQuery() ).thenReturn( rs );
    when( rs.getMetaData() ).thenReturn( rsMetaData );
    when( rsMetaData.getColumnCount() ).thenReturn( 0 );
    when( ps.getMetaData() ).thenReturn( rsMetaData );

    Database db = new Database( log, variables, meta );
    db.getLookup( ps );
    verify( rsMetaData, times( 1 ) ).getColumnCount();
  }
/**
   * Test that for every PreparedStatement passed into lookup signature we do reset and re-create row meta.
   *
   * @throws SQLException
   * @throws HopDatabaseException
   */
Test that for every PreparedStatement passed into lookup signature we do reset and re-create row meta.
Test that for every PreparedStatement passed into lookup signature we do reset and re - create row meta .
@Test
  public void testGetLookupCallPSpassed() throws SQLException, HopDatabaseException {
    when( ps.executeQuery() ).thenReturn( rs );
    when( rs.getMetaData() ).thenReturn( rsMetaData );
    when( rsMetaData.getColumnCount() ).thenReturn( 0 );
    when( ps.getMetaData() ).thenReturn( rsMetaData );
    Database db = new Database( log, variables, meta );
    db.getLookup( ps );
    verify( rsMetaData, times( 1 ) ).getColumnCount();
  }
@ Test public void testGetLookupCallPSpassed ( ) throws SQLException , HopDatabaseException { when ( ps . executeQuery ( ) ) . thenReturn ( rs ) ; when ( rs . getMetaData ( ) ) . thenReturn ( rsMetaData ) ; when ( rsMetaData . getColumnCount ( ) ) . thenReturn ( 0 ) ; when ( ps . getMetaData ( ) ) . thenReturn ( rsMetaData ) ; Database db = new Database ( log , variables , meta ) ; db . getLookup ( ps ) ; verify ( rsMetaData , times ( 1 ) ) . getColumnCount ( ) ; }
Test that for every PreparedStatement passed into lookup signature we do reset and re-create row meta.
Test that for every PreparedStatement passed into lookup signature we do reset and re - create row meta .