org.pentaho.di.trans.steps.tableinput
Class TableInputTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.pentaho.di.trans.steps.tableinput.TableInputTest
All Implemented Interfaces:
junit.framework.Test

public class TableInputTest
extends junit.framework.TestCase

Test class for tableinput. H2 is used as database in memory to get an easy playground for database tests. H2 does not support all SQL features but it should proof enough for most of our tests.

Author:
Sven Boden

Field Summary
static String[] databasesXML
           
 
Constructor Summary
TableInputTest()
           
 
Method Summary
 void checkRows(List<RowMetaAndData> rows1, List<RowMetaAndData> rows2)
          Check the 2 lists comparing the rows in order.
 List<RowMetaAndData> createDataRows()
          Create the input rows used for a unit test.
 List<RowMetaAndData> createResultDataRows()
          Create the result rows for a test.
 RowMetaInterface createRowMetaInterface()
           
 RowMetaInterface createSourceRowMetaInterface()
           
 void createTables(Database db)
          Create source table.
 void testTableInputWithParam()
          Test case for table input which is taking its input from a hop.
 
Methods inherited from class junit.framework.TestCase
countTestCases, getName, run, run, runBare, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

databasesXML

public static final String[] databasesXML
Constructor Detail

TableInputTest

public TableInputTest()
Method Detail

createSourceRowMetaInterface

public RowMetaInterface createSourceRowMetaInterface()

createTables

public void createTables(Database db)
                  throws Exception
Create source table.

Throws:
Exception

createRowMetaInterface

public RowMetaInterface createRowMetaInterface()

createDataRows

public List<RowMetaAndData> createDataRows()
Create the input rows used for a unit test.


createResultDataRows

public List<RowMetaAndData> createResultDataRows()
Create the result rows for a test.


checkRows

public void checkRows(List<RowMetaAndData> rows1,
                      List<RowMetaAndData> rows2)
Check the 2 lists comparing the rows in order. If they are not the same fail the test.


testTableInputWithParam

public void testTableInputWithParam()
                             throws Exception
Test case for table input which is taking its input from a hop. This is a regression test case for JIRA PDI-588. The query in the table input step has one '?' and this parameter is filled by values read from an input hop.

Throws:
Exception