org.pentaho.di.trans.steps.detectlastrow
Class DetectLastRowStepTest

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

public class DetectLastRowStepTest
extends junit.framework.TestCase

Test class for the Detect Last Row (also now as "Identify last row in stream) step.

Author:
Sven Boden

Constructor Summary
DetectLastRowStepTest()
           
 
Method Summary
 void checkRows(List<RowMetaAndData> rows1, List<RowMetaAndData> rows2)
          Check the 2 lists comparing the rows in order.
 List<RowMetaAndData> createData(int nrRows)
          Create data rows.
 List<RowMetaAndData> createResultData(int nrRows)
          Create result data rows.
 RowMetaInterface createResultRowMetaInterface()
           
 RowMetaInterface createRowMetaInterface()
           
 void detectLastRowStepTest(int nrRows)
          Test case Detect Last Row step.
 void testDetectLastRowStep0()
          Test with 0 rows
 void testDetectLastRowStep1()
          Test with 1 rows
 void testDetectLastRowStep2()
          Test with 2 rows
 void testDetectLastRowStep3()
          Test with 3 rows
 
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
 

Constructor Detail

DetectLastRowStepTest

public DetectLastRowStepTest()
Method Detail

createRowMetaInterface

public RowMetaInterface createRowMetaInterface()

createData

public List<RowMetaAndData> createData(int nrRows)
Create data rows.

Parameters:
nrRows - nr of rows to insert (from 0 to 3 for the moment)
Returns:
List of row and meta data

createResultRowMetaInterface

public RowMetaInterface createResultRowMetaInterface()

createResultData

public List<RowMetaAndData> createResultData(int nrRows)
Create result data rows.

Parameters:
nrRows - nr of rows to insert (from 0 to 3 for the moment)
Returns:
List of row and meta data

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.

Parameters:
rows1 - first row set to compare
rows2 - second row set to compare

detectLastRowStepTest

public void detectLastRowStepTest(int nrRows)
                           throws Exception
Test case Detect Last Row step. Nr of rows to test with as argument.

Parameters:
nrRows - Number of rows to test.
Throws:
Exception - upon any exception

testDetectLastRowStep0

public void testDetectLastRowStep0()
                            throws Exception
Test with 0 rows

Throws:
Exception - Upon any error.

testDetectLastRowStep1

public void testDetectLastRowStep1()
                            throws Exception
Test with 1 rows

Throws:
Exception - Upon any error.

testDetectLastRowStep2

public void testDetectLastRowStep2()
                            throws Exception
Test with 2 rows

Throws:
Exception - Upon any error.

testDetectLastRowStep3

public void testDetectLastRowStep3()
                            throws Exception
Test with 3 rows

Throws:
Exception - Upon any error.