falcon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rostafiyc...@apache.org
Subject [1/2] incubator-falcon git commit: FALCON-699 Use APIResult and other support classes from falcon-client in falcon-regression. Contributed by Ruslan Ostafiychuk
Date Thu, 27 Nov 2014 12:52:44 GMT
Repository: incubator-falcon
Updated Branches:
  refs/heads/master bff951b2b -> 9445d4733


http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/9445d473/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/entity/ListEntitiesTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/entity/ListEntitiesTest.java
b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/entity/ListEntitiesTest.java
index 5abc932..51c38cc 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/entity/ListEntitiesTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/entity/ListEntitiesTest.java
@@ -25,13 +25,13 @@ import org.apache.falcon.regression.Entities.FeedMerlin;
 import org.apache.falcon.regression.Entities.ProcessMerlin;
 import org.apache.falcon.regression.core.bundle.Bundle;
 import org.apache.falcon.regression.core.interfaces.IEntityManagerHelper;
-import org.apache.falcon.regression.core.response.EntityResult;
 import org.apache.falcon.regression.core.util.AssertUtil;
 import org.apache.falcon.regression.core.util.BundleUtil;
 import org.apache.falcon.regression.core.util.CleanupUtil;
 import org.apache.falcon.regression.core.util.OSUtil;
 import org.apache.falcon.regression.core.util.Util;
 import org.apache.falcon.regression.testHelper.BaseTestClass;
+import org.apache.falcon.resource.EntityList.EntityElement;
 import org.apache.hadoop.security.authentication.client.AuthenticationException;
 import org.apache.log4j.Logger;
 import org.testng.Assert;
@@ -45,6 +45,7 @@ import javax.xml.bind.JAXBException;
 import java.io.IOException;
 import java.net.URISyntaxException;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Comparator;
 import java.util.List;
 import java.util.Random;
@@ -59,9 +60,9 @@ public class ListEntitiesTest extends BaseTestClass {
     private String baseTestHDFSDir = baseHDFSDir + testDir;
     private String aggregateWorkflowDir = baseTestHDFSDir + "/aggregator";
     private String[] tags = {"first=yes", "second=yes", "third=yes", "wrong=no"};
-    private static final Comparator<EntityResult> NAME_COMPARATOR = new Comparator<EntityResult>()
{
+    private static final Comparator<EntityElement> NAME_COMPARATOR = new Comparator<EntityElement>()
{
         @Override
-        public int compare(EntityResult o1, EntityResult o2) {
+        public int compare(EntityElement o1, EntityElement o2) {
             return o1.name.compareTo(o2.name);
         }
     };
@@ -122,11 +123,11 @@ public class ListEntitiesTest extends BaseTestClass {
     public void listEntitiesWithOrderBy(IEntityManagerHelper helper)
             throws AuthenticationException, IOException, URISyntaxException, InterruptedException
{
 
-        List<EntityResult> entities =
-            helper.listAllEntities("orderBy=name", null).getEntitiesResult().getEntities();
-        LOGGER.info(helper.getEntityType() + " entities: " + entities);
-        Assert.assertTrue(Ordering.from(NAME_COMPARATOR).isOrdered(entities),
-            helper.getEntityType() + " entities are not ordered by name: " + entities);
+        EntityElement[] entities =
+            helper.listAllEntities("orderBy=name", null).getEntityList().getElements();
+        LOGGER.info(helper.getEntityType() + " entities: " + Arrays.toString(entities));
+        Assert.assertTrue(Ordering.from(NAME_COMPARATOR).isOrdered(Arrays.asList(entities)),
+            helper.getEntityType() + " entities are not ordered by name: " + Arrays.toString(entities));
     }
 
 
@@ -139,11 +140,11 @@ public class ListEntitiesTest extends BaseTestClass {
         String[] statuses = helper.getEntityType().equalsIgnoreCase("cluster")
             ? new String[]{"SUBMITTED"} : new String[]{"SUBMITTED", "RUNNING"};
 
-        List<EntityResult> allEntities =
-            helper.listAllEntities("fields=status", null).getEntitiesResult().getEntities();
+        EntityElement[] allEntities =
+            helper.listAllEntities("fields=status", null).getEntityList().getElements();
         int[] counters = new int[statuses.length];
 
-        for (EntityResult entity : allEntities) {
+        for (EntityElement entity : allEntities) {
             for (int i = 0; i < statuses.length; i++) {
                 if (statuses[i].equals(entity.status)) {
                     counters[i]++;
@@ -152,11 +153,11 @@ public class ListEntitiesTest extends BaseTestClass {
         }
 
         for (int i = 0; i < statuses.length; i++) {
-            List<EntityResult> entities = helper.listAllEntities("fields=status&filterBy=STATUS:"
-                + statuses[i], null).getEntitiesResult().getEntities();
-            Assert.assertEquals(entities.size(), counters[i],
+            EntityElement[] entities = helper.listAllEntities("fields=status&filterBy=STATUS:"
+                + statuses[i], null).getEntityList().getElements();
+            Assert.assertEquals(entities.length, counters[i],
                 "Number of entities is not correct with status=" + statuses[i]);
-            for (EntityResult entity : entities) {
+            for (EntityElement entity : entities) {
                 Assert.assertEquals(entity.status, statuses[i], "Entity should has status
"
                     + statuses[i] + ". Entity: " + entity);
             }
@@ -171,22 +172,23 @@ public class ListEntitiesTest extends BaseTestClass {
     public void listEntitiesWithOffset(IEntityManagerHelper helper)
             throws AuthenticationException, IOException, URISyntaxException, InterruptedException
{
 
-        List<EntityResult> allEntities =
-            helper.listAllEntities(null, null).getEntitiesResult().getEntities();
-        LOGGER.info(helper.getEntityType() + " entities: " + allEntities);
-        int allEntitiesCount = allEntities.size();
+        EntityElement[] allEntities =
+            helper.listAllEntities(null, null).getEntityList().getElements();
+        LOGGER.info(helper.getEntityType() + " entities: " + Arrays.toString(allEntities));
+        int allEntitiesCount = allEntities.length;
         for (int i = 0; i <= allEntitiesCount; i++) {
 
-            List<EntityResult> entities =
-                helper.listEntities("offset=" + i, null).getEntitiesResult().getEntities();
+            EntityElement[] entities =
+                helper.listEntities("offset=" + i, null).getEntityList().getElements();
             LOGGER.info(String.format("%s entities with offset %d: %s",
-                helper.getEntityType(), i, entities));
+                helper.getEntityType(), i, Arrays.toString(entities)));
 
-            Assert.assertEquals(entities.size(),
+            Assert.assertEquals(entities != null ? entities.length : 0,
                 allEntitiesCount - i < 10 ? allEntitiesCount - i : 10,
                 "Number of entities is not correct.");
-            for (int j = 0; j < entities.size(); j++) {
-                Assert.assertEquals(entities.get(j).name, allEntities.get(j + i).name,
+
+            for (int j = 0; entities != null && j < entities.length; j++) {
+                Assert.assertEquals(entities[j].name, allEntities[j + i].name,
                     "Order of entities is not correct");
             }
         }
@@ -199,17 +201,17 @@ public class ListEntitiesTest extends BaseTestClass {
     public void listEntitiesWithNumResults(IEntityManagerHelper helper)
             throws AuthenticationException, IOException, URISyntaxException, InterruptedException
{
 
-        List<EntityResult> allEntities =
-            helper.listAllEntities(null, null).getEntitiesResult().getEntities();
-        int allEntitiesCount = allEntities.size();
+        EntityElement[] allEntities =
+            helper.listAllEntities(null, null).getEntityList().getElements();
+        int allEntitiesCount = allEntities.length;
 
         for (int i = 1; i <= allEntitiesCount; i++) {
-            List<EntityResult> entities =
-                helper.listEntities("numResults=" + i, null).getEntitiesResult().getEntities();
-            Assert.assertEquals(entities.size(), i,
+            EntityElement[] entities =
+                helper.listEntities("numResults=" + i, null).getEntityList().getElements();
+            Assert.assertEquals(entities.length, i,
                 "Number of entities is not equal to numResults parameter");
             for (int j = 0; j < i; j++) {
-                Assert.assertEquals(entities.get(j).name, allEntities.get(j).name,
+                Assert.assertEquals(entities[j].name, allEntities[j].name,
                     "Order of entities is not correct");
             }
         }
@@ -223,11 +225,11 @@ public class ListEntitiesTest extends BaseTestClass {
     public void listEntitiesWithTags(IEntityManagerHelper helper)
             throws AuthenticationException, IOException, URISyntaxException, InterruptedException
{
 
-        List<EntityResult> allEntities =
-            helper.listAllEntities("fields=tags", null).getEntitiesResult().getEntities();
+        EntityElement[] allEntities =
+            helper.listAllEntities("fields=tags", null).getEntityList().getElements();
         int[] counters = new int[tags.length];
 
-        for (EntityResult entity : allEntities) {
+        for (EntityElement entity : allEntities) {
             for (int i = 0; i < tags.length; i++) {
                 if (entity.tag != null && entity.tag.contains(tags[i])) {
                     counters[i]++;
@@ -236,14 +238,16 @@ public class ListEntitiesTest extends BaseTestClass {
         }
 
         for (int i = 0; i < tags.length; i++) {
-            List<EntityResult> entities = helper.listAllEntities("fields=tags&tags="
+ tags[i],
-                null).getEntitiesResult().getEntities();
-            Assert.assertEquals(entities.size(), counters[i],
+            EntityElement[] entities = helper.listAllEntities("fields=tags&tags=" + tags[i],
+                null).getEntityList().getElements();
+            Assert.assertEquals(entities != null ? entities.length : 0, counters[i],
                 "Number of entities is not correct with tag=" + tags[i]);
-            for (EntityResult entity : entities) {
-                Assert.assertNotNull(entity.tag, "Entity should have tags. Entity: " + entity);
-                Assert.assertTrue(entity.tag.contains(tags[i]), "Entity should contain tag
"
-                    + tags[i] + ". Entity: " + entity);
+
+            for (int j = 0; entities != null && j < entities.length; j++) {
+                Assert.assertNotNull(entities[j].tag, "Entity should have tags. Entity: "
+                    + entities[j]);
+                Assert.assertTrue(entities[j].tag.contains(tags[i]), "Entity should contain
tag "
+                    + tags[i] + ". Entity: " + entities[j]);
             }
 
         }
@@ -257,20 +261,24 @@ public class ListEntitiesTest extends BaseTestClass {
     public void listEntitiesWithCustomFilter(IEntityManagerHelper helper)
             throws AuthenticationException, IOException, URISyntaxException, InterruptedException
{
 
-        List<EntityResult> entities = helper.listEntities(
+        EntityElement[] entities = helper.listEntities(
             "numResults=2&fields=status,tags&filterBy=STATUS:SUBMITTED&orderBy=name&tags="
+ tags[2],
-            null).getEntitiesResult().getEntities();
-        SoftAssert softAssert = new SoftAssert();
-        for (EntityResult entity : entities) {
-            softAssert.assertEquals(entity.status, "SUBMITTED",
-                "Entities should have status 'SUBMITTED'");
-            softAssert.assertTrue(entity.tag.contains(tags[2]), "There is entity without
tag="
-                + tags[2] + " Entity: " + entity);
+            null).getEntityList().getElements();
+        if (entities != null) {
+            SoftAssert softAssert = new SoftAssert();
+            for (EntityElement entity : entities) {
+                softAssert.assertEquals(entity.status, "SUBMITTED",
+                    "Entities should have status 'SUBMITTED'");
+                softAssert.assertTrue(entity.tag.contains(tags[2]), "There is entity without
tag="
+                    + tags[2] + " Entity: " + entity);
+            }
+
+            softAssert.assertTrue(entities.length <= 2, "Number of results should be 2
or less");
+
+            softAssert.assertTrue(Ordering.from(NAME_COMPARATOR).isOrdered(Arrays.asList(entities)),
+                helper.getEntityType() + " entities are not ordered by name: " + Arrays.toString(entities));
+            softAssert.assertAll();
         }
-        softAssert.assertTrue(entities.size() <= 3, "Number of results should be 3 or
less");
-        softAssert.assertTrue(Ordering.from(NAME_COMPARATOR).isOrdered(entities),
-            helper.getEntityType() + " entities are not ordered by name: " + entities);
-        softAssert.assertAll();
     }
 
 

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/9445d473/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/lineage/EntitySummaryTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/lineage/EntitySummaryTest.java
b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/lineage/EntitySummaryTest.java
index 514bc52..4ba3cd3 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/lineage/EntitySummaryTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/lineage/EntitySummaryTest.java
@@ -28,7 +28,6 @@ import org.apache.falcon.regression.Entities.ProcessMerlin;
 import org.apache.falcon.regression.core.bundle.Bundle;
 import org.apache.falcon.regression.core.helpers.ColoHelper;
 import org.apache.falcon.regression.core.interfaces.IEntityManagerHelper;
-import org.apache.falcon.regression.core.response.InstancesResult;
 import org.apache.falcon.regression.core.util.AssertUtil;
 import org.apache.falcon.regression.core.util.BundleUtil;
 import org.apache.falcon.regression.core.util.CleanupUtil;
@@ -42,6 +41,7 @@ import org.apache.falcon.regression.core.util.XmlUtil;
 import org.apache.falcon.regression.testHelper.BaseTestClass;
 import org.apache.falcon.resource.APIResult;
 import org.apache.falcon.resource.EntitySummaryResult;
+import org.apache.falcon.resource.InstancesResult;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.security.authentication.client.AuthenticationException;
 import org.apache.log4j.Logger;

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/9445d473/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/lineage/LineageApiProcessInstanceTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/lineage/LineageApiProcessInstanceTest.java
b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/lineage/LineageApiProcessInstanceTest.java
index 5868882..2fa7740 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/lineage/LineageApiProcessInstanceTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/lineage/LineageApiProcessInstanceTest.java
@@ -22,7 +22,6 @@ import org.apache.falcon.entity.v0.Frequency;
 import org.apache.falcon.regression.core.bundle.Bundle;
 import org.apache.falcon.regression.core.helpers.ColoHelper;
 import org.apache.falcon.regression.core.helpers.LineageHelper;
-import org.apache.falcon.regression.core.response.InstancesResult;
 import org.apache.falcon.regression.core.response.lineage.Direction;
 import org.apache.falcon.regression.core.response.lineage.Vertex;
 import org.apache.falcon.regression.core.response.lineage.VerticesResult;
@@ -35,6 +34,7 @@ import org.apache.falcon.regression.core.util.OozieUtil;
 import org.apache.falcon.regression.core.util.TimeUtil;
 import org.apache.falcon.regression.core.util.Util;
 import org.apache.falcon.regression.testHelper.BaseTestClass;
+import org.apache.falcon.resource.InstancesResult;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.log4j.Logger;
 import org.apache.oozie.client.Job;

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/9445d473/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/lineage/ListFeedInstancesTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/lineage/ListFeedInstancesTest.java
b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/lineage/ListFeedInstancesTest.java
index 632d09d..6d29f77 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/lineage/ListFeedInstancesTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/lineage/ListFeedInstancesTest.java
@@ -23,7 +23,6 @@ import org.apache.falcon.entity.v0.feed.ActionType;
 import org.apache.falcon.entity.v0.feed.ClusterType;
 import org.apache.falcon.regression.core.bundle.Bundle;
 import org.apache.falcon.regression.core.helpers.ColoHelper;
-import org.apache.falcon.regression.core.response.InstancesResult;
 import org.apache.falcon.regression.core.util.AssertUtil;
 import org.apache.falcon.regression.core.util.BundleUtil;
 import org.apache.falcon.regression.core.util.HadoopUtil;
@@ -33,6 +32,7 @@ import org.apache.falcon.regression.core.util.TimeUtil;
 import org.apache.falcon.regression.core.util.Util;
 import org.apache.falcon.regression.core.util.XmlUtil;
 import org.apache.falcon.regression.testHelper.BaseTestClass;
+import org.apache.falcon.resource.InstancesResult;
 import org.apache.hadoop.security.authentication.client.AuthenticationException;
 import org.apache.log4j.Logger;
 import org.apache.oozie.client.CoordinatorAction;

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/9445d473/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/lineage/ListProcessInstancesTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/lineage/ListProcessInstancesTest.java
b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/lineage/ListProcessInstancesTest.java
index 145b9de..c469f95 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/lineage/ListProcessInstancesTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/lineage/ListProcessInstancesTest.java
@@ -21,13 +21,13 @@ package org.apache.falcon.regression.lineage;
 import org.apache.falcon.entity.v0.EntityType;
 import org.apache.falcon.regression.core.bundle.Bundle;
 import org.apache.falcon.regression.core.helpers.ColoHelper;
-import org.apache.falcon.regression.core.response.InstancesResult;
 import org.apache.falcon.regression.core.util.BundleUtil;
 import org.apache.falcon.regression.core.util.InstanceUtil;
 import org.apache.falcon.regression.core.util.OSUtil;
 import org.apache.falcon.regression.core.util.OozieUtil;
 import org.apache.falcon.regression.core.util.TimeUtil;
 import org.apache.falcon.regression.testHelper.BaseTestClass;
+import org.apache.falcon.resource.InstancesResult;
 import org.apache.log4j.Logger;
 import org.apache.oozie.client.CoordinatorAction;
 import org.apache.oozie.client.OozieClient;

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/9445d473/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/lineage/ProcessPipelineTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/lineage/ProcessPipelineTest.java
b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/lineage/ProcessPipelineTest.java
index ee5316d..c964210 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/lineage/ProcessPipelineTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/lineage/ProcessPipelineTest.java
@@ -20,7 +20,6 @@ package org.apache.falcon.regression.lineage;
 
 import org.apache.falcon.regression.core.bundle.Bundle;
 import org.apache.falcon.regression.core.helpers.ColoHelper;
-import org.apache.falcon.regression.core.response.EntityResult;
 import org.apache.falcon.regression.core.response.ServiceResponse;
 import org.apache.falcon.regression.core.util.AssertUtil;
 import org.apache.falcon.regression.core.util.BundleUtil;
@@ -28,6 +27,7 @@ import org.apache.falcon.regression.core.util.CleanupUtil;
 import org.apache.falcon.regression.core.util.OSUtil;
 import org.apache.falcon.regression.core.util.XmlUtil;
 import org.apache.falcon.regression.testHelper.BaseTestClass;
+import org.apache.falcon.resource.EntityList.EntityElement;
 import org.apache.hadoop.security.authentication.client.AuthenticationException;
 import org.apache.log4j.Logger;
 import org.testng.Assert;
@@ -106,14 +106,14 @@ public class ProcessPipelineTest extends BaseTestClass{
             for(int p = 0, n = 3; p < 3; p++, n++){
                 String pipeline = "pipeline" + p;
                 ServiceResponse response = prism.getProcessHelper().getListByPipeline(pipeline);
-                List<EntityResult> processes = response.getEntitiesResult().getEntities();
+                EntityElement[] processes = response.getEntityList().getElements();
                 //check that all retrieved processes match to expected list
                 List<String> expected = map.get(pipeline);
-                Assert.assertEquals(processes.size(), expected.size(),
+                Assert.assertEquals(processes.length, expected.size(),
                     String.format("Invalid number of processes for pipeline [%s].", pipeline));
-                for(EntityResult process : processes){
-                    Assert.assertTrue(expected.contains(process.getName()), String.format("Expected
"
-                        + "list %s doesn't contain %s for %s.", expected, process.getName(),
pipeline));
+                for(EntityElement process : processes){
+                    Assert.assertTrue(expected.contains(process.name), String.format("Expected
"
+                        + "list %s doesn't contain %s for %s.", expected, process.name, pipeline));
                 }
             }
         } finally {

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/9445d473/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/NewPrismProcessUpdateTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/NewPrismProcessUpdateTest.java
b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/NewPrismProcessUpdateTest.java
index 3e85cb3..501ccb4 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/NewPrismProcessUpdateTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/NewPrismProcessUpdateTest.java
@@ -25,7 +25,6 @@ import org.apache.falcon.entity.v0.process.ExecutionType;
 import org.apache.falcon.regression.Entities.ProcessMerlin;
 import org.apache.falcon.regression.core.bundle.Bundle;
 import org.apache.falcon.regression.core.helpers.ColoHelper;
-import org.apache.falcon.regression.core.response.APIResult;
 import org.apache.falcon.regression.core.response.ServiceResponse;
 import org.apache.falcon.regression.core.supportClasses.HadoopFileEditor;
 import org.apache.falcon.regression.core.util.AssertUtil;
@@ -38,6 +37,7 @@ import org.apache.falcon.regression.core.util.TimeUtil;
 import org.apache.falcon.regression.core.util.Util;
 import org.apache.falcon.regression.core.util.XmlUtil;
 import org.apache.falcon.regression.testHelper.BaseTestClass;
+import org.apache.falcon.resource.APIResult;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.security.authentication.client.AuthenticationException;
 import org.apache.log4j.Logger;

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/9445d473/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedSnSTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedSnSTest.java
b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedSnSTest.java
index 4784dec..b8f3095 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedSnSTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedSnSTest.java
@@ -23,7 +23,6 @@ import org.apache.falcon.entity.v0.EntityType;
 import org.apache.falcon.entity.v0.feed.ActionType;
 import org.apache.falcon.entity.v0.feed.ClusterType;
 import org.apache.falcon.regression.core.helpers.ColoHelper;
-import org.apache.falcon.regression.core.response.APIResult;
 import org.apache.falcon.regression.core.response.ServiceResponse;
 import org.apache.falcon.regression.core.util.AssertUtil;
 import org.apache.falcon.regression.core.util.BundleUtil;
@@ -269,12 +268,12 @@ public class PrismFeedSnSTest extends BaseTestClass {
     public void testFeedSnSOnBothColosUsingColoHelper() throws Exception {
         //schedule both bundles
         bundles[0].submitFeed();
-        APIResult result = Util.parseResponse((cluster1.getFeedHelper().submitEntity(feed1)));
-        Assert.assertEquals(result.getStatusCode(), 404);
+        ServiceResponse result = (cluster1.getFeedHelper().submitEntity(feed1));
+        Assert.assertEquals(result.getCode(), 404);
         AssertUtil.checkNotStatus(cluster1OC, EntityType.FEED, bundles[0], Job.Status.RUNNING);
         bundles[1].submitFeed();
-        result = Util.parseResponse(cluster2.getFeedHelper().submitAndSchedule(feed2));
-        Assert.assertEquals(result.getStatusCode(), 404);
+        result = cluster2.getFeedHelper().submitAndSchedule(feed2);
+        Assert.assertEquals(result.getCode(), 404);
         AssertUtil.checkNotStatus(cluster2OC, EntityType.FEED, bundles[1], Job.Status.RUNNING);
     }
 
@@ -336,10 +335,8 @@ public class PrismFeedSnSTest extends BaseTestClass {
      */
     @Test(groups = {"prism", "0.2", "distributed"})
     public void testSNSNonExistentFeedOnBothColosUsingColoHelper() throws Exception {
-        Assert.assertEquals(Util.parseResponse(cluster1.getFeedHelper().submitAndSchedule(feed1))
-            .getStatusCode(), 404);
-        Assert.assertEquals(Util.parseResponse(cluster2.getFeedHelper().submitAndSchedule(feed2))
-            .getStatusCode(), 404);
+        Assert.assertEquals(cluster1.getFeedHelper().submitAndSchedule(feed1).getCode(),
404);
+        Assert.assertEquals(cluster2.getFeedHelper().submitAndSchedule(feed2).getCode(),
404);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/9445d473/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismProcessSnSTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismProcessSnSTest.java
b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismProcessSnSTest.java
index 4768e68..a83b8f4 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismProcessSnSTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismProcessSnSTest.java
@@ -229,10 +229,10 @@ public class PrismProcessSnSTest extends BaseTestClass {
      */
     @Test(groups = {"prism", "0.2", "distributed"})
     public void testScheduleNonExistentProcessOnBothColos() throws Exception {
-        Assert.assertEquals(Util.parseResponse(cluster2.getProcessHelper()
-            .submitAndSchedule(process1)).getStatusCode(), 404);
-        Assert.assertEquals(Util.parseResponse(cluster1.getProcessHelper()
-            .submitAndSchedule(process2)).getStatusCode(), 404);
+        Assert.assertEquals(cluster2.getProcessHelper()
+            .submitAndSchedule(process1).getCode(), 404);
+        Assert.assertEquals(cluster1.getProcessHelper()
+            .submitAndSchedule(process2).getCode(), 404);
     }
 
     @AfterClass(alwaysRun = true)


Mime
View raw message