Package org.pentaho.commons.connection

Examples of org.pentaho.commons.connection.IPeekable


    assertEquals( "column header is wrong", "year", data.getMetaData().getColumnHeaders()[0][2] );
    assertEquals( "column header is wrong", "price", data.getMetaData().getColumnHeaders()[0][3] );

    assertTrue( "result set is not peekable", data instanceof IPeekable );

    IPeekable peekable = (IPeekable) data;

    Object[] row = peekable.peek();
    assertEquals( "Everyday Italian", row[0] );
    assertEquals( "Giada De Laurentiis", row[1] );
    assertEquals( "2005", row[2] );
    assertEquals( "30.00", row[3] );

    row = peekable.peek();
    assertEquals( "Everyday Italian", row[0] );

    row = peekable.peek();
    assertEquals( "Everyday Italian", row[0] );

    row = peekable.peek();
    assertEquals( "Everyday Italian", row[0] );

    row = data.next();
    assertEquals( "Everyday Italian", row[0] );
    assertEquals( "Giada De Laurentiis", row[1] );
    assertEquals( "2005", row[2] );
    assertEquals( "30.00", row[3] );

    row = peekable.peek();
    assertEquals( "Harry Potter", row[0] );
    assertEquals( "J K. Rowling", row[1] );
    assertEquals( "2005", row[2] );
    assertEquals( "29.99", row[3] );

    row = peekable.peek();
    assertEquals( "Harry Potter", row[0] );
    assertEquals( "J K. Rowling", row[1] );
    assertEquals( "2005", row[2] );
    assertEquals( "29.99", row[3] );

    row = data.next();
    assertEquals( "Harry Potter", row[0] );
    assertEquals( "J K. Rowling", row[1] );
    assertEquals( "2005", row[2] );
    assertEquals( "29.99", row[3] );

    row = peekable.peek();
    assertNotNull( row );

    row = data.next();
    assertNotNull( row );

    row = peekable.peek();
    assertNotNull( row );

    row = data.next();
    assertNotNull( row );

    row = peekable.peek();
    assertNull( row );

    row = data.next();
    assertNull( row );

    row = peekable.peek();
    assertNull( row );
  }
View Full Code Here

TOP

Related Classes of org.pentaho.commons.connection.IPeekable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.