org.pentaho.di.trans.steps.tableoutput
Class TableOutputTest

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

public class TableOutputTest
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
TableOutputTest()
           
 
Method Summary
 void checkResultsJIRA897(Database db)
          Check the results in the target dimension table.
 void checkResultsNormal(Database db)
          Check the results in the target dimension table.
 void checkRows(List<RowMetaAndData> rows1, List<RowMetaAndData> rows2)
          Check the 2 lists comparing the rows in order.
 List<RowMetaAndData> createJIRA897DataRows()
          Create the input rows used for the JIRA897 unit test.
 List<RowMetaAndData> createJIRA897ResultDataRows()
          Create the result rows for the JIRA897 case.
 RowMetaInterface createJIRA897RowMetaInterface()
           
 List<RowMetaAndData> createNormalDataRows()
          Create the input rows used for the normal unit test.
 RowMetaInterface createSourceRowMetaInterface1()
           
 void createTable(Database db, String tableName, RowMetaInterface rm)
          Create table for the normal case.
 void dropTable(Database db, String tableName)
          Drop table
static void main(String[] args)
           
 void testTableOutputJIRA2733()
          Test case for commitSize see PDI2733 in JIRA.
 void testTableOutputJIRA897()
          Test case for normal table output where the table is included in the instream, but the tablename is not stored in the table.
 void testTableOutputNormal()
          Test case for normal table output case.
 
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

TableOutputTest

public TableOutputTest()
Method Detail

createTable

public void createTable(Database db,
                        String tableName,
                        RowMetaInterface rm)
                 throws Exception
Create table for the normal case.

Throws:
Exception

dropTable

public void dropTable(Database db,
                      String tableName)
               throws Exception
Drop table

Throws:
Exception

createSourceRowMetaInterface1

public RowMetaInterface createSourceRowMetaInterface1()

createNormalDataRows

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


createJIRA897RowMetaInterface

public RowMetaInterface createJIRA897RowMetaInterface()

createJIRA897DataRows

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


createJIRA897ResultDataRows

public List<RowMetaAndData> createJIRA897ResultDataRows()
Create the result rows for the JIRA897 case.


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.


checkResultsNormal

public void checkResultsNormal(Database db)
                        throws Exception
Check the results in the target dimension table.

Parameters:
db - database to use.
Throws:
Exception

checkResultsJIRA897

public void checkResultsJIRA897(Database db)
                         throws Exception
Check the results in the target dimension table.

Parameters:
db - database to use.
Throws:
Exception

testTableOutputNormal

public void testTableOutputNormal()
                           throws Exception
Test case for normal table output case.

Throws:
Exception

testTableOutputJIRA897

public void testTableOutputJIRA897()
                            throws Exception
Test case for normal table output where the table is included in the instream, but the tablename is not stored in the table.

Throws:
Exception

testTableOutputJIRA2733

public void testTableOutputJIRA2733()
                             throws Exception
Test case for commitSize see PDI2733 in JIRA.

Throws:
Exception

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception