Skip to content

Commit

Permalink
Create an integration test to deserialize all actions and
Browse files Browse the repository at this point in the history
transforms #4630
  • Loading branch information
nadment authored and hansva committed Nov 28, 2024
1 parent baad601 commit f7e60b7
Show file tree
Hide file tree
Showing 5 changed files with 5,924 additions and 0 deletions.
141 changes: 141 additions & 0 deletions integration-tests/deserialize/0001-deserialize.hpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<pipeline>
<info>
<name>0001-deserialize</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>2024/11/27 21:06:36.984</created_date>
<modified_user>-</modified_user>
<modified_date>2024/11/27 21:06:36.984</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Generate rows</from>
<to>Test deserialize</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Generate rows</name>
<type>RowGenerator</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<fields>
<field>
<length>-1</length>
<name>TEST</name>
<precision>-1</precision>
<set_empty_string>N</set_empty_string>
<type>String</type>
</field>
</fields>
<interval_in_ms>5000</interval_in_ms>
<last_time_field>FiveSecondsAgo</last_time_field>
<limit>1</limit>
<never_ending>N</never_ending>
<row_time_field>now</row_time_field>
<attributes/>
<GUI>
<xloc>256</xloc>
<yloc>128</yloc>
</GUI>
</transform>
<transform>
<name>Test deserialize</name>
<type>UserDefinedJavaClass</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<definitions>
<definition>
<class_type>TRANSFORM_CLASS</class_type>
<class_name>Processor</class_name>
<class_source>import org.apache.hop.pipeline.engine.IPipelineEngine;


// Perform the equivalent of processing one row.
public boolean processRow() throws HopException {

IPipelineEngine pipeline = getPipeline();

String workflowPath = pipeline.resolve("${PROJECT_HOME}/all-actions.hwf");

// Load the workflow from file
try {
WorkflowMeta workflowMeta = new WorkflowMeta(pipeline, workflowPath, pipeline.getMetadataProvider());
} catch(Exception e) {
throw new HopException(e.getMessage());
}

String pipelinePath = pipeline.resolve("${PROJECT_HOME}/all-transforms.hpl");

// Load the pipeline from file
try {
WorkflowMeta workflowMeta = new WorkflowMeta(pipeline, pipelinePath, pipeline.getMetadataProvider());
} catch(Exception e) {
throw new HopException(e.getMessage());
}


return false;
}

</class_source>
</definition>
</definitions>
<fields>
</fields>
<clear_result_fields>N</clear_result_fields>
<info_transforms/>
<target_transforms/>
<usage_parameters/>
<attributes/>
<GUI>
<xloc>480</xloc>
<yloc>128</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>
Loading

0 comments on commit f7e60b7

Please sign in to comment.