FALCON-1034 Add test for FALCON-677 - wherein feed data and stats paths no longer default to /tmp/. Contributed by Karishma G
Project: http://git-wip-us.apache.org/repos/asf/falcon/repo Commit: http://git-wip-us.apache.org/repos/asf/falcon/commit/65cb7184 Tree: http://git-wip-us.apache.org/repos/asf/falcon/tree/65cb7184 Diff: http://git-wip-us.apache.org/repos/asf/falcon/diff/65cb7184 Branch: refs/heads/master Commit: 65cb71841a00a1aec783129aaf6d79491380936a Parents: 30a794c Author: samarthg <[email protected]> Authored: Mon Feb 23 14:27:56 2015 +0530 Committer: samarthg <[email protected]> Committed: Mon Feb 23 14:27:56 2015 +0530 ---------------------------------------------------------------------- falcon-regression/CHANGES.txt | 5 ++- .../falcon/regression/FeedSubmitTest.java | 45 ++++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/falcon/blob/65cb7184/falcon-regression/CHANGES.txt ---------------------------------------------------------------------- diff --git a/falcon-regression/CHANGES.txt b/falcon-regression/CHANGES.txt index 0d08d63..4ad8a2a 100644 --- a/falcon-regression/CHANGES.txt +++ b/falcon-regression/CHANGES.txt @@ -44,8 +44,11 @@ Trunk (Unreleased) via Samarth Gupta) IMPROVEMENTS + + FALCON-1034 Add test for FALCON-677 - wherein feed data and stats paths no longer default + to /tmp/.(Karishma G via Samarth Gupta) - FALCON-1014 Fix PrismProcessSnSTest in falcon regression . Contributed by Pragya M via + FALCON-1014 Fix PrismProcessSnSTest in falcon regression . (Contributed by Pragya M via Samarth G) FALCON-1022 Wait for RUNNING status of instances before killing them (Ruslan Ostafiychuk) http://git-wip-us.apache.org/repos/asf/falcon/blob/65cb7184/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/FeedSubmitTest.java ---------------------------------------------------------------------- diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/FeedSubmitTest.java b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/FeedSubmitTest.java index 374c442..53f3df8 100644 --- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/FeedSubmitTest.java +++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/FeedSubmitTest.java @@ -19,6 +19,9 @@ package org.apache.falcon.regression; +import org.apache.commons.httpclient.HttpStatus; +import org.apache.falcon.entity.v0.feed.LocationType; +import org.apache.falcon.regression.Entities.FeedMerlin; import org.apache.falcon.regression.core.bundle.Bundle; import org.apache.falcon.regression.core.helpers.ColoHelper; import org.apache.falcon.regression.core.response.ServiceResponse; @@ -115,4 +118,46 @@ public class FeedSubmitTest extends BaseTestClass { response = prism.getFeedHelper().submitEntity(feed); AssertUtil.assertSucceeded(response); } + + /** + * Submit a feed with the path for location-data type empty. Feed submit should fail. + * * + * @throws Exception + */ + @Test(groups = {"singleCluster"}) + public void submitFeedWithEmptyDataPath() throws Exception { + FeedMerlin feedObj = new FeedMerlin(feed); + feedObj.setLocation(LocationType.DATA, ""); + ServiceResponse response = prism.getFeedHelper().submitEntity(feedObj.toString()); + AssertUtil.assertFailedWithStatus(response, HttpStatus.SC_BAD_REQUEST, + "Can not create a Path from an empty string"); + } + + /** + * Submit a feed no location type stats. Feed submit should succeed. + * + * @throws Exception + */ + + @Test(groups = {"singleCluster"}) + public void submitFeedWithNoStatsPath() throws Exception { + FeedMerlin feedObj = new FeedMerlin(feed); + feedObj.getLocations().getLocations().set(1, null); + ServiceResponse response = prism.getFeedHelper().submitEntity(feedObj.toString()); + AssertUtil.assertSucceeded(response); + } + + /** + * Submit a feed with no location type data. Feed submit should fail. + * * + * @throws Exception + */ + @Test(groups = {"singleCluster"}) + public void submitFeedWithNoDataPath() throws Exception { + FeedMerlin feedObj = new FeedMerlin(feed); + feedObj.getLocations().getLocations().set(0, null); + ServiceResponse response = prism.getFeedHelper().submitEntity(feedObj.toString()); + AssertUtil.assertFailedWithStatus(response, HttpStatus.SC_BAD_REQUEST, + "FileSystem based feed but it doesn't contain location type - data"); + } }
