You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oodt.apache.org by ma...@apache.org on 2014/08/02 22:25:59 UTC

svn commit: r1615365 - in /oodt/trunk/workflow/src: main/resources/examples/tasks.xml test/org/apache/oodt/cas/workflow/examples/TestFilterTask.java

Author: mattmann
Date: Sat Aug  2 20:25:59 2014
New Revision: 1615365

URL: http://svn.apache.org/r1615365
Log:
- test remove multiple keys and add in docs.

Modified:
    oodt/trunk/workflow/src/main/resources/examples/tasks.xml
    oodt/trunk/workflow/src/test/org/apache/oodt/cas/workflow/examples/TestFilterTask.java

Modified: oodt/trunk/workflow/src/main/resources/examples/tasks.xml
URL: http://svn.apache.org/viewvc/oodt/trunk/workflow/src/main/resources/examples/tasks.xml?rev=1615365&r1=1615364&r2=1615365&view=diff
==============================================================================
--- oodt/trunk/workflow/src/main/resources/examples/tasks.xml (original)
+++ oodt/trunk/workflow/src/main/resources/examples/tasks.xml Sat Aug  2 20:25:59 2014
@@ -145,4 +145,19 @@
 	      <property name="TaskLoad" value="2"/>
 	   </configuration>  
 	</task>
+    <task id="urn:oodt:FilterTask" name="Filter Task"
+       class="org.apache.oodt.cas.workflow.examples.FilterTask">
+       <conditions>
+       </conditions> 
+       <configuration>
+          <!--  comma separated list of keys to remove from the metadata. -->
+          <property name="RemoveKey" value="ProductionDateTime"/>
+          <!-- you can list many of these Rename_[Key] parameters, to
+               remove specific keys from the metadata. Note that renames
+               are processed *first* before removes, so you can conceivably
+               rename a field, and then *remove* it too, so be careful.
+           -->
+          <property name="Rename_Filename" value="Prior_Filename"/>
+       </configuration>  
+    </task>
 </cas:tasks>

Modified: oodt/trunk/workflow/src/test/org/apache/oodt/cas/workflow/examples/TestFilterTask.java
URL: http://svn.apache.org/viewvc/oodt/trunk/workflow/src/test/org/apache/oodt/cas/workflow/examples/TestFilterTask.java?rev=1615365&r1=1615364&r2=1615365&view=diff
==============================================================================
--- oodt/trunk/workflow/src/test/org/apache/oodt/cas/workflow/examples/TestFilterTask.java (original)
+++ oodt/trunk/workflow/src/test/org/apache/oodt/cas/workflow/examples/TestFilterTask.java Sat Aug  2 20:25:59 2014
@@ -106,5 +106,19 @@ public class TestFilterTask extends Test
 		assertFalse(dynMet.containsKey("Filename"));
 		assertFalse(dynMet.containsKey("FooName"));
 	}
+	
+	public void testRemoveMultipleKeys(){
+		config.addConfigProperty("Remove_Key", "Filename, ProductionDateTime");
+		try {
+			task.run(dynMet, config);
+		} catch (WorkflowTaskInstanceException e) {
+			e.printStackTrace();
+			fail(e.getMessage());
+		}
+		assertNotNull(dynMet);
+		assertFalse(dynMet.containsKey("Filename"));
+		assertFalse(dynMet.containsKey("ProductionDateTime"));
+		
+	}
 
 }