org.pentaho.di.trans.steps.jsonoutput
Class JsonOutputTest

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

public class JsonOutputTest
extends junit.framework.TestCase

This class was a "copy and modification" of Kettle's JsonOutputTests.

Author:
Hendy Irawan Modified by Sean Flatley, removing dependency on external text file to hold expected results and modifying code to handle "Compatibility Mode".

Constructor Summary
JsonOutputTest()
           
 
Method Summary
 List<RowMetaAndData> createData()
          Creates data...
 List<RowMetaAndData> createResultData1()
          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".
 String test(boolean compatibilityMode)
           
 void testCompatibilityMode()
           
 void testNonCompatibilityMode()
           
 
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

JsonOutputTest

public JsonOutputTest()
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.

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:

test

public String test(boolean compatibilityMode)
            throws Exception
Throws:
Exception

testNonCompatibilityMode

public void testNonCompatibilityMode()
                              throws Exception
Throws:
Exception

testCompatibilityMode

public void testCompatibilityMode()
                           throws Exception
Throws:
Exception