org.pentaho.di.trans.steps.textfileoutput
Class TextFileOutputTests

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

public class TextFileOutputTests
extends junit.framework.TestCase

This class tests the functionality of the TextFileOutput step.


Constructor Summary
TextFileOutputTests()
           
 
Method Summary
 List<RowMetaAndData> createData()
          Creates data...
 List<RowMetaAndData> createResultData1()
          Create result data for test case 1.
 List<RowMetaAndData> createResultDataFromObjects(Object[][] objs)
          Create result data for test case 1.
 RowMetaInterface createResultRowMetaInterface()
          Creates a row meta interface for the fields that are defined by performing a getFields and by checking "Result filenames - Add filenames to result from "Text File Input" dialog.
 RowMetaInterface createRowMetaInterface()
          Creates a RowMetaInterface with a ValueMetaInterface with the name "filename".
 void testTextFileOutput1()
          Check the 2 lists comparing the rows in order.
 void testTextFileOutput2()
          Tests the default setting of createparentfolder to true by creating a new TextFileOutputMeta and verifying that createparentfolder is true
 void testTextFileOutput3()
          Tests the default setting of createparentfolder to true by creating a new TextFileOutputMeta using a sample XML step (from a real transformation) and verifying that createparentfolder is true
 void testTextFileOutput4()
          Tests the ZIP output capability of the TextFileOutput step
 void testTextFileOutput5()
          Tests the GZIP output capability of the TextFileOutput step
 void testTextFileOutput6()
          Tests the normal output capability of the TextFileOutput step
 
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

TextFileOutputTests

public TextFileOutputTests()
Method Detail

createResultData1

public List<RowMetaAndData> createResultData1()
Create result data for test case 1. Each Object array in element in list should mirror the data written by the row generator created by the createRowGenerator method.

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

createResultDataFromObjects

public List<RowMetaAndData> createResultDataFromObjects(Object[][] objs)
Create result data for test case 1. Each Object array in element in list should mirror the data written by the row generator created by the createRowGenerator method.

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

createRowMetaInterface

public RowMetaInterface createRowMetaInterface()
Creates a RowMetaInterface with a ValueMetaInterface with the name "filename".

Returns:

createData

public List<RowMetaAndData> createData()
Creates data... Will add more as I figure what the data is.

Parameters:
fileName -
Returns:

createResultRowMetaInterface

public RowMetaInterface createResultRowMetaInterface()
Creates a row meta interface for the fields that are defined by performing a getFields and by checking "Result filenames - Add filenames to result from "Text File Input" dialog.

Returns:

testTextFileOutput1

public void testTextFileOutput1()
                         throws Exception
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).
Throws:
Exception

testTextFileOutput2

public void testTextFileOutput2()
                         throws Exception
Tests the default setting of createparentfolder to true by creating a new TextFileOutputMeta and verifying that createparentfolder is true

Throws:
Exception

testTextFileOutput3

public void testTextFileOutput3()
                         throws Exception
Tests the default setting of createparentfolder to true by creating a new TextFileOutputMeta using a sample XML step (from a real transformation) and verifying that createparentfolder is true

Throws:
Exception

testTextFileOutput4

public void testTextFileOutput4()
                         throws Exception
Tests the ZIP output capability of the TextFileOutput step

Throws:
Exception

testTextFileOutput5

public void testTextFileOutput5()
                         throws Exception
Tests the GZIP output capability of the TextFileOutput step

Throws:
Exception

testTextFileOutput6

public void testTextFileOutput6()
                         throws Exception
Tests the normal output capability of the TextFileOutput step

Throws:
Exception