org.pentaho.di.trans.steps.execsqlrow
Class ExecSQLRowTest

java.lang.Object
  extended by org.pentaho.di.trans.steps.execsqlrow.ExecSQLRowTest

public class ExecSQLRowTest
extends Object

Test class for database lookup. 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. Still to do: - cache testing. - Do not pass rows functionality/eat rows on failed lookup - Fail on multiple rows - Order by - Different comparators

Author:
Sven Boden

Field Summary
static String[] databasesXML
           
static LoggingObjectInterface loggingObject
           
 
Constructor Summary
ExecSQLRowTest()
           
 
Method Summary
 void checkRows(List<RowMetaAndData> rows1, List<RowMetaAndData> rows2)
          Check the 2 lists comparing the rows in order.
static void createDatabase()
           
 List<RowMetaAndData> createDataRows()
          Create the input rows used for a unit test.
 List<RowMetaAndData> createResultDataRows()
          Create the result rows for a test.
 RowMetaInterface createResultRowMetaInterface()
           
 RowMetaInterface createRowMetaInterface()
           
static RowMetaInterface createSourceRowMetaInterface()
           
static void createTables(Database db)
          Create source table.
 void testExecSQLRow1()
          Basic Test case for Exec SQL Row.
 void testExecSQLRow2()
          Basic Test case for Exec SQL Row.
 void testExecSQLRow3()
          Basic Test case for Exec SQL Row.
 void testExecSQLRow4()
          Basic Test case for Exec SQL Row.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

loggingObject

public static final LoggingObjectInterface loggingObject

databasesXML

public static final String[] databasesXML
Constructor Detail

ExecSQLRowTest

public ExecSQLRowTest()
Method Detail

createSourceRowMetaInterface

public static RowMetaInterface createSourceRowMetaInterface()

createTables

public static 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.


createResultRowMetaInterface

public RowMetaInterface createResultRowMetaInterface()

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.


createDatabase

public static void createDatabase()
                           throws Exception
Throws:
Exception

testExecSQLRow1

public void testExecSQLRow1()
                     throws Exception
Basic Test case for Exec SQL Row. This tests a commit size of zero (i.e. autocommit)

Throws:
Exception

testExecSQLRow2

public void testExecSQLRow2()
                     throws Exception
Basic Test case for Exec SQL Row. This tests a commit size of one (i.e. "simulated" autocommit)

Throws:
Exception

testExecSQLRow3

public void testExecSQLRow3()
                     throws Exception
Basic Test case for Exec SQL Row. This tests a commit size of two (i.e. not autocommit and not the input row size)

Throws:
Exception

testExecSQLRow4

public void testExecSQLRow4()
                     throws Exception
Basic Test case for Exec SQL Row. This tests a commit size of three (i.e. not autocommit but equal to input row size)

Throws:
Exception