This is an automated email from the ASF dual-hosted git repository.
hansva pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/hop.git
The following commit(s) were added to refs/heads/main by this push:
new 346901b5ce Issue #1965 (Delete Result Filenames action code cleanup
and IT) (#6936)
346901b5ce is described below
commit 346901b5ce8d6e530c7f393f1d6067d982f132fb
Author: Matt Casters <[email protected]>
AuthorDate: Thu Apr 2 16:16:37 2026 +0200
Issue #1965 (Delete Result Filenames action code cleanup and IT) (#6936)
---
.../actions/main-0016-delete-result-files.hwf | 193 +++++++++++++++++++++
.../ActionDeleteResultFilenames.java | 185 +++++++-------------
.../ActionDeleteResultFilenamesDialog.java | 34 ++--
.../ActionDeleteResultFilenamesTest.java | 37 ++++
.../WorkflowActionDeleteResultFilenamesTest.java | 58 -------
.../test/resources/action-delete-result-files.xml | 24 +++
6 files changed, 327 insertions(+), 204 deletions(-)
diff --git a/integration-tests/actions/main-0016-delete-result-files.hwf
b/integration-tests/actions/main-0016-delete-result-files.hwf
new file mode 100644
index 0000000000..d1c4859dcb
--- /dev/null
+++ b/integration-tests/actions/main-0016-delete-result-files.hwf
@@ -0,0 +1,193 @@
+<?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.
+
+-->
+<workflow>
+ <name>main-0016-delete-result-files</name>
+ <name_sync_with_filename>Y</name_sync_with_filename>
+ <description/>
+ <extended_description/>
+ <workflow_version/>
+ <created_user>-</created_user>
+ <created_date>2026/04/02 14:40:08.298</created_date>
+ <modified_user>-</modified_user>
+ <modified_date>2026/04/02 14:40:08.298</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>
+ <DayOfMonth>1</DayOfMonth>
+ <weekDay>1</weekDay>
+ <minutes>0</minutes>
+ <hour>12</hour>
+ <doNotWaitOnFirstExecution>N</doNotWaitOnFirstExecution>
+ <parallel>N</parallel>
+ <xloc>96</xloc>
+ <yloc>64</yloc>
+ <attributes_hac/>
+ </action>
+ <action>
+ <name>/tmp/0016/file1.txt</name>
+ <description/>
+ <type>CREATE_FILE</type>
+ <attributes/>
+ <filename>${java.io.tmpdir}/0016/file1.txt</filename>
+ <fail_if_file_exists>N</fail_if_file_exists>
+ <add_filename_result>Y</add_filename_result>
+ <parallel>N</parallel>
+ <xloc>464</xloc>
+ <yloc>64</yloc>
+ <attributes_hac/>
+ </action>
+ <action>
+ <name>mkdir /tmp/0016/</name>
+ <description/>
+ <type>CREATE_FOLDER</type>
+ <attributes/>
+ <foldername>${java.io.tmpdir}/0016/</foldername>
+ <fail_of_folder_exists>N</fail_of_folder_exists>
+ <parallel>N</parallel>
+ <xloc>272</xloc>
+ <yloc>64</yloc>
+ <attributes_hac/>
+ </action>
+ <action>
+ <name>/tmp/0016/file2.txt</name>
+ <description/>
+ <type>CREATE_FILE</type>
+ <attributes/>
+ <filename>${java.io.tmpdir}/0016/file2.txt</filename>
+ <fail_if_file_exists>N</fail_if_file_exists>
+ <add_filename_result>Y</add_filename_result>
+ <parallel>N</parallel>
+ <xloc>672</xloc>
+ <yloc>64</yloc>
+ <attributes_hac/>
+ </action>
+ <action>
+ <name>Delete filenames from result</name>
+ <description/>
+ <type>DELETE_RESULT_FILENAMES</type>
+ <attributes/>
+ <foldername/>
+ <specify_wildcard>N</specify_wildcard>
+ <wildcard/>
+ <wildcardexclude/>
+ <parallel>N</parallel>
+ <xloc>272</xloc>
+ <yloc>160</yloc>
+ <attributes_hac/>
+ </action>
+ <action>
+ <name>/tmp/0016/file3.txt</name>
+ <description/>
+ <type>CREATE_FILE</type>
+ <attributes/>
+ <filename>${java.io.tmpdir}/0016/file3.txt</filename>
+ <fail_if_file_exists>N</fail_if_file_exists>
+ <add_filename_result>Y</add_filename_result>
+ <parallel>N</parallel>
+ <xloc>848</xloc>
+ <yloc>64</yloc>
+ <attributes_hac/>
+ </action>
+ <action>
+ <name>No more result files?</name>
+ <description/>
+ <type>EVAL</type>
+ <attributes/>
+ <script>previous_result.getResultFilesList().isEmpty()</script>
+ <parallel>N</parallel>
+ <xloc>464</xloc>
+ <yloc>160</yloc>
+ <attributes_hac/>
+ </action>
+ <action>
+ <name>Success</name>
+ <description/>
+ <type>SUCCESS</type>
+ <attributes/>
+ <parallel>N</parallel>
+ <xloc>672</xloc>
+ <yloc>160</yloc>
+ <attributes_hac/>
+ </action>
+ </actions>
+ <hops>
+ <hop>
+ <from>Start</from>
+ <to>mkdir /tmp/0016/</to>
+ <enabled>Y</enabled>
+ <evaluation>Y</evaluation>
+ <unconditional>Y</unconditional>
+ </hop>
+ <hop>
+ <from>mkdir /tmp/0016/</from>
+ <to>/tmp/0016/file1.txt</to>
+ <enabled>Y</enabled>
+ <evaluation>Y</evaluation>
+ <unconditional>N</unconditional>
+ </hop>
+ <hop>
+ <from>/tmp/0016/file1.txt</from>
+ <to>/tmp/0016/file2.txt</to>
+ <enabled>Y</enabled>
+ <evaluation>Y</evaluation>
+ <unconditional>N</unconditional>
+ </hop>
+ <hop>
+ <from>/tmp/0016/file2.txt</from>
+ <to>/tmp/0016/file3.txt</to>
+ <enabled>Y</enabled>
+ <evaluation>Y</evaluation>
+ <unconditional>N</unconditional>
+ </hop>
+ <hop>
+ <from>/tmp/0016/file3.txt</from>
+ <to>Delete filenames from result</to>
+ <enabled>Y</enabled>
+ <evaluation>Y</evaluation>
+ <unconditional>N</unconditional>
+ </hop>
+ <hop>
+ <from>Delete filenames from result</from>
+ <to>No more result files?</to>
+ <enabled>Y</enabled>
+ <evaluation>Y</evaluation>
+ <unconditional>N</unconditional>
+ </hop>
+ <hop>
+ <from>No more result files?</from>
+ <to>Success</to>
+ <enabled>Y</enabled>
+ <evaluation>Y</evaluation>
+ <unconditional>N</unconditional>
+ </hop>
+ </hops>
+ <notepads>
+ </notepads>
+ <attributes/>
+</workflow>
diff --git
a/plugins/actions/deleteresultfilenames/src/main/java/org/apache/hop/workflow/actions/deleteresultfilenames/ActionDeleteResultFilenames.java
b/plugins/actions/deleteresultfilenames/src/main/java/org/apache/hop/workflow/actions/deleteresultfilenames/ActionDeleteResultFilenames.java
index 0faf1e46df..00a420e735 100644
---
a/plugins/actions/deleteresultfilenames/src/main/java/org/apache/hop/workflow/actions/deleteresultfilenames/ActionDeleteResultFilenames.java
+++
b/plugins/actions/deleteresultfilenames/src/main/java/org/apache/hop/workflow/actions/deleteresultfilenames/ActionDeleteResultFilenames.java
@@ -21,16 +21,17 @@ import java.util.Iterator;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import lombok.Getter;
+import lombok.Setter;
import org.apache.commons.vfs2.FileObject;
import org.apache.hop.core.ICheckResult;
import org.apache.hop.core.Result;
import org.apache.hop.core.ResultFile;
import org.apache.hop.core.annotations.Action;
-import org.apache.hop.core.exception.HopXmlException;
import org.apache.hop.core.util.Utils;
import org.apache.hop.core.variables.IVariables;
-import org.apache.hop.core.xml.XmlHandler;
import org.apache.hop.i18n.BaseMessages;
+import org.apache.hop.metadata.api.HopMetadataProperty;
import org.apache.hop.metadata.api.IHopMetadataProvider;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.ActionBase;
@@ -39,7 +40,6 @@ import
org.apache.hop.workflow.action.validator.AbstractFileValidator;
import org.apache.hop.workflow.action.validator.ActionValidatorUtils;
import org.apache.hop.workflow.action.validator.AndValidator;
import org.apache.hop.workflow.action.validator.ValidatorContext;
-import org.w3c.dom.Node;
/**
* This defines a 'deleteresultfilenames' action. Its main use would be to
create empty folder that
@@ -53,18 +53,22 @@ import org.w3c.dom.Node;
categoryDescription =
"i18n:org.apache.hop.workflow:ActionCategory.Category.FileManagement",
keywords = "i18n::ActionDeleteResultFilenames.keyword",
documentationUrl = "/workflow/actions/deleteresultfilenames.html")
+@Getter
+@Setter
public class ActionDeleteResultFilenames extends ActionBase implements
Cloneable, IAction {
private static final Class<?> PKG = ActionDeleteResultFilenames.class;
- private static final String CONST_SPACE_SHORT = " ";
- private String folderName;
+ @HopMetadataProperty(key = "specify_wildcard")
private boolean specifyWildcard;
+
+ @HopMetadataProperty(key = "wildcard")
private String wildcard;
+
+ @HopMetadataProperty(key = "wildcardexclude")
private String wildcardExclude;
public ActionDeleteResultFilenames(String n) {
super(n, "");
- folderName = null;
wildcardExclude = null;
wildcard = null;
specifyWildcard = false;
@@ -74,149 +78,80 @@ public class ActionDeleteResultFilenames extends
ActionBase implements Cloneable
this("");
}
- @Override
- public Object clone() {
- ActionDeleteResultFilenames je = (ActionDeleteResultFilenames)
super.clone();
- return je;
+ public ActionDeleteResultFilenames(ActionDeleteResultFilenames a) {
+ super(a);
+ this.specifyWildcard = a.specifyWildcard;
+ this.wildcard = a.wildcard;
+ this.wildcardExclude = a.wildcardExclude;
}
@Override
- public String getXml() {
-
- // 75 chars in just tag names and spaces
- return super.getXml()
- + CONST_SPACE_SHORT
- + XmlHandler.addTagValue("foldername", folderName)
- + CONST_SPACE_SHORT
- + XmlHandler.addTagValue("specify_wildcard", specifyWildcard)
- + CONST_SPACE_SHORT
- + XmlHandler.addTagValue("wildcard", wildcard)
- + CONST_SPACE_SHORT
- + XmlHandler.addTagValue("wildcardexclude", wildcardExclude);
- }
-
- @Override
- public void loadXml(Node entrynode, IHopMetadataProvider metadataProvider,
IVariables variables)
- throws HopXmlException {
- try {
- super.loadXml(entrynode);
- folderName = XmlHandler.getTagValue(entrynode, "foldername");
- specifyWildcard = "Y".equalsIgnoreCase(XmlHandler.getTagValue(entrynode,
"specify_wildcard"));
- wildcard = XmlHandler.getTagValue(entrynode, "wildcard");
- wildcardExclude = XmlHandler.getTagValue(entrynode, "wildcardexclude");
-
- } catch (HopXmlException xe) {
- throw new HopXmlException(
- BaseMessages.getString(
- PKG, "ActionDeleteResultFilenames.CanNotLoadFromXML",
xe.getMessage()));
- }
- }
-
- public void setSpecifyWildcard(boolean specifyWildcard) {
- this.specifyWildcard = specifyWildcard;
- }
-
- public boolean isSpecifyWildcard() {
- return specifyWildcard;
- }
-
- public void setFoldername(String folderName) {
- this.folderName = folderName;
- }
-
- public String getFoldername() {
- return folderName;
- }
-
- public String getWildcard() {
- return wildcard;
- }
-
- public String getWildcardExclude() {
- return wildcardExclude;
- }
-
- public String getRealWildcard() {
- return resolve(getWildcard());
- }
-
- public void setWildcard(String wildcard) {
- this.wildcard = wildcard;
- }
-
- public void setWildcardExclude(String wildcardExclude) {
- this.wildcardExclude = wildcardExclude;
+ public Object clone() {
+ return new ActionDeleteResultFilenames();
}
@Override
- public Result execute(Result previousResult, int nr) {
- Result result = previousResult;
+ public Result execute(Result result, int nr) {
result.setResult(false);
-
- if (previousResult != null) {
- try {
- int size = previousResult.getResultFiles().size();
- if (isBasic()) {
- logBasic(
- BaseMessages.getString(PKG,
"ActionDeleteResultFilenames.log.FilesFound", "" + size));
+ try {
+ int size = result.getResultFiles().size();
+ if (isBasic()) {
+ logBasic(
+ BaseMessages.getString(PKG,
"ActionDeleteResultFilenames.log.FilesFound", "" + size));
+ }
+ if (!specifyWildcard) {
+ // Remove all files
+ result.getResultFiles().clear();
+ if (isDetailed()) {
+ logDetailed(
+ BaseMessages.getString(
+ PKG, "ActionDeleteResultFilenames.log.DeletedFiles", "" +
size));
}
- if (!specifyWildcard) {
- // Delete all files
- previousResult.getResultFiles().clear();
- if (isDetailed()) {
- logDetailed(
- BaseMessages.getString(
- PKG, "ActionDeleteResultFilenames.log.DeletedFiles", "" +
size));
- }
- } else {
-
- List<ResultFile> resultFiles = result.getResultFilesList();
- if (!Utils.isEmpty(resultFiles)) {
- for (Iterator<ResultFile> it = resultFiles.iterator();
- it.hasNext() && !parentWorkflow.isStopped(); ) {
- ResultFile resultFile = it.next();
- FileObject file = resultFile.getFile();
- if (file != null
- && file.exists()
- && checkFileWildcard(file.getName().getBaseName(),
resolve(wildcard), true)
- && !checkFileWildcard(
- file.getName().getBaseName(), resolve(wildcardExclude),
false)) {
- // Remove file from result files list
-
result.getResultFiles().remove(resultFile.getFile().toString());
-
- if (isDetailed()) {
- logDetailed(
- BaseMessages.getString(
- PKG, "ActionDeleteResultFilenames.log.DeletedFile",
file.toString()));
- }
+ } else {
+ List<ResultFile> resultFiles = result.getResultFilesList();
+ if (!Utils.isEmpty(resultFiles)) {
+ for (Iterator<ResultFile> it = resultFiles.iterator();
+ it.hasNext() && !parentWorkflow.isStopped(); ) {
+ ResultFile resultFile = it.next();
+ FileObject file = resultFile.getFile();
+ if (file != null
+ && file.exists()
+ && checkFileWildcard(file.getName().getBaseName(),
resolve(wildcard), true)
+ && !checkFileWildcard(
+ file.getName().getBaseName(), resolve(wildcardExclude),
false)) {
+ // Remove file from result files list
+ result.getResultFiles().remove(resultFile.getFile().toString());
+
+ if (isDetailed()) {
+ logDetailed(
+ BaseMessages.getString(
+ PKG, "ActionDeleteResultFilenames.log.DeletedFile",
file.toString()));
}
}
}
}
- result.setResult(true);
- } catch (Exception e) {
- logError(BaseMessages.getString(PKG,
"ActionDeleteResultFilenames.Error", e.toString()));
}
+ result.setResult(true);
+ } catch (Exception e) {
+ logError(BaseMessages.getString(PKG,
"ActionDeleteResultFilenames.Error", e.toString()));
}
return result;
}
/**
- * @param selectedfile
- * @param wildcard
- * @return True if the selectedfile matches the wildcard
+ * @param selectedFile The selected file
+ * @param wildcard The wildcard
+ * @return True if the selected file matches the wildcard
*/
- private boolean checkFileWildcard(String selectedfile, String wildcard,
boolean include) {
- Pattern pattern = null;
+ private boolean checkFileWildcard(String selectedFile, String wildcard,
boolean include) {
+ Pattern pattern;
boolean getIt = include;
if (!Utils.isEmpty(wildcard)) {
pattern = Pattern.compile(wildcard);
// First see if the file matches the regular expression!
- if (pattern != null) {
- Matcher matcher = pattern.matcher(selectedfile);
- getIt = matcher.matches();
- }
+ Matcher matcher = pattern.matcher(selectedFile);
+ getIt = matcher.matches();
}
return getIt;
diff --git
a/plugins/actions/deleteresultfilenames/src/main/java/org/apache/hop/workflow/actions/deleteresultfilenames/ActionDeleteResultFilenamesDialog.java
b/plugins/actions/deleteresultfilenames/src/main/java/org/apache/hop/workflow/actions/deleteresultfilenames/ActionDeleteResultFilenamesDialog.java
index f278fcea65..b2a4cea28a 100644
---
a/plugins/actions/deleteresultfilenames/src/main/java/org/apache/hop/workflow/actions/deleteresultfilenames/ActionDeleteResultFilenamesDialog.java
+++
b/plugins/actions/deleteresultfilenames/src/main/java/org/apache/hop/workflow/actions/deleteresultfilenames/ActionDeleteResultFilenamesDialog.java
@@ -17,6 +17,7 @@
package org.apache.hop.workflow.actions.deleteresultfilenames;
+import org.apache.hop.core.Const;
import org.apache.hop.core.util.Utils;
import org.apache.hop.core.variables.IVariables;
import org.apache.hop.i18n.BaseMessages;
@@ -29,8 +30,6 @@ import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.widgets.Button;
@@ -93,13 +92,11 @@ public class ActionDeleteResultFilenamesDialog extends
ActionDialog {
fdSpecifyWildcard.top = new FormAttachment(wlSpecifyWildcard, 0,
SWT.CENTER);
fdSpecifyWildcard.right = new FormAttachment(100, 0);
wSpecifyWildcard.setLayoutData(fdSpecifyWildcard);
- wSpecifyWildcard.addSelectionListener(
- new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- action.setChanged();
- CheckLimit();
- }
+ wSpecifyWildcard.addListener(
+ SWT.Selection,
+ e -> {
+ action.setChanged();
+ checkLimit();
});
// Wildcard line
@@ -147,11 +144,12 @@ public class ActionDeleteResultFilenamesDialog extends
ActionDialog {
fdWildcardExclude.right = new FormAttachment(100, -margin);
wWildcardExclude.setLayoutData(fdWildcardExclude);
// Whenever something changes, set the tooltip to the expanded version:
- wWildcardExclude.addModifyListener(
+ wWildcardExclude.addListener(
+ SWT.Modify,
e ->
wWildcardExclude.setToolTipText(variables.resolve(wWildcardExclude.getText())));
getData();
- CheckLimit();
+ checkLimit();
focusActionName();
BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
@@ -159,7 +157,7 @@ public class ActionDeleteResultFilenamesDialog extends
ActionDialog {
return action;
}
- private void CheckLimit() {
+ private void checkLimit() {
wlWildcard.setEnabled(wSpecifyWildcard.getSelection());
wWildcard.setEnabled(wSpecifyWildcard.getSelection());
wlWildcardExclude.setEnabled(wSpecifyWildcard.getSelection());
@@ -168,16 +166,10 @@ public class ActionDeleteResultFilenamesDialog extends
ActionDialog {
/** Copy information from the meta-data input to the dialog fields. */
public void getData() {
- if (action.getName() != null) {
- wName.setText(action.getName());
- }
+ wName.setText(Const.NVL(action.getName(), ""));
wSpecifyWildcard.setSelection(action.isSpecifyWildcard());
- if (action.getWildcard() != null) {
- wWildcard.setText(action.getWildcard());
- }
- if (action.getWildcardExclude() != null) {
- wWildcardExclude.setText(action.getWildcardExclude());
- }
+ wWildcard.setText(Const.NVL(action.getWildcard(), ""));
+ wWildcardExclude.setText(Const.NVL(action.getWildcardExclude(), ""));
}
@Override
diff --git
a/plugins/actions/deleteresultfilenames/src/test/java/org/apache/hop/workflow/actions/deleteresultfilenames/ActionDeleteResultFilenamesTest.java
b/plugins/actions/deleteresultfilenames/src/test/java/org/apache/hop/workflow/actions/deleteresultfilenames/ActionDeleteResultFilenamesTest.java
new file mode 100644
index 0000000000..5b1d8ef816
--- /dev/null
+++
b/plugins/actions/deleteresultfilenames/src/test/java/org/apache/hop/workflow/actions/deleteresultfilenames/ActionDeleteResultFilenamesTest.java
@@ -0,0 +1,37 @@
+/*
+ * 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.
+ */
+
+package org.apache.hop.workflow.actions.deleteresultfilenames;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import org.apache.hop.workflow.action.ActionSerializationTestUtil;
+import org.junit.jupiter.api.Test;
+
+class ActionDeleteResultFilenamesTest {
+ @Test
+ void testSerializationRoundTrip() throws Exception {
+ ActionDeleteResultFilenames action =
+ ActionSerializationTestUtil.testSerialization(
+ "/action-delete-result-files.xml",
ActionDeleteResultFilenames.class);
+
+ assertTrue(action.isSpecifyWildcard());
+ assertEquals("wildcard", action.getWildcard());
+ assertEquals("exclude", action.getWildcardExclude());
+ }
+}
diff --git
a/plugins/actions/deleteresultfilenames/src/test/java/org/apache/hop/workflow/actions/deleteresultfilenames/WorkflowActionDeleteResultFilenamesTest.java
b/plugins/actions/deleteresultfilenames/src/test/java/org/apache/hop/workflow/actions/deleteresultfilenames/WorkflowActionDeleteResultFilenamesTest.java
deleted file mode 100644
index 659b6ee11b..0000000000
---
a/plugins/actions/deleteresultfilenames/src/test/java/org/apache/hop/workflow/actions/deleteresultfilenames/WorkflowActionDeleteResultFilenamesTest.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * 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.
- */
-package org.apache.hop.workflow.actions.deleteresultfilenames;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-import org.apache.hop.junit.rules.RestoreHopEngineEnvironmentExtension;
-import
org.apache.hop.workflow.action.loadsave.WorkflowActionLoadSaveTestSupport;
-import org.junit.jupiter.api.extension.RegisterExtension;
-
-class WorkflowActionDeleteResultFilenamesTest
- extends WorkflowActionLoadSaveTestSupport<ActionDeleteResultFilenames> {
- @RegisterExtension
- static RestoreHopEngineEnvironmentExtension env = new
RestoreHopEngineEnvironmentExtension();
-
- @Override
- protected Class<ActionDeleteResultFilenames> getActionClass() {
- return ActionDeleteResultFilenames.class;
- }
-
- @Override
- protected List<String> listAttributes() {
- return Arrays.asList("foldername", "specifywildcard", "wildcard",
"wildcardexclude");
- }
-
- @Override
- protected Map<String, String> createGettersMap() {
- return toMap(
- "foldername", "getFoldername",
- "specifywildcard", "isSpecifyWildcard",
- "wildcard", "getWildcard",
- "wildcardexclude", "getWildcardExclude");
- }
-
- @Override
- protected Map<String, String> createSettersMap() {
- return toMap(
- "foldername", "setFoldername",
- "specifywildcard", "setSpecifyWildcard",
- "wildcard", "setWildcard",
- "wildcardexclude", "setWildcardExclude");
- }
-}
diff --git
a/plugins/actions/deleteresultfilenames/src/test/resources/action-delete-result-files.xml
b/plugins/actions/deleteresultfilenames/src/test/resources/action-delete-result-files.xml
new file mode 100644
index 0000000000..bfc48983f3
--- /dev/null
+++
b/plugins/actions/deleteresultfilenames/src/test/resources/action-delete-result-files.xml
@@ -0,0 +1,24 @@
+<?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.
+ -->
+
+<action>
+ <specify_wildcard>Y</specify_wildcard>
+ <wildcard>wildcard</wildcard>
+ <wildcardexclude>exclude</wildcardexclude>
+</action>
+