org.pentaho.di.trans.steps.xslt
Class XsltTest

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

public class XsltTest
extends junit.framework.TestCase


Constructor Summary
XsltTest()
           
 
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 runTestWithParams(String xmlFieldname, String resultFieldname, boolean xslInField, boolean xslFileInField, String xslFileField, String xslFilename, String xslFactory)
           
 void testXslt1()
          Test case for XSLT step, getting the filename from a field, JAXP factory
 void testXslt2()
          Test case for XSLT step, getting the filename from a field, SAXON factory
 void testXslt3()
          Test case for XSLT step, getting the XSL from a field, JAXP factory
 void testXslt4()
          Test case for XSLT step, getting the XSL from a field, SAXON factory
 void testXslt5()
          Test case for XSLT step, getting the XSL from a file, JAXP factory
 void testXslt6()
          Test case for XSLT step, getting the XSL from a file, SAXON factory
 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

XsltTest

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

testXslt1

public void testXslt1()
               throws Exception
Test case for XSLT step, getting the filename from a field, JAXP factory

Throws:
Exception - Upon any exception

testXslt2

public void testXslt2()
               throws Exception
Test case for XSLT step, getting the filename from a field, SAXON factory

Throws:
Exception - Upon any exception

testXslt3

public void testXslt3()
               throws Exception
Test case for XSLT step, getting the XSL from a field, JAXP factory

Throws:
Exception - Upon any exception

testXslt4

public void testXslt4()
               throws Exception
Test case for XSLT step, getting the XSL from a field, SAXON factory

Throws:
Exception - Upon any exception

testXslt5

public void testXslt5()
               throws Exception
Test case for XSLT step, getting the XSL from a file, JAXP factory

Throws:
Exception - Upon any exception

testXslt6

public void testXslt6()
               throws Exception
Test case for XSLT step, getting the XSL from a file, SAXON factory

Throws:
Exception - Upon any exception

runTestWithParams

public void runTestWithParams(String xmlFieldname,
                              String resultFieldname,
                              boolean xslInField,
                              boolean xslFileInField,
                              String xslFileField,
                              String xslFilename,
                              String xslFactory)
                       throws Exception
Throws:
Exception