org.pentaho.di.trans.steps.csvinput
Class CsvInput1Test

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

public class CsvInput1Test
extends junit.framework.TestCase

Regression test case for PDI JIRA-1317: a csv input step with less columns in certain rows than the number of columns defined in the step. In the original problem (in v3.1-M2) this caused the filename column to be in the wrong places.

Author:
Sven Boden

Constructor Summary
CsvInput1Test()
           
 
Method Summary
 void checkRows(List<RowMetaAndData> rows1, List<RowMetaAndData> rows2, int fileNameColumn)
          Check the 2 lists comparing the rows in order.
 List<RowMetaAndData> createData(String fileName)
           
 List<RowMetaAndData> createResultData1()
          Create result data for test case 1.
 RowMetaInterface createResultRowMetaInterface()
           
 RowMetaInterface createRowMetaInterface()
           
 void testCSVInput1()
          Test case for Get XML Data step, very simple example.
 String writeInputFile()
          Write the file to be used as input (as a temporary file).
 
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

CsvInput1Test

public CsvInput1Test()
Method Detail

writeInputFile

public String writeInputFile()
                      throws IOException
Write the file to be used as input (as a temporary file).

Returns:
Absolute file name/path of the created file.
Throws:
IOException - UPON

createRowMetaInterface

public RowMetaInterface createRowMetaInterface()

createData

public List<RowMetaAndData> createData(String fileName)

createResultRowMetaInterface

public RowMetaInterface createResultRowMetaInterface()

createResultData1

public List<RowMetaAndData> createResultData1()
Create result data for test case 1.

Returns:
list of metadata/data couples of how the result should look like.

checkRows

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

Parameters:
rows1 - set 1 of rows to compare
rows2 - set 2 of rows to compare
fileNameColumn - Number of the column containing the filename. This is only checked for being non-null (some systems maybe canonize names differently than we input).

testCSVInput1

public void testCSVInput1()
                   throws Exception
Test case for Get XML Data step, very simple example.

Throws:
Exception - Upon any exception