falcon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From samar...@apache.org
Subject git commit: FALCON-653 Add falcon regression test for zero input process contributed by Karishma
Date Wed, 03 Sep 2014 06:01:41 GMT
Repository: incubator-falcon
Updated Branches:
  refs/heads/master 2ed0112e0 -> 75f06b4fe


FALCON-653 Add falcon regression test for zero input process contributed by Karishma


Project: http://git-wip-us.apache.org/repos/asf/incubator-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-falcon/commit/75f06b4f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-falcon/tree/75f06b4f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-falcon/diff/75f06b4f

Branch: refs/heads/master
Commit: 75f06b4fe82db9f24aca1036a45c7ad0e26d8f1e
Parents: 2ed0112
Author: Samarth Gupta <samarth.gupta@inmobi.com>
Authored: Wed Sep 3 11:31:21 2014 +0530
Committer: Samarth Gupta <samarth.gupta@inmobi.com>
Committed: Wed Sep 3 11:31:21 2014 +0530

----------------------------------------------------------------------
 falcon-regression/CHANGES.txt                   |  2 +-
 .../prism/PrismProcessScheduleTest.java         | 52 ++++++++++++++++++--
 2 files changed, 48 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/75f06b4f/falcon-regression/CHANGES.txt
----------------------------------------------------------------------
diff --git a/falcon-regression/CHANGES.txt b/falcon-regression/CHANGES.txt
index 72daf8e..94403c8 100644
--- a/falcon-regression/CHANGES.txt
+++ b/falcon-regression/CHANGES.txt
@@ -9,7 +9,7 @@ Trunk (Unreleased)
    via Samarth Gupta)
 
   IMPROVEMENTS
-
+   FALCON-653 Add falcon regression test for zero input process(Karishma via Samarth Gupta)
    FALCON-655 Skip workflow upload if process won't be submitted (Ruslan Ostafiychuk)
 
    FALCON-587 Don't delete input data in @AfterClass in falcon-regression tests if

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/75f06b4f/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismProcessScheduleTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismProcessScheduleTest.java
b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismProcessScheduleTest.java
index 7822729..10df6c2 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismProcessScheduleTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismProcessScheduleTest.java
@@ -33,6 +33,7 @@ import org.apache.falcon.regression.core.util.Util;
 import org.apache.falcon.regression.core.util.Util.URLS;
 import org.apache.falcon.regression.testHelper.BaseTestClass;
 import org.apache.log4j.Logger;
+import org.apache.oozie.client.CoordinatorAction;
 import org.apache.oozie.client.Job;
 import org.apache.oozie.client.OozieClient;
 import org.testng.TestNGException;
@@ -53,11 +54,13 @@ public class PrismProcessScheduleTest extends BaseTestClass {
     OozieClient cluster1OC = serverOC.get(0);
     OozieClient cluster2OC = serverOC.get(1);
     String aggregateWorkflowDir = baseHDFSDir + "/PrismProcessScheduleTest/aggregator";
+    String workflowForNoIpOp = baseHDFSDir + "/PrismProcessScheduleTest/noinop";
     private static final Logger logger = Logger.getLogger(PrismProcessScheduleTest.class);
 
     @BeforeClass(alwaysRun = true)
     public void uploadWorkflow() throws Exception {
         uploadDirToClusters(aggregateWorkflowDir, OSUtil.RESOURCES_OOZIE);
+        uploadDirToClusters(workflowForNoIpOp, OSUtil.RESOURCES+"workflows/aggregatorNoOutput/");
     }
 
     @BeforeMethod(alwaysRun = true)
@@ -388,10 +391,49 @@ public class PrismProcessScheduleTest extends BaseTestClass {
                 hadoopFileEditor.restore();
             }
         }
-    }
+     }
 
-    @AfterClass(alwaysRun = true)
-    public void tearDownClass() throws IOException {
-        cleanTestDirs();
-    }
+     /**
+     * Schedule a process that contains no inputs. The process should be successfully scheduled.
+     *
+     * @throws Exception
+     */
+     @Test(groups = {"prism", "0.2", "embedded"}, enabled = true, timeOut = 1800000)
+     public void testScheduleWhenZeroInputs()throws Exception{
+         bundles[0].submitClusters(prism);
+         bundles[0].setProcessWorkflow(workflowForNoIpOp);
+         ProcessMerlin processObj = new ProcessMerlin(bundles[0].getProcessData());
+         processObj.setInputs(null);
+         processObj.setLateProcess(null);
+         AssertUtil.assertSucceeded(prism.getFeedHelper().submitEntity(Util.URLS.SUBMIT_URL,
bundles[0].getOutputFeedFromBundle()));
+         AssertUtil.assertSucceeded(prism.getProcessHelper().submitAndSchedule(Util.URLS.SUBMIT_AND_SCHEDULE_URL,
+                 processObj.toString()));
+         InstanceUtil.waitTillInstanceReachState(cluster1OC, Util.readEntityName(processObj.toString()),
2,
+                 CoordinatorAction.Status.SUCCEEDED, EntityType.PROCESS, 10);
+     }
+
+     /**
+     * Schedule a process that contains no inputs or outputs. The process should be successfully
scheduled.
+     *
+     * @throws Exception
+     */
+     @Test(groups = {"prism", "0.2", "embedded"}, enabled = true, timeOut = 1800000)
+     public void testScheduleWhenZeroInputsZeroOutputs()throws Exception{
+         bundles[0].submitClusters(prism);
+         bundles[0].setProcessWorkflow(workflowForNoIpOp);
+         ProcessMerlin processObj = new ProcessMerlin(bundles[0].getProcessData());
+         processObj.setInputs(null);
+         processObj.setOutputs(null);
+         processObj.setLateProcess(null);
+         AssertUtil.assertSucceeded(prism.getProcessHelper().submitAndSchedule(Util.URLS.SUBMIT_AND_SCHEDULE_URL,
+                 processObj.toString()));
+         InstanceUtil.waitTillInstanceReachState(cluster1OC, Util.readEntityName(processObj.toString()),
2,
+                 CoordinatorAction.Status.SUCCEEDED, EntityType.PROCESS, 10);
+     }
+
+
+     @AfterClass(alwaysRun = true)
+     public void tearDownClass() throws IOException {
+         cleanTestDirs();
+     }
 }


Mime
View raw message