falcon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rag...@apache.org
Subject [2/3] falcon git commit: FALCON-968 Remove only entities submitted by same test and baseHDFSDir usage refactored. Contributed by Ruslan Ostafiychuk
Date Wed, 04 Feb 2015 20:47:35 GMT
http://git-wip-us.apache.org/repos/asf/falcon/blob/0692b241/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 9bfbe25..13b3b88 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
@@ -27,9 +27,7 @@ import org.apache.falcon.regression.core.bundle.Bundle;
 import org.apache.falcon.regression.core.helpers.entity.AbstractEntityHelper;
 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;
@@ -56,8 +54,7 @@ import java.util.Random;
 @Test(groups = "embedded")
 public class ListEntitiesTest extends BaseTestClass {
     private static final Logger LOGGER = Logger.getLogger(ListEntitiesTest.class);
-    private String testDir = "/ListEntitiesTest";
-    private String baseTestHDFSDir = baseHDFSDir + testDir;
+    private String baseTestHDFSDir = cleanAndGetTestDir();
     private String aggregateWorkflowDir = baseTestHDFSDir + "/aggregator";
     private String[] tags = {"first=yes", "second=yes", "third=yes", "wrong=no"};
     private static final Comparator<EntityElement> NAME_COMPARATOR = new Comparator<EntityElement>() {
@@ -75,11 +72,11 @@ public class ListEntitiesTest extends BaseTestClass {
         throws IOException, AuthenticationException, JAXBException, URISyntaxException,
         InterruptedException {
         uploadDirToClusters(aggregateWorkflowDir, OSUtil.RESOURCES_OOZIE);
-        CleanupUtil.cleanAllEntities(prism);
+        removeTestClassEntities();
 
         bundles[0] = BundleUtil.readELBundle();
         bundles[0] = new Bundle(bundles[0], servers.get(0));
-        bundles[0].generateUniqueBundle();
+        bundles[0].generateUniqueBundle(this);
         bundles[0].setProcessWorkflow(aggregateWorkflowDir);
         bundles[0].submitBundle(prism);
 
@@ -87,8 +84,11 @@ public class ListEntitiesTest extends BaseTestClass {
         FeedMerlin feed = new FeedMerlin(bundles[0].getInputFeedFromBundle());
         ProcessMerlin process = new ProcessMerlin(bundles[0].getProcessData());
         ClusterMerlin cluster = bundles[0].getClusterElement();
+        String clusterNamePrefix = bundles[0].getClusterElement().getName() + '-';
+        String processNamePrefix = bundles[0].getProcessName() + '-';
+        String feedNamePrefix = bundles[0].getInputFeedNameFromBundle() + '-';
         for (int i = 0; i < 10; i++) {
-            process.setName("process" + Util.getUniqueString());
+            process.setName(processNamePrefix + i);
             process.setTags(getRandomTags());
             if (i % 2 == 0) {
                 AssertUtil.assertSucceeded(prism.getProcessHelper().submitEntity(process.toString()));
@@ -96,7 +96,7 @@ public class ListEntitiesTest extends BaseTestClass {
                 AssertUtil.assertSucceeded(prism.getProcessHelper().submitAndSchedule(process.toString()));
             }
 
-            feed.setName("feed" + Util.getUniqueString());
+            feed.setName(feedNamePrefix + i);
             feed.setTags(getRandomTags());
             if (i % 2 == 0) {
                 AssertUtil.assertSucceeded(prism.getFeedHelper().submitEntity(feed.toString()));
@@ -104,7 +104,7 @@ public class ListEntitiesTest extends BaseTestClass {
                 AssertUtil.assertSucceeded(prism.getFeedHelper().submitAndSchedule(feed.toString()));
             }
 
-            cluster.setName("cluster" + Util.getUniqueString());
+            cluster.setName(clusterNamePrefix + i);
             cluster.setTags(getRandomTags());
             AssertUtil.assertSucceeded(prism.getClusterHelper().submitEntity(cluster.toString()));
         }
@@ -112,7 +112,7 @@ public class ListEntitiesTest extends BaseTestClass {
 
     @AfterClass(alwaysRun = true)
     public void tearDown() throws IOException {
-        CleanupUtil.cleanAllEntities(prism);
+        removeTestClassEntities();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/falcon/blob/0692b241/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/hcat/HCatFeedOperationsTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/hcat/HCatFeedOperationsTest.java b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/hcat/HCatFeedOperationsTest.java
index 04bcdce..04362ef 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/hcat/HCatFeedOperationsTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/hcat/HCatFeedOperationsTest.java
@@ -69,7 +69,7 @@ public class HCatFeedOperationsTest extends BaseTestClass {
     private String tableName = "hcatFeedOperationsTest";
     private String randomTblName = "randomTable_HcatFeedOperationsTest";
     private String feed;
-    private String aggregateWorkflowDir = baseHDFSDir + "/HCatFeedOperationsTest/aggregator";
+    private String aggregateWorkflowDir = cleanAndGetTestDir() + "/aggregator";
 
     public void uploadWorkflow() throws Exception {
         uploadDirToClusters(aggregateWorkflowDir, OSUtil.RESOURCES_OOZIE);
@@ -95,18 +95,18 @@ public class HCatFeedOperationsTest extends BaseTestClass {
     public void setUp() throws Exception {
         Bundle bundle = BundleUtil.readHCatBundle();
         bundles[0] = new Bundle(bundle, cluster.getPrefix());
-        bundles[0].generateUniqueBundle();
+        bundles[0].generateUniqueBundle(this);
         bundles[0].setClusterInterface(Interfacetype.REGISTRY, cluster.getClusterHelper().getHCatEndpoint());
 
 
         bundles[1] = new Bundle(bundle, cluster2.getPrefix());
-        bundles[1].generateUniqueBundle();
+        bundles[1].generateUniqueBundle(this);
         bundles[1].setClusterInterface(Interfacetype.REGISTRY, cluster2.getClusterHelper().getHCatEndpoint());
     }
 
     @AfterMethod(alwaysRun = true)
     public void tearDown() throws HCatException {
-        removeBundles();
+        removeTestClassEntities();
     }
 
     @AfterClass(alwaysRun = true)

http://git-wip-us.apache.org/repos/asf/falcon/blob/0692b241/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/hcat/HCatProcessTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/hcat/HCatProcessTest.java b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/hcat/HCatProcessTest.java
index 2c33337..d23d666 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/hcat/HCatProcessTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/hcat/HCatProcessTest.java
@@ -71,8 +71,7 @@ public class HCatProcessTest extends BaseTestClass {
     private final OozieClient clusterOC = serverOC.get(0);
     private HCatClient clusterHC;
 
-    private final String testDir = "/HCatProcessTest";
-    private final String baseTestHDFSDir = baseHDFSDir + testDir;
+    private final String baseTestHDFSDir = cleanAndGetTestDir();
     private final String hiveScriptDir = baseTestHDFSDir + "/hive";
     private final String hiveScriptFile = hiveScriptDir + "/script.hql";
     private final String aggregateWorkflowDir = baseTestHDFSDir + "/aggregator";
@@ -110,7 +109,7 @@ public class HCatProcessTest extends BaseTestClass {
         clusterHC = cluster.getClusterHelper().getHCatClient();
         bundles[0] = BundleUtil.readHCatBundle();
         bundles[0] = new Bundle(bundles[0], cluster);
-        bundles[0].generateUniqueBundle();
+        bundles[0].generateUniqueBundle(this);
         bundles[0].setProcessWorkflow(hiveScriptFile, EngineType.HIVE);
         bundles[0].setClusterInterface(Interfacetype.REGISTRY,
             cluster.getClusterHelper().getHCatEndpoint());
@@ -248,7 +247,7 @@ public class HCatProcessTest extends BaseTestClass {
         bundles[0].setInputFeedPeriodicity(1, Frequency.TimeUnit.hours);
         bundles[0].setInputFeedValidity(startDate, endDate);
         final String inputFeed1 = bundles[0].getInputFeedFromBundle();
-        final String inputFeed2Name = "second-" + Util.readEntityName(inputFeed1);
+        final String inputFeed2Name = Util.readEntityName(inputFeed1) + "-second";
 
         FeedMerlin feedObj = new FeedMerlin(inputFeed1);
         feedObj.setName(inputFeed2Name);
@@ -344,7 +343,7 @@ public class HCatProcessTest extends BaseTestClass {
         bundles[0].setOutputFeedPeriodicity(1, Frequency.TimeUnit.hours);
         bundles[0].setOutputFeedValidity(startDate, endDate);
         final String outputFeed1 = bundles[0].getInputFeedFromBundle();
-        final String outputFeed2Name = "second-" + Util.readEntityName(outputFeed1);
+        final String outputFeed2Name = Util.readEntityName(outputFeed1) + "-second";
         FeedMerlin feedObj = new FeedMerlin(outputFeed1);
         feedObj.setName(outputFeed2Name);
         feedObj.getTable().setUri(outputTableUri2);
@@ -430,7 +429,7 @@ public class HCatProcessTest extends BaseTestClass {
         bundles[0].setInputFeedPeriodicity(1, Frequency.TimeUnit.hours);
         bundles[0].setInputFeedValidity(startDate, endDate);
         final String inputFeed1 = bundles[0].getInputFeedFromBundle();
-        final String inputFeed2Name = "second-" + Util.readEntityName(inputFeed1);
+        final String inputFeed2Name = Util.readEntityName(inputFeed1) + "-second";
         FeedMerlin feedObj = new FeedMerlin(inputFeed1);
         feedObj.setName(inputFeed2Name);
         feedObj.getTable().setUri(inputTableUri2);
@@ -445,7 +444,7 @@ public class HCatProcessTest extends BaseTestClass {
         bundles[0].setOutputFeedPeriodicity(1, Frequency.TimeUnit.hours);
         bundles[0].setOutputFeedValidity(startDate, endDate);
         final String outputFeed1 = bundles[0].getOutputFeedFromBundle();
-        final String outputFeed2Name = "second-" + Util.readEntityName(outputFeed1);
+        final String outputFeed2Name = Util.readEntityName(outputFeed1) + "-second";
         FeedMerlin feedObj2 = new FeedMerlin(outputFeed1);
         feedObj2.setName(outputFeed2Name);
         feedObj2.getTable().setUri(outputTableUri2);
@@ -637,6 +636,6 @@ public class HCatProcessTest extends BaseTestClass {
 
     @AfterMethod(alwaysRun = true)
     public void tearDown() {
-        removeBundles();
+        removeTestClassEntities();
     }
 }

http://git-wip-us.apache.org/repos/asf/falcon/blob/0692b241/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/hcat/HCatReplicationTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/hcat/HCatReplicationTest.java b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/hcat/HCatReplicationTest.java
index bf01a4a..53e4777 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/hcat/HCatReplicationTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/hcat/HCatReplicationTest.java
@@ -81,7 +81,7 @@ public class HCatReplicationTest extends BaseTestClass {
     private OozieClient cluster3OC = serverOC.get(2);
     private HCatClient cluster3HC;
 
-    private final String baseTestHDFSDir = baseHDFSDir + "/HCatReplicationTest";
+    private final String baseTestHDFSDir = cleanAndGetTestDir();
 
     private final String dbName = "default";
     private final String localHCatData = OSUtil.getPath(OSUtil.RESOURCES, "hcat", "data");
@@ -100,17 +100,17 @@ public class HCatReplicationTest extends BaseTestClass {
     public void setUp() throws Exception {
         Bundle bundle = BundleUtil.readHCatBundle();
         bundles[0] = new Bundle(bundle, cluster.getPrefix());
-        bundles[0].generateUniqueBundle();
+        bundles[0].generateUniqueBundle(this);
         bundles[0].setClusterInterface(Interfacetype.REGISTRY,
             cluster.getClusterHelper().getHCatEndpoint());
 
         bundles[1] = new Bundle(bundle, cluster2.getPrefix());
-        bundles[1].generateUniqueBundle();
+        bundles[1].generateUniqueBundle(this);
         bundles[1].setClusterInterface(Interfacetype.REGISTRY, cluster2.getClusterHelper()
             .getHCatEndpoint());
 
         bundles[2] = new Bundle(bundle, cluster3.getPrefix());
-        bundles[2].generateUniqueBundle();
+        bundles[2].generateUniqueBundle(this);
         bundles[2].setClusterInterface(Interfacetype.REGISTRY, cluster3.getClusterHelper()
             .getHCatEndpoint());
 
@@ -354,6 +354,6 @@ public class HCatReplicationTest extends BaseTestClass {
 
     @AfterMethod(alwaysRun = true)
     public void tearDown() {
-        removeBundles();
+        removeTestClassEntities();
     }
 }

http://git-wip-us.apache.org/repos/asf/falcon/blob/0692b241/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/hcat/HCatRetentionTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/hcat/HCatRetentionTest.java b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/hcat/HCatRetentionTest.java
index bfae1c6..83554e2 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/hcat/HCatRetentionTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/hcat/HCatRetentionTest.java
@@ -66,7 +66,7 @@ public class HCatRetentionTest extends BaseTestClass {
     private Bundle bundle;
     private static HCatClient cli;
     private final String testDir = "/HCatRetentionTest/";
-    private final String baseTestHDFSDir = baseHDFSDir + testDir;
+    private final String baseTestHDFSDir = cleanAndGetTestDir();
     private final String dBName = "default";
     private final ColoHelper cluster = servers.get(0);
     private final FileSystem clusterFS = serverFS.get(0);
@@ -78,7 +78,7 @@ public class HCatRetentionTest extends BaseTestClass {
         HadoopUtil.recreateDir(clusterFS, baseTestHDFSDir);
         cli = cluster.getClusterHelper().getHCatClient();
         bundle = new Bundle(BundleUtil.readHCat2Bundle(), cluster);
-        bundle.generateUniqueBundle();
+        bundle.generateUniqueBundle(this);
         bundle.submitClusters(prism);
     }
 

http://git-wip-us.apache.org/repos/asf/falcon/blob/0692b241/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 58ef941..7da8ef1 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
@@ -30,7 +30,6 @@ import org.apache.falcon.regression.core.helpers.ColoHelper;
 import org.apache.falcon.regression.core.helpers.entity.AbstractEntityHelper;
 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.HadoopUtil;
 import org.apache.falcon.regression.core.util.InstanceUtil;
 import org.apache.falcon.regression.core.util.OSUtil;
@@ -71,8 +70,7 @@ public class EntitySummaryTest extends BaseTestClass {
     private OozieClient cluster1OC = serverOC.get(0);
     private OozieClient cluster2OC = serverOC.get(1);
     private FileSystem cluster1FS = serverFS.get(0);
-    private String testDir = "/EntitySummaryTest";
-    private String baseTestHDFSDir = baseHDFSDir + testDir;
+    private String baseTestHDFSDir = cleanAndGetTestDir();
     private String aggregateWorkflowDir = baseTestHDFSDir + "/aggregator";
     private String sourcePath = baseTestHDFSDir + "/source";
     private String feedDataLocation = baseTestHDFSDir + "/source" + MINUTE_DATE_PATTERN;
@@ -87,7 +85,7 @@ public class EntitySummaryTest extends BaseTestClass {
         Bundle bundle = BundleUtil.readELBundle();
         for (int i = 0; i <= 1; i++) {
             bundles[i] = new Bundle(bundle, servers.get(i));
-            bundles[i].generateUniqueBundle();
+            bundles[i].generateUniqueBundle(this);
             bundles[i].setProcessWorkflow(aggregateWorkflowDir);
             bundles[i].setInputFeedDataPath(feedDataLocation);
         }
@@ -100,7 +98,7 @@ public class EntitySummaryTest extends BaseTestClass {
     @AfterMethod(alwaysRun = true)
     public void tearDown() throws IOException {
         cleanTestsDirs();
-        CleanupUtil.cleanAllEntities(prism);
+        removeTestClassEntities();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/falcon/blob/0692b241/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 f29cbfe..2ec2b20 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
@@ -57,7 +57,7 @@ public class LineageApiProcessInstanceTest extends BaseTestClass {
     private ColoHelper cluster = servers.get(0);
     private FileSystem clusterFS = serverFS.get(0);
     private LineageHelper lineageHelper;
-    private String baseTestHDFSDir = baseHDFSDir + "/LineageApiInstanceTest";
+    private String baseTestHDFSDir = cleanAndGetTestDir();
     private String aggregateWorkflowDir = baseTestHDFSDir + "/aggregator";
     private String feedInputPrefix = baseTestHDFSDir + "/input";
     private String feedInputPath = feedInputPrefix + MINUTE_DATE_PATTERN;
@@ -81,7 +81,7 @@ public class LineageApiProcessInstanceTest extends BaseTestClass {
         HadoopUtil.uploadDir(clusterFS, aggregateWorkflowDir, OSUtil.RESOURCES_OOZIE);
 
         bundles[0] = new Bundle(BundleUtil.readELBundle(), cluster);
-        bundles[0].generateUniqueBundle();
+        bundles[0].generateUniqueBundle(this);
 
         bundles[0].setInputFeedDataPath(feedInputPath);
 
@@ -119,7 +119,7 @@ public class LineageApiProcessInstanceTest extends BaseTestClass {
 
     @AfterMethod(alwaysRun = true, lastTimeOnly = true)
     public void tearDown() {
-        removeBundles();
+        removeTestClassEntities();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/falcon/blob/0692b241/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/lineage/LineageApiTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/lineage/LineageApiTest.java b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/lineage/LineageApiTest.java
index 0daa0f0..9b31df9 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/lineage/LineageApiTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/lineage/LineageApiTest.java
@@ -35,7 +35,6 @@ import org.apache.falcon.regression.core.response.lineage.VertexResult;
 import org.apache.falcon.regression.core.response.lineage.VerticesResult;
 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.Generator;
 import org.apache.falcon.regression.core.util.GraphAssert;
 import org.apache.falcon.regression.testHelper.BaseTestClass;
@@ -65,7 +64,7 @@ public class LineageApiTest extends BaseTestClass {
     private static final String INVALID_ARGUMENT_STR = "Invalid argument";
     private LineageHelper lineageHelper;
     private final ColoHelper cluster = servers.get(0);
-    private final String baseTestHDFSDir = baseHDFSDir + '/' + TEST_NAME;
+    private final String baseTestHDFSDir = cleanAndGetTestDir();
     private final String feedInputPath = baseTestHDFSDir + "/input";
     private final String feedOutputPath = baseTestHDFSDir + "/output";
     // use 5 <= x < 10 input feeds
@@ -83,9 +82,8 @@ public class LineageApiTest extends BaseTestClass {
 
     @BeforeMethod(alwaysRun = true, firstTimeOnly = true)
     public void setUp() throws Exception {
-        CleanupUtil.cleanAllEntities(prism);
         Bundle bundle = BundleUtil.readELBundle();
-        bundle.generateUniqueBundle();
+        bundle.generateUniqueBundle(this);
         bundles[0] = new Bundle(bundle, cluster);
         final List<String> clusterStrings = bundles[0].getClusters();
         Assert.assertEquals(clusterStrings.size(), 1, "Expecting only 1 clusterMerlin.");
@@ -96,8 +94,10 @@ public class LineageApiTest extends BaseTestClass {
         LOGGER.info("numOutputFeeds = " + numOutputFeeds);
         final FeedMerlin inputMerlin = new FeedMerlin(bundles[0].getInputFeedFromBundle());
         inputMerlin.setTags(TEST_TAG);
+        String namePrefix = this.getClass().getSimpleName() + '-';
         inputFeeds = generateFeeds(numInputFeeds, inputMerlin,
-            Generator.getNameGenerator("infeed", inputMerlin.getName()),
+            Generator.getNameGenerator(namePrefix + "infeed",
+                inputMerlin.getName().replace(namePrefix, "")),
             Generator.getHadoopPathGenerator(feedInputPath, MINUTE_DATE_PATTERN));
         for (FeedMerlin feed : inputFeeds) {
             AssertUtil.assertSucceeded(prism.getFeedHelper().submitEntity(feed.toString()));
@@ -106,7 +106,8 @@ public class LineageApiTest extends BaseTestClass {
         FeedMerlin outputMerlin = new FeedMerlin(bundles[0].getOutputFeedFromBundle());
         outputMerlin.setTags(TEST_TAG);
         outputFeeds = generateFeeds(numOutputFeeds, outputMerlin,
-            Generator.getNameGenerator("outfeed", outputMerlin.getName()),
+            Generator.getNameGenerator(namePrefix + "outfeed",
+                outputMerlin.getName().replace(namePrefix, "")),
             Generator.getHadoopPathGenerator(feedOutputPath, MINUTE_DATE_PATTERN));
         for (FeedMerlin feed : outputFeeds) {
             AssertUtil.assertSucceeded(prism.getFeedHelper().submitEntity(feed.toString()));
@@ -130,13 +131,7 @@ public class LineageApiTest extends BaseTestClass {
 
     @AfterMethod(alwaysRun = true, lastTimeOnly = true)
     public void tearDown() {
-        for (FeedMerlin inputFeed : inputFeeds) {
-            CleanupUtil.deleteQuietly(prism.getFeedHelper(), inputFeed.toString());
-        }
-        for (FeedMerlin outputFeed : outputFeeds) {
-            CleanupUtil.deleteQuietly(prism.getFeedHelper(), outputFeed.toString());
-        }
-        removeBundles();
+        removeTestClassEntities();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/falcon/blob/0692b241/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 b90c8ed..148d6ea 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
@@ -62,8 +62,7 @@ public class ListFeedInstancesTest extends BaseTestClass {
     private static final Logger LOGGER = Logger.getLogger(ListFeedInstancesTest.class);
     private ColoHelper cluster2 = servers.get(1);
     private OozieClient cluster2OC = serverOC.get(1);
-    private String testDir = "/ListFeedInstancesTest";
-    private String baseTestHDFSDir = baseHDFSDir + testDir;
+    private String baseTestHDFSDir = cleanAndGetTestDir();
     private String aggregateWorkflowDir = baseTestHDFSDir + "/aggregator";
     private String sourcePath = baseTestHDFSDir + "/source";
     private String feedDataLocation = sourcePath + MINUTE_DATE_PATTERN;
@@ -83,7 +82,7 @@ public class ListFeedInstancesTest extends BaseTestClass {
         Bundle bundle = BundleUtil.readELBundle();
         for (int i = 0; i < 2; i++) {
             bundles[i] = new Bundle(bundle, servers.get(i));
-            bundles[i].generateUniqueBundle();
+            bundles[i].generateUniqueBundle(this);
         }
         prepareScenario();
     }
@@ -484,6 +483,6 @@ public class ListFeedInstancesTest extends BaseTestClass {
 
     @AfterClass(alwaysRun = true)
     public void tearDown() throws IOException {
-        removeBundles();
+        removeTestClassEntities();
     }
 }

http://git-wip-us.apache.org/repos/asf/falcon/blob/0692b241/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 49efcb8..66d1886 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
@@ -49,7 +49,7 @@ public class ListProcessInstancesTest extends BaseTestClass {
     private static final Logger LOGGER = Logger.getLogger(ListProcessInstancesTest.class);
     private ColoHelper cluster = servers.get(0);
     private OozieClient clusterOC = serverOC.get(0);
-    private String baseTestHDFSDir = baseHDFSDir + "/ListProcessInstancesTest";
+    private String baseTestHDFSDir = cleanAndGetTestDir();
     private String aggregateWorkflowDir = baseTestHDFSDir + "/aggregator";
     private String sourcePath = baseTestHDFSDir + "/source";
     private String feedDataLocation = sourcePath + MINUTE_DATE_PATTERN;
@@ -68,7 +68,7 @@ public class ListProcessInstancesTest extends BaseTestClass {
     public void prepareData() throws Exception {
         bundles[0] = BundleUtil.readELBundle();
         bundles[0] = new Bundle(bundles[0], servers.get(0));
-        bundles[0].generateUniqueBundle();
+        bundles[0].generateUniqueBundle(this);
         //prepare process
         bundles[0].setProcessWorkflow(aggregateWorkflowDir);
         bundles[0].setInputFeedDataPath(feedDataLocation);
@@ -86,7 +86,7 @@ public class ListProcessInstancesTest extends BaseTestClass {
 
     @AfterMethod(alwaysRun = true)
     public void tearDown() throws IOException {
-        removeBundles();
+        removeTestClassEntities();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/falcon/blob/0692b241/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 b20f0b6..36d1ce0 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
@@ -23,7 +23,6 @@ import org.apache.falcon.regression.core.helpers.ColoHelper;
 import org.apache.falcon.regression.core.response.ServiceResponse;
 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.XmlUtil;
 import org.apache.falcon.regression.testHelper.BaseTestClass;
@@ -52,8 +51,7 @@ import java.util.List;
 public class ProcessPipelineTest extends BaseTestClass{
     private static final Logger LOGGER = Logger.getLogger(ProcessPipelineTest.class);
     private ColoHelper cluster = servers.get(0);
-    private String testDir = "/ProcessPipelineTest";
-    private String baseTestHDFSDir = baseHDFSDir + testDir;
+    private String baseTestHDFSDir = cleanAndGetTestDir();
     private String aggregateWorkflowDir = baseTestHDFSDir + "/aggregator";
 
     @BeforeClass(alwaysRun = true)
@@ -65,13 +63,13 @@ public class ProcessPipelineTest extends BaseTestClass{
     public void prepareData() throws IOException {
         bundles[0] = BundleUtil.readELBundle();
         bundles[0] = new Bundle(bundles[0], servers.get(0));
-        bundles[0].generateUniqueBundle();
+        bundles[0].generateUniqueBundle(this);
         bundles[0].setProcessWorkflow(aggregateWorkflowDir);
     }
 
     @AfterMethod(alwaysRun = true)
     public void tearDown(){
-        removeBundles();
+        removeTestClassEntities();
     }
 
     /**
@@ -86,37 +84,33 @@ public class ProcessPipelineTest extends BaseTestClass{
         //match processes to pipelines
         HashMap<String, List<String>> map = new HashMap<String, List<String>>();
         //index for few different pipelines
-        try{
-            for(int p = 0, i = 0, n = 0, d = 3; p < 3; p++, d++){
-                n += d + 1;
-                String pipeline = "pipeline" + p;
-                map.put(pipeline, new ArrayList<String>());
-                //index for new processes for current pipeline
-                for(; i < n; i++){
-                    String processName = "process-" + i;
-                    bundles[0].setProcessName(processName);
-                    bundles[0].setProcessPipeline(pipeline);
-                    bundles[0].submitProcess(true);
-                    map.get(pipeline).add(processName);
-                }
+        for(int p = 0, i = 0, n = 0, d = 3; p < 3; p++, d++){
+            n += d + 1;
+            String pipeline = "pipeline" + p;
+            map.put(pipeline, new ArrayList<String>());
+            //index for new processes for current pipeline
+            for(; i < n; i++){
+                String processName = this.getClass().getSimpleName() + "-process-" + i;
+                bundles[0].setProcessName(processName);
+                bundles[0].setProcessPipeline(pipeline);
+                bundles[0].submitProcess(true);
+                map.get(pipeline).add(processName);
             }
-            LOGGER.info("Expected set of processes: " + map);
-            //now go through pipelines and check that their processes lists match to expected
-            for(int p = 0, n = 3; p < 3; p++, n++){
-                String pipeline = "pipeline" + p;
-                ServiceResponse response = prism.getProcessHelper().getListByPipeline(pipeline);
-                EntityElement[] processes = response.getEntityList().getElements();
-                //check that all retrieved processes match to expected list
-                List<String> expected = map.get(pipeline);
-                Assert.assertEquals(processes.length, expected.size(),
-                    String.format("Invalid number of processes for pipeline [%s].", 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));
-                }
+        }
+        LOGGER.info("Expected set of processes: " + map);
+        //now go through pipelines and check that their processes lists match to expected
+        for(int p = 0, n = 3; p < 3; p++, n++){
+            String pipeline = "pipeline" + p;
+            ServiceResponse response = prism.getProcessHelper().getListByPipeline(pipeline);
+            EntityElement[] processes = response.getEntityList().getElements();
+            //check that all retrieved processes match to expected list
+            List<String> expected = map.get(pipeline);
+            Assert.assertEquals(processes.length, expected.size(),
+                String.format("Invalid number of processes for pipeline [%s].", 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 {
-            CleanupUtil.cleanAllProcessesQuietly(prism, prism.getProcessHelper());
         }
     }
 

http://git-wip-us.apache.org/repos/asf/falcon/blob/0692b241/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/EntityDryRunTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/EntityDryRunTest.java b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/EntityDryRunTest.java
index 92adf23..652f637 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/EntityDryRunTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/EntityDryRunTest.java
@@ -49,7 +49,7 @@ public class EntityDryRunTest extends BaseTestClass {
     private ColoHelper cluster = servers.get(0);
     private FileSystem clusterFS = serverFS.get(0);
     private OozieClient clusterOC = serverOC.get(0);
-    private String baseTestHDFSDir = baseHDFSDir + "/EntityDryRunTest";
+    private String baseTestHDFSDir = cleanAndGetTestDir();
     private String feedInputPath = baseTestHDFSDir + "/input" + MINUTE_DATE_PATTERN;
     private String feedOutputPath = baseTestHDFSDir + "/output-data" + MINUTE_DATE_PATTERN;
     private String aggregateWorkflowDir = baseTestHDFSDir + "/aggregator";
@@ -68,7 +68,7 @@ public class EntityDryRunTest extends BaseTestClass {
     public void setup() throws Exception {
         bundles[0] = BundleUtil.readELBundle();
         bundles[0] = new Bundle(bundles[0], cluster);
-        bundles[0].generateUniqueBundle();
+        bundles[0].generateUniqueBundle(this);
         bundles[0].setInputFeedDataPath(feedInputPath);
         bundles[0].setOutputFeedLocationData(feedOutputPath);
         bundles[0].setProcessWorkflow(aggregateWorkflowDir);
@@ -76,7 +76,7 @@ public class EntityDryRunTest extends BaseTestClass {
 
     @AfterMethod(alwaysRun = true)
     public void tearDown() {
-        removeBundles();
+        removeTestClassEntities();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/falcon/blob/0692b241/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/FeedDelayParallelTimeoutTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/FeedDelayParallelTimeoutTest.java b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/FeedDelayParallelTimeoutTest.java
index 847b23d..a829bd1 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/FeedDelayParallelTimeoutTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/FeedDelayParallelTimeoutTest.java
@@ -41,7 +41,7 @@ public class FeedDelayParallelTimeoutTest extends BaseTestClass {
     private ColoHelper cluster1 = servers.get(0);
     private ColoHelper cluster2 = servers.get(1);
 
-    private String baseTestDir = baseHDFSDir + "/FeedDelayParallelTimeoutTest";
+    private String baseTestDir = cleanAndGetTestDir();
     private String feedInputPath = baseTestDir + MINUTE_DATE_PATTERN;
     private String aggregateWorkflowDir = baseTestDir + "/aggregator";
     private static final Logger LOGGER = Logger.getLogger(FeedDelayParallelTimeoutTest.class);
@@ -57,15 +57,15 @@ public class FeedDelayParallelTimeoutTest extends BaseTestClass {
         bundles[0] = new Bundle(bundle, cluster1);
         bundles[1] = new Bundle(bundle, cluster2);
 
-        bundles[0].generateUniqueBundle();
-        bundles[1].generateUniqueBundle();
+        bundles[0].generateUniqueBundle(this);
+        bundles[1].generateUniqueBundle(this);
         bundles[0].setProcessWorkflow(aggregateWorkflowDir);
         bundles[1].setProcessWorkflow(aggregateWorkflowDir);
     }
 
     @AfterMethod(alwaysRun = true)
     public void tearDown() {
-        removeBundles();
+        removeTestClassEntities();
     }
 
     @Test(enabled = true, timeOut = 12000000)

http://git-wip-us.apache.org/repos/asf/falcon/blob/0692b241/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 4bd91e4..3a5d71b 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
@@ -69,7 +69,7 @@ import java.util.Random;
 @Test(groups = "distributed")
 public class NewPrismProcessUpdateTest extends BaseTestClass {
 
-    private String baseTestDir = baseHDFSDir + "/NewPrismProcessUpdateTest";
+    private String baseTestDir = cleanAndGetTestDir();
     private String inputFeedPath = baseTestDir + MINUTE_DATE_PATTERN;
     private String workflowPath = baseTestDir + "/falcon-oozie-wf";
     private String workflowPath2 = baseTestDir + "/falcon-oozie-wf2";
@@ -88,11 +88,11 @@ public class NewPrismProcessUpdateTest extends BaseTestClass {
     public void testSetup() throws Exception {
         Bundle b = BundleUtil.readUpdateBundle();
         bundles[0] = new Bundle(b, cluster1);
-        bundles[0].generateUniqueBundle();
+        bundles[0].generateUniqueBundle(this);
         bundles[1] = new Bundle(b, cluster2);
-        bundles[1].generateUniqueBundle();
+        bundles[1].generateUniqueBundle(this);
         bundles[2] = new Bundle(b, cluster3);
-        bundles[2].generateUniqueBundle();
+        bundles[2].generateUniqueBundle(this);
         setBundleWFPath(bundles[0], bundles[1], bundles[2]);
         bundles[1].addClusterToBundle(bundles[2].getClusters().get(0),
                 ClusterType.TARGET, null, null);
@@ -112,7 +112,7 @@ public class NewPrismProcessUpdateTest extends BaseTestClass {
 
     @AfterMethod(alwaysRun = true)
     public void tearDown() {
-        removeBundles();
+        removeTestClassEntities();
     }
 
     @Test(groups = { "multiCluster" }, timeOut = 1200000)
@@ -248,7 +248,7 @@ public class NewPrismProcessUpdateTest extends BaseTestClass {
     @Test(groups = { "multiCluster" }, timeOut = 1800000)
     public void updateProcessConcurrencyWorkflowExecutionInEachColoWithOneColoDown()
         throws Exception {
-        //bundles[1].generateUniqueBundle();
+        //bundles[1].generateUniqueBundle(this);
         bundles[1].submitBundle(prism);
         //now to schedule in 1 colo and let it remain in another
         AssertUtil.assertSucceeded(
@@ -371,7 +371,7 @@ public class NewPrismProcessUpdateTest extends BaseTestClass {
 
     @Test(groups = { "multiCluster" }, timeOut = 1200000)
     public void updateProcessNameInEachColoWithOneProcessRunning() throws Exception {
-        //bundles[1].generateUniqueBundle();
+        //bundles[1].generateUniqueBundle(this);
         bundles[1].submitBundle(prism);
         //now to schedule in 1 colo and let it remain in another
         AssertUtil.assertSucceeded(
@@ -386,7 +386,7 @@ public class NewPrismProcessUpdateTest extends BaseTestClass {
         TimeUtil.sleepSeconds(20);
         List<String> oldNominalTimes =
                 OozieUtil.getActionsNominalTime(cluster3, oldBundleId, EntityType.PROCESS);
-        bundles[1].setProcessName("myNewProcessName");
+        bundles[1].setProcessName(this.getClass().getSimpleName() + "-myNewProcessName");
 
         //now to update
         ServiceResponse response =
@@ -405,7 +405,7 @@ public class NewPrismProcessUpdateTest extends BaseTestClass {
         String endTime = TimeUtil.getTimeWrtSystemTime(10);
         bundles[1].setProcessValidity(startTime, endTime);
 
-        //bundles[1].generateUniqueBundle();
+        //bundles[1].generateUniqueBundle(this);
         bundles[1].submitBundle(prism);
         //now to schedule in 1 colo and let it remain in another
         AssertUtil.assertSucceeded(
@@ -1455,7 +1455,7 @@ public class NewPrismProcessUpdateTest extends BaseTestClass {
 
             b = new Bundle(b, cluster1);
             b.setProcessWorkflow(workflowPath);
-            b.generateUniqueBundle();
+            b.generateUniqueBundle(this);
 
             b.setProcessValidity(TimeUtil.getTimeWrtSystemTime(-10),
                     TimeUtil.getTimeWrtSystemTime(15));

http://git-wip-us.apache.org/repos/asf/falcon/blob/0692b241/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/OptionalInputTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/OptionalInputTest.java b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/OptionalInputTest.java
index 1295909..95de483 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/OptionalInputTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/OptionalInputTest.java
@@ -50,7 +50,7 @@ public class OptionalInputTest extends BaseTestClass {
     private ColoHelper cluster = servers.get(0);
     private FileSystem clusterFS = serverFS.get(0);
     private OozieClient oozieClient = serverOC.get(0);
-    private String baseTestDir = baseHDFSDir + "/OptionalInputTest";
+    private String baseTestDir = cleanAndGetTestDir();
     private String inputPath = baseTestDir + "/input";
     private String aggregateWorkflowDir = baseTestDir + "/aggregator";
     private static final Logger LOGGER = Logger.getLogger(OptionalInputTest.class);
@@ -64,14 +64,14 @@ public class OptionalInputTest extends BaseTestClass {
     public void setup() throws Exception {
         bundles[0] = BundleUtil.readELBundle();
         bundles[0] = new Bundle(bundles[0], cluster);
-        bundles[0].generateUniqueBundle();
+        bundles[0].generateUniqueBundle(this);
         bundles[0].setProcessWorkflow(aggregateWorkflowDir);
     }
 
     @AfterMethod(alwaysRun = true)
     public void tearDown() throws Exception {
         HadoopUtil.deleteDirIfExists(inputPath + "/", clusterFS);
-        removeBundles();
+        removeTestClassEntities();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/falcon/blob/0692b241/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismClusterDeleteTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismClusterDeleteTest.java b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismClusterDeleteTest.java
index 47e0087..f69ccb6 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismClusterDeleteTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismClusterDeleteTest.java
@@ -44,7 +44,7 @@ public class PrismClusterDeleteTest extends BaseTestClass {
     private boolean restartRequired;
     private ColoHelper cluster1 = servers.get(0);
     private ColoHelper cluster2 = servers.get(1);
-    private String aggregateWorkflowDir = baseHDFSDir + "/PrismClusterDeleteTest/aggregator";
+    private String aggregateWorkflowDir = cleanAndGetTestDir() + "/aggregator";
 
     @BeforeClass(alwaysRun = true)
     public void uploadWorkflow() throws Exception {
@@ -56,7 +56,7 @@ public class PrismClusterDeleteTest extends BaseTestClass {
         restartRequired = false;
         Bundle bundle = BundleUtil.readLateDataBundle();
         bundles[0] = new Bundle(bundle, cluster1);
-        bundles[0].generateUniqueBundle();
+        bundles[0].generateUniqueBundle(this);
         bundles[0].setProcessWorkflow(aggregateWorkflowDir);
     }
 
@@ -65,7 +65,7 @@ public class PrismClusterDeleteTest extends BaseTestClass {
         if (restartRequired) {
             Util.restartService(cluster1.getFeedHelper());
         }
-        removeBundles();
+        removeTestClassEntities();
     }
 
 

http://git-wip-us.apache.org/repos/asf/falcon/blob/0692b241/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismConcurrentRequestTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismConcurrentRequestTest.java b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismConcurrentRequestTest.java
index 69d38ad..515e97e 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismConcurrentRequestTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismConcurrentRequestTest.java
@@ -49,7 +49,7 @@ public class PrismConcurrentRequestTest extends BaseTestClass {
     private OozieClient clusterOC = serverOC.get(0);
     private ThreadGroup brotherGrimm = null;
     private Brother[] brothers = null;
-    private String aggregateWorkflowDir = baseHDFSDir + "/PrismConcurrentRequest/aggregator";
+    private String aggregateWorkflowDir = cleanAndGetTestDir() + "/aggregator";
     private static final Logger LOGGER = Logger.getLogger(PrismConcurrentRequestTest.class);
     private String feed;
 
@@ -61,7 +61,7 @@ public class PrismConcurrentRequestTest extends BaseTestClass {
     @BeforeMethod(alwaysRun = true)
     public void setup() throws Exception {
         bundles[0] = BundleUtil.readELBundle();
-        bundles[0].generateUniqueBundle();
+        bundles[0].generateUniqueBundle(this);
         bundles[0] = new Bundle(bundles[0], cluster);
         bundles[0].setProcessWorkflow(aggregateWorkflowDir);
         brotherGrimm = new ThreadGroup("mixed");
@@ -71,7 +71,7 @@ public class PrismConcurrentRequestTest extends BaseTestClass {
 
     @AfterMethod(alwaysRun = true)
     public void tearDown() {
-        removeBundles();
+        removeTestClassEntities();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/falcon/blob/0692b241/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedDeleteTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedDeleteTest.java b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedDeleteTest.java
index d65d98e..470f1b8 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedDeleteTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedDeleteTest.java
@@ -56,7 +56,8 @@ public class PrismFeedDeleteTest extends BaseTestClass {
     private ColoHelper cluster2 = servers.get(1);
     private String cluster1Colo = cluster1.getClusterHelper().getColoName();
     private String cluster2Colo = cluster2.getClusterHelper().getColoName();
-    private String aggregateWorkflowDir = baseHDFSDir + "/PrismFeedDeleteTest/aggregator";
+    private String baseTestHDFSDir = cleanAndGetTestDir();
+    private String aggregateWorkflowDir = baseTestHDFSDir + "/aggregator";
     private static final Logger LOGGER = Logger.getLogger(PrismFeedDeleteTest.class);
 
     @BeforeClass(alwaysRun = true)
@@ -69,11 +70,11 @@ public class PrismFeedDeleteTest extends BaseTestClass {
         restartRequired = false;
         Bundle bundle = BundleUtil.readELBundle();
         bundles[0] = new Bundle(bundle, cluster1);
-        bundles[0].generateUniqueBundle();
+        bundles[0].generateUniqueBundle(this);
         bundles[0].setProcessWorkflow(aggregateWorkflowDir);
 
         bundles[1] = new Bundle(bundle, cluster2);
-        bundles[1].generateUniqueBundle();
+        bundles[1].generateUniqueBundle(this);
         bundles[1].setProcessWorkflow(aggregateWorkflowDir);
     }
 
@@ -82,7 +83,7 @@ public class PrismFeedDeleteTest extends BaseTestClass {
         if (restartRequired) {
             Util.restartService(cluster1.getFeedHelper());
         }
-        removeBundles();
+        removeTestClassEntities();
     }
 
     /**
@@ -386,7 +387,7 @@ public class PrismFeedDeleteTest extends BaseTestClass {
                 .withValidity(startTimeServer1, "2099-10-01T12:10Z")
                 .withClusterType(ClusterType.SOURCE)
                 .withPartition("${cluster.colo}")
-                .withDataLocation(baseHDFSDir + "/localDC/rc/billing" + MINUTE_DATE_PATTERN)
+                .withDataLocation(baseTestHDFSDir + "/localDC/rc/billing" + MINUTE_DATE_PATTERN)
                 .build())
             .toString();
 
@@ -396,7 +397,7 @@ public class PrismFeedDeleteTest extends BaseTestClass {
                 .withValidity(startTimeServer2, "2099-10-01T12:25Z")
                 .withClusterType(ClusterType.TARGET)
                 .withDataLocation(
-                    baseHDFSDir + "/clusterPath/localDC/rc/billing" + MINUTE_DATE_PATTERN)
+                    baseTestHDFSDir + "/clusterPath/localDC/rc/billing" + MINUTE_DATE_PATTERN)
                 .build()).toString();
 
         Util.shutDownService(cluster1.getFeedHelper());
@@ -809,7 +810,7 @@ public class PrismFeedDeleteTest extends BaseTestClass {
                 .withValidity(startTimeServer1, "2099-10-01T12:10Z")
                 .withClusterType(ClusterType.SOURCE)
                 .withPartition("${cluster.colo}")
-                .withDataLocation(baseHDFSDir + "/localDC/rc/billing" + MINUTE_DATE_PATTERN)
+                .withDataLocation(baseTestHDFSDir + "/localDC/rc/billing" + MINUTE_DATE_PATTERN)
                 .build())
             .toString();
 
@@ -819,7 +820,7 @@ public class PrismFeedDeleteTest extends BaseTestClass {
                 .withValidity(startTimeServer2, "2099-10-01T12:25Z")
                 .withClusterType(ClusterType.TARGET)
                 .withDataLocation(
-                    baseHDFSDir + "/clusterPath/localDC/rc/billing" + MINUTE_DATE_PATTERN)
+                    baseTestHDFSDir + "/clusterPath/localDC/rc/billing" + MINUTE_DATE_PATTERN)
                 .build()).toString();
 
         LOGGER.info("feed: " + Util.prettyPrintXml(feed));
@@ -913,7 +914,7 @@ public class PrismFeedDeleteTest extends BaseTestClass {
                 .withValidity(startTimeServer1, "2099-10-01T12:10Z")
                 .withClusterType(ClusterType.SOURCE)
                 .withPartition("${cluster.colo}")
-                .withDataLocation(baseHDFSDir + "/localDC/rc/billing" + MINUTE_DATE_PATTERN)
+                .withDataLocation(baseTestHDFSDir + "/localDC/rc/billing" + MINUTE_DATE_PATTERN)
                 .build())
             .toString();
         feed = FeedMerlin.fromString(feed).addFeedCluster(
@@ -922,7 +923,7 @@ public class PrismFeedDeleteTest extends BaseTestClass {
                 .withValidity(startTimeServer2, "2099-10-01T12:25Z")
                 .withClusterType(ClusterType.TARGET)
                 .withDataLocation(
-                    baseHDFSDir + "/clusterPath/localDC/rc/billing" + MINUTE_DATE_PATTERN)
+                    baseTestHDFSDir + "/clusterPath/localDC/rc/billing" + MINUTE_DATE_PATTERN)
                 .build()).toString();
 
         LOGGER.info("feed: " + Util.prettyPrintXml(feed));

http://git-wip-us.apache.org/repos/asf/falcon/blob/0692b241/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedLateReplicationTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedLateReplicationTest.java b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedLateReplicationTest.java
index dd5579f..4221525 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedLateReplicationTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedLateReplicationTest.java
@@ -54,7 +54,7 @@ public class PrismFeedLateReplicationTest extends BaseTestClass {
     private FileSystem cluster1FS = serverFS.get(0);
     private FileSystem cluster2FS = serverFS.get(1);
     private FileSystem cluster3FS = serverFS.get(2);
-    private String baseTestDir = baseHDFSDir + "/PrismFeedLateReplicationTest";
+    private String baseTestDir = cleanAndGetTestDir();
     private String inputPath = baseTestDir + "/input-data" + MINUTE_DATE_PATTERN;
     private String aggregateWorkflowDir = baseTestDir + "/aggregator";
     private static final Logger LOGGER = Logger.getLogger(PrismFeedLateReplicationTest.class);
@@ -69,14 +69,14 @@ public class PrismFeedLateReplicationTest extends BaseTestClass {
         Bundle bundle = BundleUtil.readELBundle();
         for (int i = 0; i < 3; i++) {
             bundles[i] = new Bundle(bundle, servers.get(i));
-            bundles[i].generateUniqueBundle();
+            bundles[i].generateUniqueBundle(this);
             bundles[i].setProcessWorkflow(aggregateWorkflowDir);
         }
     }
 
     @AfterMethod(alwaysRun = true)
     public void tearDown() {
-        removeBundles();
+        removeTestClassEntities();
     }
 
     @Test(groups = {"multiCluster"})

http://git-wip-us.apache.org/repos/asf/falcon/blob/0692b241/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedReplicationPartitionExpTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedReplicationPartitionExpTest.java b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedReplicationPartitionExpTest.java
index eca9efc..b51c4a4 100755
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedReplicationPartitionExpTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedReplicationPartitionExpTest.java
@@ -63,7 +63,7 @@ public class PrismFeedReplicationPartitionExpTest extends BaseTestClass {
     private OozieClient cluster1OC = serverOC.get(0);
     private OozieClient cluster2OC = serverOC.get(1);
     private String testDate = "/2012/10/01/12/";
-    private String baseTestDir = baseHDFSDir + "/PrismFeedReplicationPartitionExpTest";
+    private String baseTestDir = cleanAndGetTestDir();
     private String testBaseDir1 = baseTestDir + "/localDC/rc/billing";
     private String testBaseDir2 = baseTestDir + "/clusterPath/localDC/rc/billing";
     private String testBaseDir3 = baseTestDir + "/dataBillingRC/fetlrc/billing";
@@ -177,7 +177,7 @@ public class PrismFeedReplicationPartitionExpTest extends BaseTestClass {
 
         for (int i = 0; i < 3; i++) {
             bundles[i] = new Bundle(bundle, servers.get(i));
-            bundles[i].generateUniqueBundle();
+            bundles[i].generateUniqueBundle(this);
         }
     }
 
@@ -187,7 +187,7 @@ public class PrismFeedReplicationPartitionExpTest extends BaseTestClass {
             HadoopUtil.deleteDirIfExists(dir, cluster1FS);
             HadoopUtil.deleteDirIfExists(dir, cluster2FS);
         }
-        removeBundles();
+        removeTestClassEntities();
     }
 
 

http://git-wip-us.apache.org/repos/asf/falcon/blob/0692b241/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedReplicationUpdateTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedReplicationUpdateTest.java b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedReplicationUpdateTest.java
index 6298619..9b8e9d3 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedReplicationUpdateTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedReplicationUpdateTest.java
@@ -59,7 +59,7 @@ public class PrismFeedReplicationUpdateTest extends BaseTestClass {
     private String cluster1Colo = cluster1.getClusterHelper().getColoName();
     private String cluster2Colo = cluster2.getClusterHelper().getColoName();
     private String cluster3Colo = cluster3.getClusterHelper().getColoName();
-    private final String baseTestDir = baseHDFSDir + "/PrismFeedReplicationUpdateTest";
+    private final String baseTestDir = cleanAndGetTestDir();
     private final String inputPath = baseTestDir + "/input-data" + MINUTE_DATE_PATTERN;
     private String alternativeInputPath = baseTestDir + "/newFeedPath/input-data"
         + MINUTE_DATE_PATTERN;
@@ -78,14 +78,14 @@ public class PrismFeedReplicationUpdateTest extends BaseTestClass {
 
         for (int i = 0; i < 3; i++) {
             bundles[i] = new Bundle(bundle, servers.get(i));
-            bundles[i].generateUniqueBundle();
+            bundles[i].generateUniqueBundle(this);
             bundles[i].setProcessWorkflow(aggregateWorkflowDir);
         }
     }
 
     @AfterMethod(alwaysRun = true)
     public void tearDown() {
-        removeBundles();
+        removeTestClassEntities();
     }
 
     /**
@@ -205,8 +205,8 @@ public class PrismFeedReplicationUpdateTest extends BaseTestClass {
         outputFeed = FeedMerlin.fromString(outputFeed).clearFeedClusters().toString();
 
         //set new feed input data
-        feed01 = Util.setFeedPathValue(feed01, baseHDFSDir + "/feed01" + MINUTE_DATE_PATTERN);
-        feed02 = Util.setFeedPathValue(feed02, baseHDFSDir + "/feed02" + MINUTE_DATE_PATTERN);
+        feed01 = Util.setFeedPathValue(feed01, baseTestDir + "/feed01" + MINUTE_DATE_PATTERN);
+        feed02 = Util.setFeedPathValue(feed02, baseTestDir + "/feed02" + MINUTE_DATE_PATTERN);
 
         //generate data in both the colos ua1 and ua3
         String prefix = InstanceUtil.getFeedPrefix(feed01);

http://git-wip-us.apache.org/repos/asf/falcon/blob/0692b241/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedResumeTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedResumeTest.java b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedResumeTest.java
index 42cf4f3..d47a160 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedResumeTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedResumeTest.java
@@ -46,7 +46,7 @@ public class PrismFeedResumeTest extends BaseTestClass {
     private OozieClient cluster1OC = serverOC.get(0);
     private OozieClient cluster2OC = serverOC.get(1);
     private boolean restartRequired;
-    private String aggregateWorkflowDir = baseHDFSDir + "/PrismFeedResumeTest/aggregator";
+    private String aggregateWorkflowDir = cleanAndGetTestDir() + "/aggregator";
 
     @BeforeClass(alwaysRun = true)
     public void uploadWorkflow() throws Exception {
@@ -59,7 +59,7 @@ public class PrismFeedResumeTest extends BaseTestClass {
 
         for (int i = 0; i < 2; i++) {
             bundles[i] = new Bundle(bundle, servers.get(i));
-            bundles[i].generateUniqueBundle();
+            bundles[i].generateUniqueBundle(this);
             bundles[i].setProcessWorkflow(aggregateWorkflowDir);
         }
     }
@@ -69,7 +69,7 @@ public class PrismFeedResumeTest extends BaseTestClass {
         if (restartRequired) {
             Util.restartService(cluster1.getFeedHelper());
         }
-        removeBundles();
+        removeTestClassEntities();
     }
 
     @Test(groups = {"prism", "0.2"})

http://git-wip-us.apache.org/repos/asf/falcon/blob/0692b241/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedScheduleTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedScheduleTest.java b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedScheduleTest.java
index 0154591..a7bef6d 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedScheduleTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedScheduleTest.java
@@ -43,7 +43,7 @@ public class PrismFeedScheduleTest extends BaseTestClass {
 
     private OozieClient cluster1OC = serverOC.get(0);
     private OozieClient cluster2OC = serverOC.get(1);
-    private String aggregateWorkflowDir = baseHDFSDir + "/PrismFeedScheduleTest/aggregator";
+    private String aggregateWorkflowDir = cleanAndGetTestDir() + "/aggregator";
     private static final Logger LOGGER = Logger.getLogger(PrismFeedScheduleTest.class);
 
     @BeforeClass(alwaysRun = true)
@@ -57,14 +57,14 @@ public class PrismFeedScheduleTest extends BaseTestClass {
 
         for (int i = 0; i < 2; i++) {
             bundles[i] = new Bundle(bundle, servers.get(i));
-            bundles[i].generateUniqueBundle();
+            bundles[i].generateUniqueBundle(this);
             bundles[i].setProcessWorkflow(aggregateWorkflowDir);
         }
     }
 
     @AfterMethod(alwaysRun = true)
     public void tearDown() {
-        removeBundles();
+        removeTestClassEntities();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/falcon/blob/0692b241/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 d4bcfeb..1ef0429 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
@@ -51,7 +51,8 @@ public class PrismFeedSnSTest extends BaseTestClass {
     private OozieClient cluster1OC = serverOC.get(0);
     private OozieClient cluster2OC = serverOC.get(1);
     private boolean restartRequired;
-    private String aggregateWorkflowDir = baseHDFSDir + "/PrismFeedSnSTest/aggregator";
+    private String baseTestHDFSDir = cleanAndGetTestDir();
+    private String aggregateWorkflowDir = baseTestHDFSDir + "/aggregator";
     private static final Logger LOGGER = Logger.getLogger(PrismFeedSnSTest.class);
     private String feed1, feed2;
 
@@ -66,7 +67,7 @@ public class PrismFeedSnSTest extends BaseTestClass {
         Bundle bundle = BundleUtil.readELBundle();
         for (int i = 0; i < 2; i++) {
             bundles[i] = new Bundle(bundle, servers.get(i));
-            bundles[i].generateUniqueBundle();
+            bundles[i].generateUniqueBundle(this);
             bundles[i].setProcessWorkflow(aggregateWorkflowDir);
         }
         feed1 = bundles[0].getDataSets().get(0);
@@ -78,7 +79,7 @@ public class PrismFeedSnSTest extends BaseTestClass {
         if (restartRequired) {
             Util.restartService(cluster1.getFeedHelper());
         }
-        removeBundles();
+        removeTestClassEntities();
     }
 
     /**
@@ -387,7 +388,7 @@ public class PrismFeedSnSTest extends BaseTestClass {
                 .withValidity(startTimeUA1, "2099-10-01T12:10Z")
                 .withClusterType(ClusterType.SOURCE)
                 .withPartition("${cluster.colo}")
-                .withDataLocation(baseHDFSDir + "/localDC/rc/billing" + MINUTE_DATE_PATTERN)
+                .withDataLocation(baseTestHDFSDir + "/localDC/rc/billing" + MINUTE_DATE_PATTERN)
                 .build())
             .toString();
         feed = FeedMerlin.fromString(feed).addFeedCluster(
@@ -396,7 +397,7 @@ public class PrismFeedSnSTest extends BaseTestClass {
                 .withValidity(startTimeUA2, "2099-10-01T12:25Z")
                 .withClusterType(ClusterType.TARGET)
                 .withDataLocation(
-                    baseHDFSDir + "/clusterPath/localDC/rc/billing" + MINUTE_DATE_PATTERN)
+                    baseTestHDFSDir + "/clusterPath/localDC/rc/billing" + MINUTE_DATE_PATTERN)
                 .build()).toString();
         LOGGER.info("feed: " + Util.prettyPrintXml(feed));
 

http://git-wip-us.apache.org/repos/asf/falcon/blob/0692b241/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedSuspendTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedSuspendTest.java b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedSuspendTest.java
index ae0cff3..c02a28f 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedSuspendTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedSuspendTest.java
@@ -44,7 +44,7 @@ public class PrismFeedSuspendTest extends BaseTestClass {
     private ColoHelper cluster2 = servers.get(1);
     private OozieClient cluster1OC = serverOC.get(0);
     private OozieClient cluster2OC = serverOC.get(1);
-    private String aggregateWorkflowDir = baseHDFSDir + "/PrismFeedSuspendTest/aggregator";
+    private String aggregateWorkflowDir = cleanAndGetTestDir() + "/aggregator";
 
     @BeforeClass(alwaysRun = true)
     public void uploadWorkflow() throws Exception {
@@ -56,14 +56,14 @@ public class PrismFeedSuspendTest extends BaseTestClass {
         Bundle bundle = BundleUtil.readELBundle();
         for (int i = 0; i < 2; i++) {
             bundles[i] = new Bundle(bundle, servers.get(i));
-            bundles[i].generateUniqueBundle();
+            bundles[i].generateUniqueBundle(this);
             bundles[i].setProcessWorkflow(aggregateWorkflowDir);
         }
     }
 
     @AfterMethod(alwaysRun = true)
     public void tearDown() {
-        removeBundles();
+        removeTestClassEntities();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/falcon/blob/0692b241/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedUpdateTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedUpdateTest.java b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedUpdateTest.java
index 49795bc..7910fd7 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedUpdateTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedUpdateTest.java
@@ -60,9 +60,9 @@ public class PrismFeedUpdateTest extends BaseTestClass {
     private ColoHelper cluster2 = servers.get(1);
     private FileSystem server1FS = serverFS.get(0);
     private OozieClient cluster1OC = serverOC.get(0);
-    private String baseTestDir = baseHDFSDir + "/PrismFeedUpdateTest";
+    private String baseTestDir = cleanAndGetTestDir();
     private String aggregateWorkflowDir = baseTestDir + "/aggregator";
-    private String workflowForNoIpOp = baseHDFSDir + "/PrismProcessScheduleTest/noinop";
+    private String workflowForNoIpOp = baseTestDir + "/noinop";
     private final String cluster1colo = cluster1.getClusterHelper().getColoName();
     private final String cluster2colo = cluster2.getClusterHelper().getColoName();
     private static final Logger LOGGER = Logger.getLogger(PrismFeedUpdateTest.class);
@@ -79,7 +79,7 @@ public class PrismFeedUpdateTest extends BaseTestClass {
         Bundle bundle = BundleUtil.readELBundle();
         for (int i = 0; i < 2; i++) {
             bundles[i] = new Bundle(bundle, servers.get(i));
-            bundles[i].generateUniqueBundle();
+            bundles[i].generateUniqueBundle(this);
             bundles[i].setProcessWorkflow(aggregateWorkflowDir);
             bundles[i].setInputFeedDataPath(feedInputTimedOutPath);
         }
@@ -87,7 +87,7 @@ public class PrismFeedUpdateTest extends BaseTestClass {
 
     @AfterMethod(alwaysRun = true)
     public void tearDown() {
-        removeBundles();
+        removeTestClassEntities();
     }
 
     /**
@@ -187,7 +187,8 @@ public class PrismFeedUpdateTest extends BaseTestClass {
         //get 2nd process
         String process02 = process01;
         process02 = InstanceUtil
-            .setProcessName(process02, "zeroInputProcess" + new Random().nextInt());
+            .setProcessName(process02, this.getClass().getSimpleName()
+                + "_zeroInputProcess" + new Random().nextInt());
         List<String> feed = new ArrayList<String>();
         feed.add(outputFeed);
         final ProcessMerlin processMerlin = new ProcessMerlin(process02);

http://git-wip-us.apache.org/repos/asf/falcon/blob/0692b241/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismProcessDeleteTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismProcessDeleteTest.java b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismProcessDeleteTest.java
index f11f2e0..f1ff8fe 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismProcessDeleteTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismProcessDeleteTest.java
@@ -49,7 +49,7 @@ public class PrismProcessDeleteTest extends BaseTestClass {
     private Bundle bundle;
     private ColoHelper cluster1 = servers.get(0);
     private ColoHelper cluster2 = servers.get(1);
-    private String aggregateWorkflowDir = baseHDFSDir + "/PrismProcessDeleteTest/aggregator";
+    private String aggregateWorkflowDir = cleanAndGetTestDir() + "/aggregator";
     private static final Logger LOGGER = Logger.getLogger(PrismProcessDeleteTest.class);
 
     @BeforeClass(alwaysRun = true)
@@ -62,14 +62,14 @@ public class PrismProcessDeleteTest extends BaseTestClass {
         bundle = BundleUtil.readLateDataBundle();
         for (int i = 0; i < 2; i++) {
             bundles[i] = new Bundle(bundle, servers.get(i));
-            bundles[i].generateUniqueBundle();
+            bundles[i].generateUniqueBundle(this);
             bundles[i].setProcessWorkflow(aggregateWorkflowDir);
         }
     }
 
     @AfterMethod(alwaysRun = true)
     public void tearDown() {
-        removeBundles();
+        removeTestClassEntities();
     }
 
     /* NOTE: All test cases assume that there are two entities scheduled in each colo

http://git-wip-us.apache.org/repos/asf/falcon/blob/0692b241/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismProcessResumeTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismProcessResumeTest.java b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismProcessResumeTest.java
index d3f37ac..85d52bd 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismProcessResumeTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismProcessResumeTest.java
@@ -46,7 +46,7 @@ public class PrismProcessResumeTest extends BaseTestClass {
     private ColoHelper cluster2 = servers.get(1);
     private OozieClient cluster1OC = serverOC.get(0);
     private OozieClient cluster2OC = serverOC.get(1);
-    private String aggregateWorkflowDir = baseHDFSDir + "/PrismProcessResumeTest/aggregator";
+    private String aggregateWorkflowDir = cleanAndGetTestDir() + "/aggregator";
 
     @BeforeClass(alwaysRun = true)
     public void uploadWorkflow() throws Exception {
@@ -58,14 +58,14 @@ public class PrismProcessResumeTest extends BaseTestClass {
         Bundle bundle = BundleUtil.readLateDataBundle();
         for (int i = 0; i < 2; i++) {
             bundles[i] = new Bundle(bundle, servers.get(i));
-            bundles[i].generateUniqueBundle();
+            bundles[i].generateUniqueBundle(this);
             bundles[i].setProcessWorkflow(aggregateWorkflowDir);
         }
     }
 
     @AfterMethod(alwaysRun = true)
     public void tearDown() {
-        removeBundles();
+        removeTestClassEntities();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/falcon/blob/0692b241/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 c3dcf6e..ccf9e97 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
@@ -51,8 +51,9 @@ public class PrismProcessScheduleTest extends BaseTestClass {
     private ColoHelper cluster2 = servers.get(1);
     private OozieClient cluster1OC = serverOC.get(0);
     private OozieClient cluster2OC = serverOC.get(1);
-    private String aggregateWorkflowDir = baseHDFSDir + "/PrismProcessScheduleTest/aggregator";
-    private String workflowForNoIpOp = baseHDFSDir + "/PrismProcessScheduleTest/noinop";
+    private String baseTestHDFSDir = cleanAndGetTestDir();
+    private String aggregateWorkflowDir = baseTestHDFSDir + "/aggregator";
+    private String workflowForNoIpOp = baseTestHDFSDir + "/noinop";
     private String process1;
     private String process2;
 
@@ -67,7 +68,7 @@ public class PrismProcessScheduleTest extends BaseTestClass {
         Bundle bundle = BundleUtil.readLateDataBundle();
         for (int i = 0; i < 2; i++) {
             bundles[i] = new Bundle(bundle, servers.get(i));
-            bundles[i].generateUniqueBundle();
+            bundles[i].generateUniqueBundle(this);
             bundles[i].setProcessWorkflow(aggregateWorkflowDir);
         }
         process1 = bundles[0].getProcessData();
@@ -76,7 +77,7 @@ public class PrismProcessScheduleTest extends BaseTestClass {
 
     @AfterMethod(alwaysRun = true)
     public void tearDown() {
-        removeBundles();
+        removeTestClassEntities();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/falcon/blob/0692b241/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 b802d0a..04a74a6 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
@@ -47,7 +47,7 @@ public class PrismProcessSnSTest extends BaseTestClass {
     private ColoHelper cluster2 = servers.get(1);
     private OozieClient cluster1OC = serverOC.get(0);
     private OozieClient cluster2OC = serverOC.get(1);
-    private String aggregateWorkflowDir = baseHDFSDir + "/PrismProcessSnSTest/aggregator";
+    private String aggregateWorkflowDir = cleanAndGetTestDir() + "/aggregator";
     private static final Logger LOGGER = Logger.getLogger(PrismProcessSnSTest.class);
     private String process1;
     private String process2;
@@ -62,7 +62,7 @@ public class PrismProcessSnSTest extends BaseTestClass {
         Bundle bundle = BundleUtil.readLateDataBundle();
         for (int i = 0; i < 2; i++) {
             bundles[i] = new Bundle(bundle, servers.get(i));
-            bundles[i].generateUniqueBundle();
+            bundles[i].generateUniqueBundle(this);
             bundles[i].setProcessWorkflow(aggregateWorkflowDir);
         }
         process1 = bundles[0].getProcessData();
@@ -71,7 +71,7 @@ public class PrismProcessSnSTest extends BaseTestClass {
 
     @AfterMethod(alwaysRun = true)
     public void tearDown() {
-        removeBundles();
+        removeTestClassEntities();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/falcon/blob/0692b241/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismProcessSuspendTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismProcessSuspendTest.java b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismProcessSuspendTest.java
index 7c927b0..e38cc67 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismProcessSuspendTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismProcessSuspendTest.java
@@ -45,7 +45,7 @@ public class PrismProcessSuspendTest extends BaseTestClass {
     private  OozieClient cluster1OC = serverOC.get(0);
     private OozieClient cluster2OC = serverOC.get(1);
     private  boolean restartRequired;
-    private String aggregateWorkflowDir = baseHDFSDir + "/PrismProcessSuspendTest/aggregator";
+    private String aggregateWorkflowDir = cleanAndGetTestDir() + "/aggregator";
 
     @BeforeClass(alwaysRun = true)
     public void uploadWorkflow() throws Exception {
@@ -58,7 +58,7 @@ public class PrismProcessSuspendTest extends BaseTestClass {
         Bundle bundle = BundleUtil.readLateDataBundle();
         for (int i = 0; i < 2; i++) {
             bundles[i] = new Bundle(bundle, servers.get(i));
-            bundles[i].generateUniqueBundle();
+            bundles[i].generateUniqueBundle(this);
             bundles[i].setProcessWorkflow(aggregateWorkflowDir);
         }
 
@@ -69,7 +69,7 @@ public class PrismProcessSuspendTest extends BaseTestClass {
         if (restartRequired) {
             Util.restartService(cluster1.getProcessHelper());
         }
-        removeBundles();
+        removeTestClassEntities();
     }
 
 

http://git-wip-us.apache.org/repos/asf/falcon/blob/0692b241/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismSubmitTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismSubmitTest.java b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismSubmitTest.java
index 9cd3a34..508cc08 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismSubmitTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismSubmitTest.java
@@ -45,7 +45,7 @@ public class PrismSubmitTest extends BaseTestClass {
 
     private ColoHelper cluster1 = servers.get(0);
     private ColoHelper cluster2 = servers.get(1);
-    private String baseTestDir = baseHDFSDir + "/PrismSubmitTest";
+    private String baseTestDir = cleanAndGetTestDir();
     private String randomHDFSPath = baseTestDir + "/someRandomPath";
     private String aggregateWorkflowDir = baseTestDir + "/aggregator";
     private boolean restartRequired;
@@ -61,7 +61,7 @@ public class PrismSubmitTest extends BaseTestClass {
         restartRequired = false;
         bundles[0] = BundleUtil.readELBundle();
         bundles[0] = new Bundle(bundles[0], cluster1);
-        bundles[0].generateUniqueBundle();
+        bundles[0].generateUniqueBundle(this);
         bundles[0].setProcessWorkflow(aggregateWorkflowDir);
     }
 
@@ -72,7 +72,7 @@ public class PrismSubmitTest extends BaseTestClass {
             Util.startService(prism.getFeedHelper());
             Util.startService(cluster1.getFeedHelper());
         }
-        removeBundles();
+        removeTestClassEntities();
     }
 
     @Test(groups = "distributed")
@@ -313,7 +313,7 @@ public class PrismSubmitTest extends BaseTestClass {
     public void submitClusterReSubmitAlreadyPartial() throws Exception {
         restartRequired = true;
         bundles[1] = new Bundle(bundles[0], cluster2);
-        bundles[1].generateUniqueBundle();
+        bundles[1].generateUniqueBundle(this);
         bundles[1].setProcessWorkflow(aggregateWorkflowDir);
 
         List<String> beforeCluster1 = cluster1.getClusterHelper().getStoreInfo();

http://git-wip-us.apache.org/repos/asf/falcon/blob/0692b241/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/ProcessPartitionExpVariableTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/ProcessPartitionExpVariableTest.java b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/ProcessPartitionExpVariableTest.java
index 9585b41..a716b83 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/ProcessPartitionExpVariableTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/ProcessPartitionExpVariableTest.java
@@ -54,7 +54,7 @@ public class ProcessPartitionExpVariableTest extends BaseTestClass {
     private ColoHelper cluster = servers.get(0);
     private FileSystem clusterFS = serverFS.get(0);
     private OozieClient clusterOC = serverOC.get(0);
-    private String baseTestDir = baseHDFSDir + "/ProcessPartitionExpVariableTest";
+    private String baseTestDir = cleanAndGetTestDir();
     private String aggregateWorkflowDir = baseTestDir + "/aggregator";
 
     @BeforeClass(alwaysRun = true)
@@ -66,13 +66,13 @@ public class ProcessPartitionExpVariableTest extends BaseTestClass {
     public void setUp() throws Exception {
         bundles[0] = BundleUtil.readELBundle();
         bundles[0] = new Bundle(bundles[0], cluster);
-        bundles[0].generateUniqueBundle();
+        bundles[0].generateUniqueBundle(this);
         bundles[0].setProcessWorkflow(aggregateWorkflowDir);
     }
 
     @AfterMethod(alwaysRun = true)
     public void tearDown() throws Exception {
-        removeBundles();
+        removeTestClassEntities();
         HadoopUtil.deleteDirIfExists(baseTestDir, clusterFS);
     }
 

http://git-wip-us.apache.org/repos/asf/falcon/blob/0692b241/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/RescheduleKilledProcessTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/RescheduleKilledProcessTest.java b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/RescheduleKilledProcessTest.java
index 1ad24c2..a363120 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/RescheduleKilledProcessTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/RescheduleKilledProcessTest.java
@@ -45,7 +45,8 @@ import java.util.Random;
 public class RescheduleKilledProcessTest extends BaseTestClass {
 
     private ColoHelper cluster = servers.get(0);
-    private String aggregateWorkflowDir = baseHDFSDir + "/RescheduleKilledProcessTest/aggregator";
+    private String baseTestHDFSDir = cleanAndGetTestDir();
+    private String aggregateWorkflowDir = baseTestHDFSDir + "/aggregator";
     private static final Logger LOGGER = Logger.getLogger(RescheduleKilledProcessTest.class);
 
     @BeforeClass(alwaysRun = true)
@@ -57,13 +58,13 @@ public class RescheduleKilledProcessTest extends BaseTestClass {
     public void setUp() throws Exception {
         bundles[0] = BundleUtil.readELBundle();
         bundles[0] = new Bundle(bundles[0], cluster);
-        bundles[0].generateUniqueBundle();
+        bundles[0].generateUniqueBundle(this);
         bundles[0].setProcessWorkflow(aggregateWorkflowDir);
     }
 
     @AfterMethod(alwaysRun = true)
     public void tearDown() {
-        removeBundles();
+        removeTestClassEntities();
     }
 
     /**
@@ -76,7 +77,8 @@ public class RescheduleKilledProcessTest extends BaseTestClass {
         String processStartTime = TimeUtil.getTimeWrtSystemTime(-11);
         String processEndTime = TimeUtil.getTimeWrtSystemTime(6);
         String process = bundles[0].getProcessData();
-        process = InstanceUtil.setProcessName(process, "zeroInputProcess" + new Random().nextInt());
+        process = InstanceUtil.setProcessName(process, this.getClass().getSimpleName()
+            + "zeroInputProcess" + new Random().nextInt());
         List<String> feed = new ArrayList<String>();
         feed.add(bundles[0].getOutputFeedFromBundle());
         final ProcessMerlin processMerlin = new ProcessMerlin(process);
@@ -110,7 +112,7 @@ public class RescheduleKilledProcessTest extends BaseTestClass {
         bundles[0].setProcessValidity(TimeUtil.getTimeWrtSystemTime(-11),
             TimeUtil.getTimeWrtSystemTime(6));
 
-        bundles[0].setInputFeedDataPath(baseHDFSDir + "/rawLogs" + MINUTE_DATE_PATTERN);
+        bundles[0].setInputFeedDataPath(baseTestHDFSDir + "/rawLogs" + MINUTE_DATE_PATTERN);
 
         LOGGER.info("process: " + Util.prettyPrintXml(bundles[0].getProcessData()));
 


Mime
View raw message