Browse files

added tests for lazy conversion and null handling

  • Loading branch information...
1 parent 740fdcd commit 0013843540e6fb32cdd4284f5090ff2c9ede3eb2 Slawomir Chodnicki committed Mar 19, 2011
View
2 test/org/typeexit/kettle/plugin/steps/ruby/TestSuite.java
@@ -4,7 +4,7 @@
import org.junit.runners.Suite;
@RunWith(Suite.class)
-@Suite.SuiteClasses({ TestFactory.class, TestSamples.class })
+@Suite.SuiteClasses({ TestFactory.class, TestSamples.class, TestTransformations.class })
public class TestSuite {
}
View
69 test/org/typeexit/kettle/plugin/steps/ruby/TestTransformations.java
@@ -0,0 +1,69 @@
+package org.typeexit.kettle.plugin.steps.ruby;
+
+import junit.framework.TestCase;
+
+import org.pentaho.di.core.KettleEnvironment;
+import org.pentaho.di.core.Result;
+import org.pentaho.di.core.exception.KettleException;
+import org.pentaho.di.core.logging.LogLevel;
+import org.pentaho.di.job.Job;
+import org.pentaho.di.job.JobMeta;
+
+//
+// NOTE: this is a blackbox test that works on distribution files
+// It should only be run run after "ant test-dist" has put a test distribution into place
+//
+public class TestTransformations extends TestCase {
+
+ public void testRunAllSamples() throws KettleException, InterruptedException{
+
+ String projectDir = System.getProperty("user.dir");
+ System.setProperty("KETTLE_PLUGIN_BASE_FOLDERS", projectDir+"/testdist"); // the plugin directory is in "testdist"
+
+ KettleEnvironment.init();
+
+ String jobfile = projectDir+"/test/org/typeexit/kettle/plugin/steps/ruby/files/tests/run_all_tests.kjb";
+
+ JobMeta jobMeta = new JobMeta(jobfile, null, null);
+ final Job job = new Job(null, jobMeta);
+
+ job.initializeVariablesFrom(null);
+ job.setLogLevel(LogLevel.MINIMAL);
+ job.getJobMeta().setInternalKettleVariables(job);
+ job.copyParametersFrom(job.getJobMeta());
+ job.activateParameters();
+
+ Thread jobRunner = new Thread(new Runnable(){
+
+ @Override
+ public void run() {
+ job.start();
+ job.waitUntilFinished();
+
+ }
+ });;
+
+ // start the job and wait for it to finish
+ jobRunner.start();
+
+ // measure the time while waiting, anything beyond MAX_RUNTIME
+ // indicates that the thing hangs
+ long startTime = System.currentTimeMillis();
+ final int MAX_RUNTIME = 120 * 1000;
+
+ while(jobRunner.isAlive()){
+
+ Thread.sleep(1000);
+
+ if (System.currentTimeMillis() - startTime > MAX_RUNTIME){
+ fail("all tests job seems to be hanging for "+(MAX_RUNTIME/1000)+" seconds");
+ }
+ }
+
+ // make sure there's no errors when the job finishes
+ Result result = job.getResult();
+ assertEquals(0, result.getNrErrors());
+
+ }
+
+}
View
36 test/org/typeexit/kettle/plugin/steps/ruby/files/run_sample.kjb
@@ -88,8 +88,8 @@
</parameters> <parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
- <xloc>264</xloc>
- <yloc>134</yloc>
+ <xloc>328</xloc>
+ <yloc>137</yloc>
</entry>
<entry>
<name>Success</name>
@@ -98,23 +98,45 @@
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
- <xloc>377</xloc>
- <yloc>134</yloc>
+ <xloc>441</xloc>
+ <yloc>137</yloc>
+ </entry>
+ <entry>
+ <name>Write To Log</name>
+ <description/>
+ <type>WRITE_TO_LOG</type>
+ <logmessage>${filename}</logmessage>
+ <loglevel>Minimal</loglevel>
+ <logsubject>Executing Sample:</logsubject>
+ <parallel>N</parallel>
+ <draw>Y</draw>
+ <nr>0</nr>
+ <xloc>213</xloc>
+ <yloc>135</yloc>
</entry>
</entries>
<hops>
<hop>
+ <from>Run Sample</from>
+ <to>Success</to>
+ <from_nr>0</from_nr>
+ <to_nr>0</to_nr>
+ <enabled>Y</enabled>
+ <evaluation>Y</evaluation>
+ <unconditional>N</unconditional>
+ </hop>
+ <hop>
<from>START</from>
- <to>Run Sample</to>
+ <to>Write To Log</to>
<from_nr>0</from_nr>
<to_nr>0</to_nr>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>Y</unconditional>
</hop>
<hop>
- <from>Run Sample</from>
- <to>Success</to>
+ <from>Write To Log</from>
+ <to>Run Sample</to>
<from_nr>0</from_nr>
<to_nr>0</to_nr>
<enabled>Y</enabled>
View
561 .../org/typeexit/kettle/plugin/steps/ruby/files/tests/accepting_nulls/test_null_handling.ktr
@@ -0,0 +1,561 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<transformation>
+ <info>
+ <name>Test null handling</name>
+ <description/>
+ <extended_description/>
+ <trans_version/>
+ <trans_type>Normal</trans_type>
+ <trans_status>0</trans_status>
+ <directory>&#47;</directory>
+ <parameters>
+ </parameters>
+ <log>
+<trans-log-table><connection/>
+<schema/>
+<table/>
+<size_limit_lines/>
+<interval/>
+<timeout_days/>
+<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STATUS</id><enabled>Y</enabled><name>STATUS</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name><subject/></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name><subject/></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name><subject/></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name><subject/></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name><subject/></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name><subject/></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>STARTDATE</id><enabled>Y</enabled><name>STARTDATE</name></field><field><id>ENDDATE</id><enabled>Y</enabled><name>ENDDATE</name></field><field><id>LOGDATE</id><enabled>Y</enabled><name>LOGDATE</name></field><field><id>DEPDATE</id><enabled>Y</enabled><name>DEPDATE</name></field><field><id>REPLAYDATE</id><enabled>Y</enabled><name>REPLAYDATE</name></field><field><id>LOG_FIELD</id><enabled>Y</enabled><name>LOG_FIELD</name></field></trans-log-table>
+<perf-log-table><connection/>
+<schema/>
+<table/>
+<interval/>
+<timeout_days/>
+<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>SEQ_NR</id><enabled>Y</enabled><name>SEQ_NR</name></field><field><id>LOGDATE</id><enabled>Y</enabled><name>LOGDATE</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STEPNAME</id><enabled>Y</enabled><name>STEPNAME</name></field><field><id>STEP_COPY</id><enabled>Y</enabled><name>STEP_COPY</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>INPUT_BUFFER_ROWS</id><enabled>Y</enabled><name>INPUT_BUFFER_ROWS</name></field><field><id>OUTPUT_BUFFER_ROWS</id><enabled>Y</enabled><name>OUTPUT_BUFFER_ROWS</name></field></perf-log-table>
+<channel-log-table><connection/>
+<schema/>
+<table/>
+<timeout_days/>
+<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>LOGGING_OBJECT_TYPE</id><enabled>Y</enabled><name>LOGGING_OBJECT_TYPE</name></field><field><id>OBJECT_NAME</id><enabled>Y</enabled><name>OBJECT_NAME</name></field><field><id>OBJECT_COPY</id><enabled>Y</enabled><name>OBJECT_COPY</name></field><field><id>REPOSITORY_DIRECTORY</id><enabled>Y</enabled><name>REPOSITORY_DIRECTORY</name></field><field><id>FILENAME</id><enabled>Y</enabled><name>FILENAME</name></field><field><id>OBJECT_ID</id><enabled>Y</enabled><name>OBJECT_ID</name></field><field><id>OBJECT_REVISION</id><enabled>Y</enabled><name>OBJECT_REVISION</name></field><field><id>PARENT_CHANNEL_ID</id><enabled>Y</enabled><name>PARENT_CHANNEL_ID</name></field><field><id>ROOT_CHANNEL_ID</id><enabled>Y</enabled><name>ROOT_CHANNEL_ID</name></field></channel-log-table>
+<step-log-table><connection/>
+<schema/>
+<table/>
+<timeout_days/>
+<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STEPNAME</id><enabled>Y</enabled><name>STEPNAME</name></field><field><id>STEP_COPY</id><enabled>Y</enabled><name>STEP_COPY</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>LOG_FIELD</id><enabled>N</enabled><name>LOG_FIELD</name></field></step-log-table>
+ </log>
+ <maxdate>
+ <connection/>
+ <table/>
+ <field/>
+ <offset>0.0</offset>
+ <maxdiff>0.0</maxdiff>
+ </maxdate>
+ <size_rowset>10000</size_rowset>
+ <sleep_time_empty>50</sleep_time_empty>
+ <sleep_time_full>50</sleep_time_full>
+ <unique_connections>N</unique_connections>
+ <feedback_shown>Y</feedback_shown>
+ <feedback_size>50000</feedback_size>
+ <using_thread_priorities>Y</using_thread_priorities>
+ <shared_objects_file/>
+ <capture_step_performance>N</capture_step_performance>
+ <step_performance_capturing_delay>1000</step_performance_capturing_delay>
+ <step_performance_capturing_size_limit>100</step_performance_capturing_size_limit>
+ <dependencies>
+ </dependencies>
+ <partitionschemas>
+ </partitionschemas>
+ <slaveservers>
+ </slaveservers>
+ <clusterschemas>
+ </clusterschemas>
+ <created_user>-</created_user>
+ <created_date>2011&#47;03&#47;19 18:21:39.009</created_date>
+ <modified_user>-</modified_user>
+ <modified_date>2011&#47;03&#47;19 18:21:39.009</modified_date>
+ </info>
+ <notepads>
+ <notepad>
+ <note>Generate empty row</note>
+ <xloc>259</xloc>
+ <yloc>294</yloc>
+ <width>127</width>
+ <heigth>29</heigth>
+ <fontname>Arial</fontname>
+ <fontsize>13</fontsize>
+ <fontbold>N</fontbold>
+ <fontitalic>N</fontitalic>
+ <fontcolorred>0</fontcolorred>
+ <fontcolorgreen>0</fontcolorgreen>
+ <fontcolorblue>0</fontcolorblue>
+ <backgroundcolorred>255</backgroundcolorred>
+ <backgroundcolorgreen>165</backgroundcolorgreen>
+ <backgroundcolorblue>0</backgroundcolorblue>
+ <bordercolorred>100</bordercolorred>
+ <bordercolorgreen>100</bordercolorgreen>
+ <bordercolorblue>100</bordercolorblue>
+ <drawshadow>Y</drawshadow>
+ </notepad>
+ <notepad>
+ <note>Pass through empty row</note>
+ <xloc>252</xloc>
+ <yloc>43</yloc>
+ <width>151</width>
+ <heigth>29</heigth>
+ <fontname>Arial</fontname>
+ <fontsize>13</fontsize>
+ <fontbold>N</fontbold>
+ <fontitalic>N</fontitalic>
+ <fontcolorred>0</fontcolorred>
+ <fontcolorgreen>0</fontcolorgreen>
+ <fontcolorblue>0</fontcolorblue>
+ <backgroundcolorred>255</backgroundcolorred>
+ <backgroundcolorgreen>165</backgroundcolorgreen>
+ <backgroundcolorblue>0</backgroundcolorblue>
+ <bordercolorred>100</bordercolorred>
+ <bordercolorgreen>100</bordercolorgreen>
+ <bordercolorblue>100</bordercolorblue>
+ <drawshadow>Y</drawshadow>
+ </notepad>
+ </notepads>
+ <order>
+ <hop> <from>Generate Rows</from><to>pass unaltered</to><enabled>Y</enabled> </hop> <hop> <from>Empty Stream</from><to>Detect empty stream</to><enabled>Y</enabled> </hop> <hop> <from>pass unaltered</from><to>Merge Rows (diff)</to><enabled>Y</enabled> </hop> <hop> <from>Detect empty stream</from><to>set key</to><enabled>Y</enabled> </hop> <hop> <from>set key</from><to>Merge Rows (diff)</to><enabled>Y</enabled> </hop> <hop> <from>Merge Rows (diff)</from><to>Select values</to><enabled>Y</enabled> </hop> <hop> <from>Select values</from><to>is identical?</to><enabled>Y</enabled> </hop> <hop> <from>is identical?</from><to>good</to><enabled>Y</enabled> </hop> <hop> <from>is identical?</from><to>Fail</to><enabled>Y</enabled> </hop> </order>
+ <step>
+ <name>pass unaltered</name>
+ <type>TypeExitRubyStep</type>
+ <description/>
+ <distribute>Y</distribute>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <scripts>
+ <script>
+ <title>Ruby Script</title>
+ <body># your script goes here
+
+$row</body>
+ <role>ROW_SCRIPT</role>
+ </script>
+ </scripts>
+ <rubyVersion>RUBY_1_8</rubyVersion>
+ <clearInputFields>N</clearInputFields>
+
+ <outputFields>
+ </outputFields>
+ <rubyVariables>
+ </rubyVariables>
+ <infoSteps>
+ </infoSteps>
+ <targetSteps>
+ </targetSteps>
+ <gemHome/>
+ <cluster_schema/>
+ <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
+ <xloc>399</xloc>
+ <yloc>97</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+
+ <step>
+ <name>Generate Rows</name>
+ <type>RowGenerator</type>
+ <description/>
+ <distribute>Y</distribute>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <fields>
+ <field>
+ <name>key</name>
+ <type>Integer</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <nullif>1</nullif>
+ <length>-1</length>
+ <precision>-1</precision>
+ </field>
+ <field>
+ <name>null_date</name>
+ <type>Date</type>
+ <format>yyyy-MM-dd</format>
+ <currency/>
+ <decimal/>
+ <group/>
+ <nullif/>
+ <length>-1</length>
+ <precision>-1</precision>
+ </field>
+ <field>
+ <name>null_str</name>
+ <type>String</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <nullif/>
+ <length>-1</length>
+ <precision>-1</precision>
+ </field>
+ <field>
+ <name>null_int</name>
+ <type>Integer</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <nullif/>
+ <length>-1</length>
+ <precision>-1</precision>
+ </field>
+ <field>
+ <name>null_bool</name>
+ <type>Boolean</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <nullif/>
+ <length>-1</length>
+ <precision>-1</precision>
+ </field>
+ <field>
+ <name>null_num</name>
+ <type>Number</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <nullif/>
+ <length>-1</length>
+ <precision>-1</precision>
+ </field>
+ <field>
+ <name>null_bignum</name>
+ <type>BigNumber</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <nullif/>
+ <length>-1</length>
+ <precision>-1</precision>
+ </field>
+ <field>
+ <name>null_serial</name>
+ <type>Serializable</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <nullif/>
+ <length>-1</length>
+ <precision>-1</precision>
+ </field>
+ <field>
+ <name>null_binary</name>
+ <type>Binary</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <nullif/>
+ <length>-1</length>
+ <precision>-1</precision>
+ </field>
+ </fields>
+ <limit>1</limit>
+ <cluster_schema/>
+ <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
+ <xloc>100</xloc>
+ <yloc>97</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+
+ <step>
+ <name>Empty Stream</name>
+ <type>RowGenerator</type>
+ <description/>
+ <distribute>Y</distribute>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <fields>
+ <field>
+ <name>key</name>
+ <type>Integer</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <nullif/>
+ <length>-1</length>
+ <precision>-1</precision>
+ </field>
+ <field>
+ <name>null_date</name>
+ <type>Date</type>
+ <format>yyyy-MM-dd</format>
+ <currency/>
+ <decimal/>
+ <group/>
+ <nullif/>
+ <length>-1</length>
+ <precision>-1</precision>
+ </field>
+ <field>
+ <name>null_str</name>
+ <type>String</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <nullif/>
+ <length>-1</length>
+ <precision>-1</precision>
+ </field>
+ <field>
+ <name>null_int</name>
+ <type>Integer</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <nullif/>
+ <length>-1</length>
+ <precision>-1</precision>
+ </field>
+ <field>
+ <name>null_bool</name>
+ <type>Boolean</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <nullif/>
+ <length>-1</length>
+ <precision>-1</precision>
+ </field>
+ <field>
+ <name>null_num</name>
+ <type>Number</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <nullif/>
+ <length>-1</length>
+ <precision>-1</precision>
+ </field>
+ <field>
+ <name>null_bignum</name>
+ <type>BigNumber</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <nullif/>
+ <length>-1</length>
+ <precision>-1</precision>
+ </field>
+ <field>
+ <name>null_serial</name>
+ <type>Serializable</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <nullif/>
+ <length>-1</length>
+ <precision>-1</precision>
+ </field>
+ <field>
+ <name>null_binary</name>
+ <type>Binary</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <nullif/>
+ <length>-1</length>
+ <precision>-1</precision>
+ </field>
+ </fields>
+ <limit>0</limit>
+ <cluster_schema/>
+ <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
+ <xloc>100</xloc>
+ <yloc>217</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+
+ <step>
+ <name>Detect empty stream</name>
+ <type>DetectEmptyStream</type>
+ <description/>
+ <distribute>Y</distribute>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <cluster_schema/>
+ <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
+ <xloc>245</xloc>
+ <yloc>217</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+
+ <step>
+ <name>Merge Rows (diff)</name>
+ <type>MergeRows</type>
+ <description/>
+ <distribute>Y</distribute>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <keys>
+ <key>key</key>
+ </keys>
+ <values>
+ <value>key</value>
+ </values>
+<flag_field>result</flag_field>
+<reference>set key</reference>
+<compare>pass unaltered</compare>
+ <compare>
+ </compare>
+ <cluster_schema/>
+ <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
+ <xloc>568</xloc>
+ <yloc>160</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+
+ <step>
+ <name>set key</name>
+ <type>Janino</type>
+ <description/>
+ <distribute>Y</distribute>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <formula><field_name>key</field_name>
+<formula_string>1L</formula_string>
+<value_type>Integer</value_type>
+<value_length>-1</value_length>
+<value_precision>-1</value_precision>
+<replace_field>key</replace_field>
+</formula>
+ <cluster_schema/>
+ <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
+ <xloc>407</xloc>
+ <yloc>217</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+
+ <step>
+ <name>Select values</name>
+ <type>SelectValues</type>
+ <description/>
+ <distribute>Y</distribute>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <fields> <field> <name>result</name>
+ <rename/>
+ <length>-2</length>
+ <precision>-2</precision>
+ </field> <select_unspecified>N</select_unspecified>
+ </fields> <cluster_schema/>
+ <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
+ <xloc>695</xloc>
+ <yloc>161</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+
+ <step>
+ <name>good</name>
+ <type>Dummy</type>
+ <description/>
+ <distribute>Y</distribute>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <cluster_schema/>
+ <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
+ <xloc>941</xloc>
+ <yloc>92</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+
+ <step>
+ <name>Fail</name>
+ <type>Abort</type>
+ <description/>
+ <distribute>Y</distribute>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <row_threshold>0</row_threshold>
+ <message/>
+ <always_log_rows>Y</always_log_rows>
+ <cluster_schema/>
+ <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
+ <xloc>945</xloc>
+ <yloc>230</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+
+ <step>
+ <name>is identical?</name>
+ <type>FilterRows</type>
+ <description/>
+ <distribute>Y</distribute>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+<send_true_to>good</send_true_to>
+<send_false_to>Fail</send_false_to>
+ <compare>
+<condition>
+ <negated>N</negated>
+ <leftvalue>result</leftvalue>
+ <function>=</function>
+ <rightvalue/>
+ <value><name>constant</name><type>String</type><text>identical</text><length>-1</length><precision>-1</precision><isnull>N</isnull><mask/></value> </condition>
+ </compare>
+ <cluster_schema/>
+ <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
+ <xloc>814</xloc>
+ <yloc>160</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+
+ <step_error_handling>
+ </step_error_handling>
+ <slave-step-copy-partition-distribution>
+</slave-step-copy-partition-distribution>
+ <slave_transformation>N</slave_transformation>
+</transformation>
View
258 test/org/typeexit/kettle/plugin/steps/ruby/files/tests/find_all_test_files.ktr
@@ -0,0 +1,258 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<transformation>
+ <info>
+ <name>Find All Test Files</name>
+ <description/>
+ <extended_description/>
+ <trans_version/>
+ <trans_type>Normal</trans_type>
+ <trans_status>0</trans_status>
+ <directory>&#47;</directory>
+ <parameters>
+ </parameters>
+ <log>
+<trans-log-table><connection/>
+<schema/>
+<table/>
+<size_limit_lines/>
+<interval/>
+<timeout_days/>
+<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STATUS</id><enabled>Y</enabled><name>STATUS</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name><subject/></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name><subject/></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name><subject/></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name><subject/></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name><subject/></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name><subject/></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>STARTDATE</id><enabled>Y</enabled><name>STARTDATE</name></field><field><id>ENDDATE</id><enabled>Y</enabled><name>ENDDATE</name></field><field><id>LOGDATE</id><enabled>Y</enabled><name>LOGDATE</name></field><field><id>DEPDATE</id><enabled>Y</enabled><name>DEPDATE</name></field><field><id>REPLAYDATE</id><enabled>Y</enabled><name>REPLAYDATE</name></field><field><id>LOG_FIELD</id><enabled>Y</enabled><name>LOG_FIELD</name></field></trans-log-table>
+<perf-log-table><connection/>
+<schema/>
+<table/>
+<interval/>
+<timeout_days/>
+<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>SEQ_NR</id><enabled>Y</enabled><name>SEQ_NR</name></field><field><id>LOGDATE</id><enabled>Y</enabled><name>LOGDATE</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STEPNAME</id><enabled>Y</enabled><name>STEPNAME</name></field><field><id>STEP_COPY</id><enabled>Y</enabled><name>STEP_COPY</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>INPUT_BUFFER_ROWS</id><enabled>Y</enabled><name>INPUT_BUFFER_ROWS</name></field><field><id>OUTPUT_BUFFER_ROWS</id><enabled>Y</enabled><name>OUTPUT_BUFFER_ROWS</name></field></perf-log-table>
+<channel-log-table><connection/>
+<schema/>
+<table/>
+<timeout_days/>
+<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>LOGGING_OBJECT_TYPE</id><enabled>Y</enabled><name>LOGGING_OBJECT_TYPE</name></field><field><id>OBJECT_NAME</id><enabled>Y</enabled><name>OBJECT_NAME</name></field><field><id>OBJECT_COPY</id><enabled>Y</enabled><name>OBJECT_COPY</name></field><field><id>REPOSITORY_DIRECTORY</id><enabled>Y</enabled><name>REPOSITORY_DIRECTORY</name></field><field><id>FILENAME</id><enabled>Y</enabled><name>FILENAME</name></field><field><id>OBJECT_ID</id><enabled>Y</enabled><name>OBJECT_ID</name></field><field><id>OBJECT_REVISION</id><enabled>Y</enabled><name>OBJECT_REVISION</name></field><field><id>PARENT_CHANNEL_ID</id><enabled>Y</enabled><name>PARENT_CHANNEL_ID</name></field><field><id>ROOT_CHANNEL_ID</id><enabled>Y</enabled><name>ROOT_CHANNEL_ID</name></field></channel-log-table>
+<step-log-table><connection/>
+<schema/>
+<table/>
+<timeout_days/>
+<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STEPNAME</id><enabled>Y</enabled><name>STEPNAME</name></field><field><id>STEP_COPY</id><enabled>Y</enabled><name>STEP_COPY</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>LOG_FIELD</id><enabled>N</enabled><name>LOG_FIELD</name></field></step-log-table>
+ </log>
+ <maxdate>
+ <connection/>
+ <table/>
+ <field/>
+ <offset>0.0</offset>
+ <maxdiff>0.0</maxdiff>
+ </maxdate>
+ <size_rowset>10000</size_rowset>
+ <sleep_time_empty>50</sleep_time_empty>
+ <sleep_time_full>50</sleep_time_full>
+ <unique_connections>N</unique_connections>
+ <feedback_shown>Y</feedback_shown>
+ <feedback_size>50000</feedback_size>
+ <using_thread_priorities>Y</using_thread_priorities>
+ <shared_objects_file/>
+ <capture_step_performance>N</capture_step_performance>
+ <step_performance_capturing_delay>1000</step_performance_capturing_delay>
+ <step_performance_capturing_size_limit>100</step_performance_capturing_size_limit>
+ <dependencies>
+ </dependencies>
+ <partitionschemas>
+ </partitionschemas>
+ <slaveservers>
+ </slaveservers>
+ <clusterschemas>
+ </clusterschemas>
+ <created_user>-</created_user>
+ <created_date>2011&#47;02&#47;21 15:41:43.500</created_date>
+ <modified_user>-</modified_user>
+ <modified_date>2011&#47;02&#47;21 15:41:43.500</modified_date>
+ </info>
+ <notepads>
+ </notepads>
+ <order>
+ <hop> <from>Get Test Folders</from><to>extract dir</to><enabled>Y</enabled> </hop> <hop> <from>extract dir</from><to>Add wildcard</to><enabled>Y</enabled> </hop> <hop> <from>Add wildcard</from><to>Get Test Files</to><enabled>Y</enabled> </hop> <hop> <from>Get Test Files</from><to>extract filename</to><enabled>Y</enabled> </hop> <hop> <from>extract filename</from><to>Copy rows to result</to><enabled>Y</enabled> </hop> </order>
+ <step>
+ <name>Add wildcard</name>
+ <type>Constant</type>
+ <description/>
+ <distribute>Y</distribute>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <fields>
+ <field>
+ <name>wildcard</name>
+ <type>String</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <nullif>.*\.ktr$</nullif>
+ <length>-1</length>
+ <precision>-1</precision>
+ </field>
+ <field>
+ <name>exclude</name>
+ <type>String</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <nullif/>
+ <length>-1</length>
+ <precision>-1</precision>
+ </field>
+ </fields>
+ <cluster_schema/>
+ <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
+ <xloc>347</xloc>
+ <yloc>69</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+
+ <step>
+ <name>Copy rows to result</name>
+ <type>RowsToResult</type>
+ <description/>
+ <distribute>Y</distribute>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <cluster_schema/>
+ <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
+ <xloc>775</xloc>
+ <yloc>69</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+
+ <step>
+ <name>Get Test Files</name>
+ <type>GetFileNames</type>
+ <description/>
+ <distribute>Y</distribute>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <filter>
+ <filterfiletype>only_files</filterfiletype>
+ </filter>
+ <rownum>N</rownum>
+ <isaddresult>N</isaddresult>
+ <filefield>Y</filefield>
+ <rownum_field/>
+ <filename_Field>dir</filename_Field>
+ <wildcard_Field>wildcard</wildcard_Field>
+ <exclude_wildcard_Field/>
+ <dynamic_include_subfolders>N</dynamic_include_subfolders>
+ <limit>0</limit>
+ <file>
+ <name/>
+ <filemask/>
+ <exclude_filemask/>
+ <file_required>N</file_required>
+ <include_subfolders>N</include_subfolders>
+ </file>
+ <cluster_schema/>
+ <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
+ <xloc>508</xloc>
+ <yloc>69</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+
+ <step>
+ <name>Get Test Folders</name>
+ <type>GetFileNames</type>
+ <description/>
+ <distribute>Y</distribute>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <filter>
+ <filterfiletype>only_folders</filterfiletype>
+ </filter>
+ <rownum>N</rownum>
+ <isaddresult>N</isaddresult>
+ <filefield>N</filefield>
+ <rownum_field/>
+ <filename_Field/>
+ <wildcard_Field/>
+ <exclude_wildcard_Field/>
+ <dynamic_include_subfolders>N</dynamic_include_subfolders>
+ <limit>0</limit>
+ <file>
+ <name>${Internal.Transformation.Filename.Directory}</name>
+ <filemask>.*</filemask>
+ <exclude_filemask/>
+ <file_required>N</file_required>
+ <include_subfolders>Y</include_subfolders>
+ </file>
+ <cluster_schema/>
+ <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
+ <xloc>90</xloc>
+ <yloc>69</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+
+ <step>
+ <name>extract dir</name>
+ <type>SelectValues</type>
+ <description/>
+ <distribute>Y</distribute>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <fields> <field> <name>filename</name>
+ <rename>dir</rename>
+ <length>-2</length>
+ <precision>-2</precision>
+ </field> <select_unspecified>N</select_unspecified>
+ </fields> <cluster_schema/>
+ <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
+ <xloc>225</xloc>
+ <yloc>69</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+
+ <step>
+ <name>extract filename</name>
+ <type>SelectValues</type>
+ <description/>
+ <distribute>Y</distribute>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <fields> <field> <name>filename</name>
+ <rename/>
+ <length>-2</length>
+ <precision>-2</precision>
+ </field> <select_unspecified>N</select_unspecified>
+ </fields> <cluster_schema/>
+ <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
+ <xloc>645</xloc>
+ <yloc>69</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+
+ <step_error_handling>
+ </step_error_handling>
+ <slave-step-copy-partition-distribution>
+</slave-step-copy-partition-distribution>
+ <slave_transformation>N</slave_transformation>
+</transformation>
View
4 test/org/typeexit/kettle/plugin/steps/ruby/files/tests/lazy_conversion/input.txt
@@ -0,0 +1,4 @@
+text
+alpha
+beta
+gamma
View
162 test/org/typeexit/kettle/plugin/steps/ruby/files/tests/lazy_conversion/lazy_conversion.ktr
@@ -0,0 +1,162 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<transformation>
+ <info>
+ <name>Test Lazy Conversion Support</name>
+ <description/>
+ <extended_description/>
+ <trans_version/>
+ <trans_type>Normal</trans_type>
+ <trans_status>0</trans_status>
+ <directory>&#47;</directory>
+ <parameters>
+ </parameters>
+ <log>
+<trans-log-table><connection/>
+<schema/>
+<table/>
+<size_limit_lines/>
+<interval/>
+<timeout_days/>
+<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STATUS</id><enabled>Y</enabled><name>STATUS</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name><subject/></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name><subject/></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name><subject/></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name><subject/></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name><subject/></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name><subject/></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>STARTDATE</id><enabled>Y</enabled><name>STARTDATE</name></field><field><id>ENDDATE</id><enabled>Y</enabled><name>ENDDATE</name></field><field><id>LOGDATE</id><enabled>Y</enabled><name>LOGDATE</name></field><field><id>DEPDATE</id><enabled>Y</enabled><name>DEPDATE</name></field><field><id>REPLAYDATE</id><enabled>Y</enabled><name>REPLAYDATE</name></field><field><id>LOG_FIELD</id><enabled>Y</enabled><name>LOG_FIELD</name></field></trans-log-table>
+<perf-log-table><connection/>
+<schema/>
+<table/>
+<interval/>
+<timeout_days/>
+<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>SEQ_NR</id><enabled>Y</enabled><name>SEQ_NR</name></field><field><id>LOGDATE</id><enabled>Y</enabled><name>LOGDATE</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STEPNAME</id><enabled>Y</enabled><name>STEPNAME</name></field><field><id>STEP_COPY</id><enabled>Y</enabled><name>STEP_COPY</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>INPUT_BUFFER_ROWS</id><enabled>Y</enabled><name>INPUT_BUFFER_ROWS</name></field><field><id>OUTPUT_BUFFER_ROWS</id><enabled>Y</enabled><name>OUTPUT_BUFFER_ROWS</name></field></perf-log-table>
+<channel-log-table><connection/>
+<schema/>
+<table/>
+<timeout_days/>
+<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>LOGGING_OBJECT_TYPE</id><enabled>Y</enabled><name>LOGGING_OBJECT_TYPE</name></field><field><id>OBJECT_NAME</id><enabled>Y</enabled><name>OBJECT_NAME</name></field><field><id>OBJECT_COPY</id><enabled>Y</enabled><name>OBJECT_COPY</name></field><field><id>REPOSITORY_DIRECTORY</id><enabled>Y</enabled><name>REPOSITORY_DIRECTORY</name></field><field><id>FILENAME</id><enabled>Y</enabled><name>FILENAME</name></field><field><id>OBJECT_ID</id><enabled>Y</enabled><name>OBJECT_ID</name></field><field><id>OBJECT_REVISION</id><enabled>Y</enabled><name>OBJECT_REVISION</name></field><field><id>PARENT_CHANNEL_ID</id><enabled>Y</enabled><name>PARENT_CHANNEL_ID</name></field><field><id>ROOT_CHANNEL_ID</id><enabled>Y</enabled><name>ROOT_CHANNEL_ID</name></field></channel-log-table>
+<step-log-table><connection/>
+<schema/>
+<table/>
+<timeout_days/>
+<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STEPNAME</id><enabled>Y</enabled><name>STEPNAME</name></field><field><id>STEP_COPY</id><enabled>Y</enabled><name>STEP_COPY</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>LOG_FIELD</id><enabled>N</enabled><name>LOG_FIELD</name></field></step-log-table>
+ </log>
+ <maxdate>
+ <connection/>
+ <table/>
+ <field/>
+ <offset>0.0</offset>
+ <maxdiff>0.0</maxdiff>
+ </maxdate>
+ <size_rowset>10000</size_rowset>
+ <sleep_time_empty>50</sleep_time_empty>
+ <sleep_time_full>50</sleep_time_full>
+ <unique_connections>N</unique_connections>
+ <feedback_shown>Y</feedback_shown>
+ <feedback_size>50000</feedback_size>
+ <using_thread_priorities>Y</using_thread_priorities>
+ <shared_objects_file/>
+ <capture_step_performance>N</capture_step_performance>
+ <step_performance_capturing_delay>1000</step_performance_capturing_delay>
+ <step_performance_capturing_size_limit>100</step_performance_capturing_size_limit>
+ <dependencies>
+ </dependencies>
+ <partitionschemas>
+ </partitionschemas>
+ <slaveservers>
+ </slaveservers>
+ <clusterschemas>
+ </clusterschemas>
+ <created_user>-</created_user>
+ <created_date>2011&#47;03&#47;19 18:32:24.549</created_date>
+ <modified_user>-</modified_user>
+ <modified_date>2011&#47;03&#47;19 18:32:24.549</modified_date>
+ </info>
+ <notepads>
+ </notepads>
+ <order>
+ <hop> <from>CSV file input</from><to>Ruby Scripting</to><enabled>Y</enabled> </hop> </order>
+ <step>
+ <name>CSV file input</name>
+ <type>CsvInput</type>
+ <description/>
+ <distribute>Y</distribute>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <filename>${Internal.Transformation.Filename.Directory}&#47;input.txt</filename>
+ <filename_field/>
+ <rownum_field/>
+ <include_filename>N</include_filename>
+ <separator>,</separator>
+ <enclosure>&quot;</enclosure>
+ <header>Y</header>
+ <buffer_size>50000</buffer_size>
+ <lazy_conversion>Y</lazy_conversion>
+ <add_filename_result>N</add_filename_result>
+ <parallel>N</parallel>
+ <encoding>UTF-8</encoding>
+ <fields>
+ <field>
+ <name>text</name>
+ <type>String</type>
+ <format/>
+ <currency>$</currency>
+ <decimal>.</decimal>
+ <group>,</group>
+ <length>-1</length>
+ <precision>-1</precision>
+ <trim_type>none</trim_type>
+ </field>
+ </fields>
+ <cluster_schema/>
+ <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
+ <xloc>106</xloc>
+ <yloc>120</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+
+ <step>
+ <name>Ruby Scripting</name>
+ <type>TypeExitRubyStep</type>
+ <description/>
+ <distribute>Y</distribute>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <scripts>
+ <script>
+ <title>Ruby Script</title>
+ <body># your script goes here
+
+raise &quot;unexpected value&quot; if ![&apos;alpha&apos;,&apos;beta&apos;,&apos;gamma&apos;].member? $row[&quot;text&quot;]
+
+$row</body>
+ <role>ROW_SCRIPT</role>
+ </script>
+ </scripts>
+ <rubyVersion>RUBY_1_8</rubyVersion>
+ <clearInputFields>N</clearInputFields>
+
+ <outputFields>
+ </outputFields>
+ <rubyVariables>
+ </rubyVariables>
+ <infoSteps>
+ </infoSteps>
+ <targetSteps>
+ </targetSteps>
+ <gemHome/>
+ <cluster_schema/>
+ <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
+ <xloc>249</xloc>
+ <yloc>119</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+
+ <step_error_handling>
+ </step_error_handling>
+ <slave-step-copy-partition-distribution>
+</slave-step-copy-partition-distribution>
+ <slave_transformation>N</slave_transformation>
+</transformation>
View
164 test/org/typeexit/kettle/plugin/steps/ruby/files/tests/run_all_tests.kjb
@@ -0,0 +1,164 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<job>
+ <name>Run All Tests</name>
+ <description/>
+ <extended_description/>
+ <job_version/>
+ <job_status>0</job_status>
+ <directory>&#47;</directory>
+ <created_user>-</created_user>
+ <created_date>2011&#47;02&#47;21 15:42:55.917</created_date>
+ <modified_user>-</modified_user>
+ <modified_date>2011&#47;02&#47;21 15:42:55.917</modified_date>
+ <parameters>
+ </parameters>
+ <slaveservers>
+ </slaveservers>
+<job-log-table><connection/>
+<schema/>
+<table/>
+<size_limit_lines/>
+<interval/>
+<timeout_days/>
+<field><id>ID_JOB</id><enabled>Y</enabled><name>ID_JOB</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>JOBNAME</id><enabled>Y</enabled><name>JOBNAME</name></field><field><id>STATUS</id><enabled>Y</enabled><name>STATUS</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>STARTDATE</id><enabled>Y</enabled><name>STARTDATE</name></field><field><id>ENDDATE</id><enabled>Y</enabled><name>ENDDATE</name></field><field><id>LOGDATE</id><enabled>Y</enabled><name>LOGDATE</name></field><field><id>DEPDATE</id><enabled>Y</enabled><name>DEPDATE</name></field><field><id>REPLAYDATE</id><enabled>Y</enabled><name>REPLAYDATE</name></field><field><id>LOG_FIELD</id><enabled>Y</enabled><name>LOG_FIELD</name></field></job-log-table>
+<jobentry-log-table><connection/>
+<schema/>
+<table/>
+<timeout_days/>
+<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>JOBNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>JOBENTRYNAME</id><enabled>Y</enabled><name>STEPNAME</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>RESULT</id><enabled>Y</enabled><name>RESULT</name></field><field><id>NR_RESULT_ROWS</id><enabled>Y</enabled><name>NR_RESULT_ROWS</name></field><field><id>NR_RESULT_FILES</id><enabled>Y</enabled><name>NR_RESULT_FILES</name></field><field><id>LOG_FIELD</id><enabled>N</enabled><name>LOG_FIELD</name></field></jobentry-log-table>
+<channel-log-table><connection/>
+<schema/>
+<table/>
+<timeout_days/>
+<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>LOGGING_OBJECT_TYPE</id><enabled>Y</enabled><name>LOGGING_OBJECT_TYPE</name></field><field><id>OBJECT_NAME</id><enabled>Y</enabled><name>OBJECT_NAME</name></field><field><id>OBJECT_COPY</id><enabled>Y</enabled><name>OBJECT_COPY</name></field><field><id>REPOSITORY_DIRECTORY</id><enabled>Y</enabled><name>REPOSITORY_DIRECTORY</name></field><field><id>FILENAME</id><enabled>Y</enabled><name>FILENAME</name></field><field><id>OBJECT_ID</id><enabled>Y</enabled><name>OBJECT_ID</name></field><field><id>OBJECT_REVISION</id><enabled>Y</enabled><name>OBJECT_REVISION</name></field><field><id>PARENT_CHANNEL_ID</id><enabled>Y</enabled><name>PARENT_CHANNEL_ID</name></field><field><id>ROOT_CHANNEL_ID</id><enabled>Y</enabled><name>ROOT_CHANNEL_ID</name></field></channel-log-table>
+ <pass_batchid>N</pass_batchid>
+ <shared_objects_file/>
+ <entries>
+ <entry>
+ <name>START</name>
+ <description/>
+ <type>SPECIAL</type>
+ <start>Y</start>
+ <dummy>N</dummy>
+ <repeat>N</repeat>
+ <schedulerType>0</schedulerType>
+ <intervalSeconds>0</intervalSeconds>
+ <intervalMinutes>60</intervalMinutes>
+ <hour>12</hour>
+ <minutes>0</minutes>
+ <weekDay>1</weekDay>
+ <DayOfMonth>1</DayOfMonth>
+ <parallel>N</parallel>
+ <draw>Y</draw>
+ <nr>0</nr>
+ <xloc>113</xloc>
+ <yloc>88</yloc>
+ </entry>
+ <entry>
+ <name>Find Test Files</name>
+ <description/>
+ <type>TRANS</type>
+ <specification_method>filename</specification_method>
+ <trans_object_id/>
+ <filename>${Internal.Job.Filename.Directory}&#47;find_all_test_files.ktr</filename>
+ <transname/>
+ <arg_from_previous>N</arg_from_previous>
+ <params_from_previous>N</params_from_previous>
+ <exec_per_row>N</exec_per_row>
+ <clear_rows>N</clear_rows>
+ <clear_files>N</clear_files>
+ <set_logfile>N</set_logfile>
+ <logfile/>
+ <logext/>
+ <add_date>N</add_date>
+ <add_time>N</add_time>
+ <loglevel>Basic</loglevel>
+ <cluster>N</cluster>
+ <slave_server_name/>
+ <set_append_logfile>N</set_append_logfile>
+ <wait_until_finished>Y</wait_until_finished>
+ <follow_abort_remote>N</follow_abort_remote>
+ <create_parent_folder>N</create_parent_folder>
+ <parameters> <pass_all_parameters>Y</pass_all_parameters>
+ </parameters> <parallel>N</parallel>
+ <draw>Y</draw>
+ <nr>0</nr>
+ <xloc>267</xloc>
+ <yloc>89</yloc>
+ </entry>
+ <entry>
+ <name>Run Test</name>
+ <description/>
+ <type>JOB</type>
+ <specification_method>filename</specification_method>
+ <job_object_id/>
+ <filename>${Internal.Job.Filename.Directory}&#47;run_test.kjb</filename>
+ <jobname/>
+ <arg_from_previous>N</arg_from_previous>
+ <params_from_previous>Y</params_from_previous>
+ <exec_per_row>Y</exec_per_row>
+ <set_logfile>N</set_logfile>
+ <logfile/>
+ <logext/>
+ <add_date>N</add_date>
+ <add_time>N</add_time>
+ <loglevel>Nothing</loglevel>
+ <slave_server_name/>
+ <wait_until_finished>Y</wait_until_finished>
+ <follow_abort_remote>N</follow_abort_remote>
+ <create_parent_folder>N</create_parent_folder>
+ <pass_export>N</pass_export>
+ <parameters> <pass_all_parameters>Y</pass_all_parameters>
+ <parameter> <name>filename</name>
+ <stream_name>filename</stream_name>
+ <value/>
+ </parameter> </parameters> <set_append_logfile>N</set_append_logfile>
+ <parallel>N</parallel>
+ <draw>Y</draw>
+ <nr>0</nr>
+ <xloc>417</xloc>
+ <yloc>89</yloc>
+ </entry>
+ <entry>
+ <name>Success</name>
+ <description/>
+ <type>SUCCESS</type>
+ <parallel>N</parallel>
+ <draw>Y</draw>
+ <nr>0</nr>
+ <xloc>548</xloc>
+ <yloc>90</yloc>
+ </entry>
+ </entries>
+ <hops>
+ <hop>
+ <from>START</from>
+ <to>Find Test Files</to>
+ <from_nr>0</from_nr>
+ <to_nr>0</to_nr>
+ <enabled>Y</enabled>
+ <evaluation>Y</evaluation>
+ <unconditional>Y</unconditional>
+ </hop>
+ <hop>
+ <from>Find Test Files</from>
+ <to>Run Test</to>
+ <from_nr>0</from_nr>
+ <to_nr>0</to_nr>
+ <enabled>Y</enabled>
+ <evaluation>Y</evaluation>
+ <unconditional>N</unconditional>
+ </hop>
+ <hop>
+ <from>Run Test</from>
+ <to>Success</to>
+ <from_nr>0</from_nr>
+ <to_nr>0</to_nr>
+ <enabled>Y</enabled>
+ <evaluation>Y</evaluation>
+ <unconditional>N</unconditional>
+ </hop>
+ </hops>
+ <notepads>
+ </notepads>
+</job>
View
149 test/org/typeexit/kettle/plugin/steps/ruby/files/tests/run_test.kjb
@@ -0,0 +1,149 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<job>
+ <name>Run Test</name>
+ <description/>
+ <extended_description/>
+ <job_version/>
+ <job_status>0</job_status>
+ <directory>&#47;</directory>
+ <created_user>-</created_user>
+ <created_date>2011&#47;02&#47;21 16:15:02.417</created_date>
+ <modified_user>-</modified_user>
+ <modified_date>2011&#47;02&#47;21 16:15:02.417</modified_date>
+ <parameters>
+ <parameter>
+ <name>filename</name>
+ <default_value>none</default_value>
+ <description/>
+ </parameter>
+ </parameters>
+ <slaveservers>
+ </slaveservers>
+<job-log-table><connection/>
+<schema/>
+<table/>
+<size_limit_lines/>
+<interval/>
+<timeout_days/>
+<field><id>ID_JOB</id><enabled>Y</enabled><name>ID_JOB</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>JOBNAME</id><enabled>Y</enabled><name>JOBNAME</name></field><field><id>STATUS</id><enabled>Y</enabled><name>STATUS</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>STARTDATE</id><enabled>Y</enabled><name>STARTDATE</name></field><field><id>ENDDATE</id><enabled>Y</enabled><name>ENDDATE</name></field><field><id>LOGDATE</id><enabled>Y</enabled><name>LOGDATE</name></field><field><id>DEPDATE</id><enabled>Y</enabled><name>DEPDATE</name></field><field><id>REPLAYDATE</id><enabled>Y</enabled><name>REPLAYDATE</name></field><field><id>LOG_FIELD</id><enabled>Y</enabled><name>LOG_FIELD</name></field></job-log-table>
+<jobentry-log-table><connection/>
+<schema/>
+<table/>
+<timeout_days/>
+<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>JOBNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>JOBENTRYNAME</id><enabled>Y</enabled><name>STEPNAME</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>RESULT</id><enabled>Y</enabled><name>RESULT</name></field><field><id>NR_RESULT_ROWS</id><enabled>Y</enabled><name>NR_RESULT_ROWS</name></field><field><id>NR_RESULT_FILES</id><enabled>Y</enabled><name>NR_RESULT_FILES</name></field><field><id>LOG_FIELD</id><enabled>N</enabled><name>LOG_FIELD</name></field></jobentry-log-table>
+<channel-log-table><connection/>
+<schema/>
+<table/>
+<timeout_days/>
+<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>LOGGING_OBJECT_TYPE</id><enabled>Y</enabled><name>LOGGING_OBJECT_TYPE</name></field><field><id>OBJECT_NAME</id><enabled>Y</enabled><name>OBJECT_NAME</name></field><field><id>OBJECT_COPY</id><enabled>Y</enabled><name>OBJECT_COPY</name></field><field><id>REPOSITORY_DIRECTORY</id><enabled>Y</enabled><name>REPOSITORY_DIRECTORY</name></field><field><id>FILENAME</id><enabled>Y</enabled><name>FILENAME</name></field><field><id>OBJECT_ID</id><enabled>Y</enabled><name>OBJECT_ID</name></field><field><id>OBJECT_REVISION</id><enabled>Y</enabled><name>OBJECT_REVISION</name></field><field><id>PARENT_CHANNEL_ID</id><enabled>Y</enabled><name>PARENT_CHANNEL_ID</name></field><field><id>ROOT_CHANNEL_ID</id><enabled>Y</enabled><name>ROOT_CHANNEL_ID</name></field></channel-log-table>
+ <pass_batchid>N</pass_batchid>
+ <shared_objects_file/>
+ <entries>
+ <entry>
+ <name>START</name>
+ <description/>
+ <type>SPECIAL</type>
+ <start>Y</start>
+ <dummy>N</dummy>
+ <repeat>N</repeat>
+ <schedulerType>0</schedulerType>
+ <intervalSeconds>0</intervalSeconds>
+ <intervalMinutes>60</intervalMinutes>
+ <hour>12</hour>
+ <minutes>0</minutes>
+ <weekDay>1</weekDay>
+ <DayOfMonth>1</DayOfMonth>
+ <parallel>N</parallel>
+ <draw>Y</draw>
+ <nr>0</nr>
+ <xloc>127</xloc>
+ <yloc>134</yloc>
+ </entry>
+ <entry>
+ <name>Run Test</name>
+ <description/>
+ <type>TRANS</type>
+ <specification_method>filename</specification_method>
+ <trans_object_id/>
+ <filename>${filename}</filename>
+ <transname/>
+ <arg_from_previous>N</arg_from_previous>
+ <params_from_previous>N</params_from_previous>
+ <exec_per_row>N</exec_per_row>
+ <clear_rows>N</clear_rows>
+ <clear_files>N</clear_files>
+ <set_logfile>N</set_logfile>
+ <logfile/>
+ <logext/>
+ <add_date>N</add_date>
+ <add_time>N</add_time>
+ <loglevel>Basic</loglevel>
+ <cluster>N</cluster>
+ <slave_server_name/>
+ <set_append_logfile>N</set_append_logfile>
+ <wait_until_finished>Y</wait_until_finished>
+ <follow_abort_remote>N</follow_abort_remote>
+ <create_parent_folder>N</create_parent_folder>
+ <parameters> <pass_all_parameters>Y</pass_all_parameters>
+ </parameters> <parallel>N</parallel>
+ <draw>Y</draw>
+ <nr>0</nr>
+ <xloc>360</xloc>
+ <yloc>134</yloc>
+ </entry>
+ <entry>
+ <name>Success</name>
+ <description/>
+ <type>SUCCESS</type>
+ <parallel>N</parallel>
+ <draw>Y</draw>
+ <nr>0</nr>
+ <xloc>473</xloc>
+ <yloc>134</yloc>
+ </entry>
+ <entry>
+ <name>Write To Log</name>
+ <description/>
+ <type>WRITE_TO_LOG</type>
+ <logmessage>${filename}</logmessage>
+ <loglevel>Minimal</loglevel>
+ <logsubject>Running Test:</logsubject>
+ <parallel>N</parallel>
+ <draw>Y</draw>
+ <nr>0</nr>
+ <xloc>243</xloc>
+ <yloc>135</yloc>
+ </entry>
+ </entries>
+ <hops>
+ <hop>
+ <from>Run Test</from>
+ <to>Success</to>
+ <from_nr>0</from_nr>
+ <to_nr>0</to_nr>
+ <enabled>Y</enabled>
+ <evaluation>Y</evaluation>
+ <unconditional>N</unconditional>
+ </hop>
+ <hop>
+ <from>START</from>
+ <to>Write To Log</to>
+ <from_nr>0</from_nr>
+ <to_nr>0</to_nr>
+ <enabled>Y</enabled>
+ <evaluation>Y</evaluation>
+ <unconditional>Y</unconditional>
+ </hop>
+ <hop>
+ <from>Write To Log</from>
+ <to>Run Test</to>
+ <from_nr>0</from_nr>
+ <to_nr>0</to_nr>
+ <enabled>Y</enabled>
+ <evaluation>Y</evaluation>
+ <unconditional>N</unconditional>
+ </hop>
+ </hops>
+ <notepads>
+ </notepads>
+</job>

0 comments on commit 0013843

Please sign in to comment.