Skip to content
Permalink
Browse files
Merge pull request #841 from mattcasters/master
HOP-2918 : Create transform integration tests: Replace in string
  • Loading branch information
mattcasters committed Jun 1, 2021
2 parents 7fc7858 + 2e42289 commit 9b509d9fadd165b9c3521c0e630b43e8617cbbf3
Showing 10 changed files with 407 additions and 22 deletions.
@@ -16,7 +16,7 @@
<created_date>2021/06/01 17:40:11.867</created_date>
<modified_user>-</modified_user>
<modified_date>2021/06/01 17:40:11.867</modified_date>
<key_for_session_key/>
<key_for_session_key>H4sIAAAAAAAAAAMAAAAAAAAAAAA=</key_for_session_key>
<is_key_private>N</is_key_private>
</info>
<notepads>
@@ -68,6 +68,23 @@
<yloc>128</yloc>
</GUI>
</transform>
<transform>
<name>Preview</name>
<type>Dummy</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<attributes/>
<GUI>
<xloc>416</xloc>
<yloc>128</yloc>
</GUI>
</transform>
<transform>
<name>Sample data</name>
<type>DataGrid</type>
@@ -157,23 +174,6 @@
<yloc>128</yloc>
</GUI>
</transform>
<transform>
<name>Preview</name>
<type>Dummy</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<attributes/>
<GUI>
<xloc>416</xloc>
<yloc>128</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
@@ -0,0 +1,236 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>0026-replace-in-string</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
<pipeline_version/>
<pipeline_type>Normal</pipeline_type>
<parameters>
</parameters>
<capture_transform_performance>N</capture_transform_performance>
<transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
<transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
<created_user>-</created_user>
<created_date>2021/06/01 17:40:11.867</created_date>
<modified_user>-</modified_user>
<modified_date>2021/06/01 17:40:11.867</modified_date>
<key_for_session_key>H4sIAAAAAAAAAAMAAAAAAAAAAAA=</key_for_session_key>
<is_key_private>N</is_key_private>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Sample data</from>
<to>Replace in string</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Replace in string</from>
<to>Preview</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Preview</name>
<type>Dummy</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<attributes/>
<GUI>
<xloc>432</xloc>
<yloc>112</yloc>
</GUI>
</transform>
<transform>
<name>Replace in string</name>
<type>ReplaceString</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<fields>
<field>
<in_stream_name>strA</in_stream_name>
<out_stream_name/>
<use_regex>no</use_regex>
<replace_string>HOP</replace_string>
<replace_by_string> Apache Hop </replace_by_string>
<set_empty_string>N</set_empty_string>
<replace_field_by_string/>
<whole_word>no</whole_word>
<case_sensitive>no</case_sensitive>
<is_unicode>no</is_unicode>
</field>
<field>
<in_stream_name>strB</in_stream_name>
<out_stream_name/>
<use_regex>yes</use_regex>
<replace_string>\s*</replace_string>
<replace_by_string> </replace_by_string>
<set_empty_string>N</set_empty_string>
<replace_field_by_string/>
<whole_word>no</whole_word>
<case_sensitive>no</case_sensitive>
<is_unicode>no</is_unicode>
</field>
<field>
<in_stream_name>strB</in_stream_name>
<out_stream_name/>
<use_regex>yes</use_regex>
<replace_string>^\s</replace_string>
<replace_by_string/>
<set_empty_string>N</set_empty_string>
<replace_field_by_string/>
<whole_word>no</whole_word>
<case_sensitive>no</case_sensitive>
<is_unicode>no</is_unicode>
</field>
<field>
<in_stream_name>strA</in_stream_name>
<out_stream_name/>
<use_regex>yes</use_regex>
<replace_string>\s</replace_string>
<replace_by_string/>
<set_empty_string>N</set_empty_string>
<replace_field_by_string/>
<whole_word>no</whole_word>
<case_sensitive>no</case_sensitive>
<is_unicode>no</is_unicode>
</field>
<field>
<in_stream_name>strC</in_stream_name>
<out_stream_name/>
<use_regex>yes</use_regex>
<replace_string>[cioksx]</replace_string>
<replace_by_string/>
<set_empty_string>N</set_empty_string>
<replace_field_by_string/>
<whole_word>no</whole_word>
<case_sensitive>no</case_sensitive>
<is_unicode>no</is_unicode>
</field>
<field>
<in_stream_name>strD</in_stream_name>
<out_stream_name/>
<use_regex>yes</use_regex>
<replace_string>[CIOKSX]</replace_string>
<replace_by_string/>
<set_empty_string>N</set_empty_string>
<replace_field_by_string/>
<whole_word>no</whole_word>
<case_sensitive>no</case_sensitive>
<is_unicode>no</is_unicode>
</field>
</fields>
<attributes/>
<GUI>
<xloc>272</xloc>
<yloc>112</yloc>
</GUI>
</transform>
<transform>
<name>Sample data</name>
<type>DataGrid</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<fields>
<field>
<name>strA</name>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<set_empty_string>N</set_empty_string>
</field>
<field>
<name>strB</name>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<set_empty_string>N</set_empty_string>
</field>
<field>
<name>strC</name>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<set_empty_string>N</set_empty_string>
</field>
<field>
<name>strD</name>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<set_empty_string>N</set_empty_string>
</field>
</fields>
<data>
<line>
<item>sadfsadfHOPsdfjasdf</item>
<item>a b c d e f</item>
<item>abcdef</item>
<item>ABCDEF</item>
</line>
<line>
<item>HOPsdsadfasdf</item>
<item>g h i j k l</item>
<item>ghijkl</item>
<item>GHIJKL</item>
</line>
<line>
<item>asdlfsdfHOP</item>
<item>m n o p q r </item>
<item>mnopqr</item>
<item>MNOPQR</item>
</line>
<line>
<item>HOP</item>
<item> s t u v w x </item>
<item>stuvwx</item>
<item>STUVWX</item>
</line>
</data>
<attributes/>
<GUI>
<xloc>112</xloc>
<yloc>112</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>
@@ -0,0 +1,5 @@
strA,strB,strC,strD
sadfsadfApacheHopsdfjasdf,"a b c d e f ",abdef,ABDEF
ApacheHopsdsadfasdf,"g h i j k l ",ghjl,GHJL
asdlfsdfApacheHop,"m n o p q r ",mnpqr,MNPQR
ApacheHop," s t u v w x ",tuvw,TUVW
@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8"?>
<workflow>
<name>main-0026-replace-in-string</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
<workflow_version/>
<created_user>-</created_user>
<created_date>2021/06/01 17:45:49.992</created_date>
<modified_user>-</modified_user>
<modified_date>2021/06/01 17:45:49.992</modified_date>
<parameters>
</parameters>
<actions>
<action>
<name>Start</name>
<description/>
<type>SPECIAL</type>
<attributes/>
<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>
<xloc>128</xloc>
<yloc>80</yloc>
<attributes_hac/>
</action>
<action>
<name>Run Replace in string Tests</name>
<description/>
<type>RunPipelineTests</type>
<attributes/>
<test_names>
<test_name>
<name>0026-replace-in-string UNIT</name>
</test_name>
</test_names>
<parallel>N</parallel>
<xloc>336</xloc>
<yloc>80</yloc>
<attributes_hac/>
</action>
</actions>
<hops>
<hop>
<from>Start</from>
<to>Run Replace in string Tests</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>Y</unconditional>
</hop>
</hops>
<notepads>
</notepads>
<attributes/>
</workflow>

0 comments on commit 9b509d9

Please sign in to comment.