ResultSetCompareTest_error2.xaction 2.82 KB
Newer Older
Thitichaipun Wutthisak committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
<?xml version="1.0" encoding="UTF-8"?>
<action-sequence> 
  <title>Test Resultset Compare Error 1</title>
  <version>1</version>
  <logging-level>ERROR</logging-level>
  <documentation> 
    <author>Marc Batchelor</author>  
    <description>Thie action tests the resultset compare utility - Error 1 Path</description>  
    <help/>  
    <result-type>rule</result-type>  
    <icon/> 
  </documentation>

  <inputs/>

  <outputs> 
    <COMPARERESULT type="string"/> 
  </outputs>

  <resources/>
  
  <actions> 
    <action-definition> 
      <component-name>JavascriptRule</component-name>
      <action-type>rule</action-type>
      <action-inputs/>
      <action-outputs> 
        <rs1 type="list"/> 
      </action-outputs>
      <component-definition> 
        <script><![CDATA[ 
              var rs1 = new JavaScriptResultSet();
              rs1.setColumnHeaders( 'REGION');
              rs1.addRow( new Array( 'Central' ) );
              rs1.addRow( new Array( 'Eastern' ) ); // Won't compare here...
              rs1.addRow( new Array( 'Western' ) );
              rs1.addRow( new Array( 'Southern' ) );
		      ]]> </script> 
      </component-definition> 
    </action-definition>
  
    <action-definition> 
      <component-name>JavascriptRule</component-name>
      <action-type>rule</action-type>
      <action-inputs/>
      <action-outputs> 
        <rs2 type="list"/> 
      </action-outputs>
      <component-definition> 
        <script><![CDATA[ 
              var rs2 = new JavaScriptResultSet();
              rs2.setColumnHeaders( 'REGION');
              rs2.addRow( new Array( 'Central' ) );
              rs2.addRow( new Array( 'Western' ) );
              rs2.addRow( new Array( 'East' ) ); // Won't compare here...
              rs2.addRow( new Array( 'Southern' ) );
		      ]]> </script> 
      </component-definition> 
    </action-definition>
  
    <action-definition> 
      <component-name>org.pentaho.plugin.core.ResultSetCompareComponent</component-name>
      <action-inputs> 
        <result-set-from type="list" mapping="rs1"/>  
        <result-set-to type="list" mapping="rs2"/> 
      </action-inputs>
      <action-outputs> 
        <COMPARERESULT type="string"/> 
      </action-outputs>
      <component-definition> 
        <output_mismatches>true</output_mismatches>  
        <!-- Show mismatches in the error log -->  
        <stop-on-error><![CDATA[true]]></stop-on-error>  
        <!-- Don't error out if we have errors. We'll display them down lower -->  
        <compare-result>COMPARERESULT</compare-result>  
        <!-- Will contain "No Mismatches" if everything was good. Otherwise, will have the list of bad rates -->  
        <compare-column>0</compare-column>  
        <!-- What column in the result sets to compare --> 
      </component-definition> 
    </action-definition>
 
  </actions> 
</action-sequence>