falcon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From srik...@apache.org
Subject [16/47] Fixes for Checkstyle
Date Fri, 26 Apr 2013 15:50:32 GMT
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/a4d79f0c/common/src/main/java/org/apache/falcon/workflow/engine/AbstractWorkflowEngine.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/falcon/workflow/engine/AbstractWorkflowEngine.java b/common/src/main/java/org/apache/falcon/workflow/engine/AbstractWorkflowEngine.java
index a91f8ad..0e0dcd0 100644
--- a/common/src/main/java/org/apache/falcon/workflow/engine/AbstractWorkflowEngine.java
+++ b/common/src/main/java/org/apache/falcon/workflow/engine/AbstractWorkflowEngine.java
@@ -18,18 +18,21 @@
 
 package org.apache.falcon.workflow.engine;
 
-import java.util.*;
-
 import org.apache.falcon.FalconException;
 import org.apache.falcon.entity.v0.Entity;
 import org.apache.falcon.resource.InstancesResult;
 
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Properties;
+import java.util.Set;
+
 /**
  * Workflow engine should minimally support the
  * following operations
  */
 public abstract class AbstractWorkflowEngine {
-	
+
     public static final String NAME_NODE = "nameNode";
     public static final String JOB_TRACKER = "jobTracker";
 
@@ -46,9 +49,9 @@ public abstract class AbstractWorkflowEngine {
     public abstract String resume(Entity entity) throws FalconException;
 
     public abstract String delete(Entity entity) throws FalconException;
-    
+
     public abstract String delete(Entity entity, String cluster) throws FalconException;
-    
+
     public abstract void reRun(String cluster, String wfId, Properties props) throws FalconException;
 
     public abstract boolean isActive(Entity entity) throws FalconException;
@@ -56,22 +59,26 @@ public abstract class AbstractWorkflowEngine {
     public abstract boolean isSuspended(Entity entity) throws FalconException;
 
     public abstract InstancesResult getRunningInstances(Entity entity) throws FalconException;
-    
-    public abstract InstancesResult killInstances(Entity entity, Date start, Date end, Properties props) throws FalconException;
-    
-    public abstract InstancesResult reRunInstances(Entity entity, Date start, Date end, Properties props) throws FalconException;
 
-    public abstract InstancesResult suspendInstances(Entity entity, Date start, Date end, Properties props) throws FalconException;
+    public abstract InstancesResult killInstances(Entity entity, Date start, Date end, Properties props)
+            throws FalconException;
 
-    public abstract InstancesResult resumeInstances(Entity entity, Date start, Date end, Properties props) throws FalconException;
+    public abstract InstancesResult reRunInstances(Entity entity, Date start, Date end, Properties props)
+            throws FalconException;
+
+    public abstract InstancesResult suspendInstances(Entity entity, Date start, Date end, Properties props)
+            throws FalconException;
+
+    public abstract InstancesResult resumeInstances(Entity entity, Date start, Date end, Properties props)
+            throws FalconException;
 
     public abstract InstancesResult getStatus(Entity entity, Date start, Date end) throws FalconException;
 
-	public abstract void update(Entity oldEntity, Entity newEntity, String cluster) throws FalconException;
+    public abstract void update(Entity oldEntity, Entity newEntity, String cluster) throws FalconException;
+
+    public abstract String getWorkflowStatus(String cluster, String jobId) throws FalconException;
+
+    public abstract String getWorkflowProperty(String cluster, String jobId, String property) throws FalconException;
 
-	public abstract String getWorkflowStatus(String cluster, String jobId) throws FalconException;
-	
-	public abstract String getWorkflowProperty(String cluster, String jobId , String property) throws FalconException;
-	
-	public abstract InstancesResult  getJobDetails(String cluster, String jobId) throws FalconException;
+    public abstract InstancesResult getJobDetails(String cluster, String jobId) throws FalconException;
 }

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/a4d79f0c/common/src/main/resources/log4j.xml
----------------------------------------------------------------------
diff --git a/common/src/main/resources/log4j.xml b/common/src/main/resources/log4j.xml
index da50fb2..189d096 100644
--- a/common/src/main/resources/log4j.xml
+++ b/common/src/main/resources/log4j.xml
@@ -20,72 +20,72 @@
 <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
 
 <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
-  <appender name="console" class="org.apache.log4j.ConsoleAppender">
-    <param name="Target" value="System.out"/>
-    <layout class="org.apache.log4j.PatternLayout">
-      <param name="ConversionPattern" value="%d %-5p - [%t:%x] ~ %m (%c{1}:%L)%n"/>
-    </layout>
-  </appender>
+    <appender name="console" class="org.apache.log4j.ConsoleAppender">
+        <param name="Target" value="System.out"/>
+        <layout class="org.apache.log4j.PatternLayout">
+            <param name="ConversionPattern" value="%d %-5p - [%t:%x] ~ %m (%c{1}:%L)%n"/>
+        </layout>
+    </appender>
 
-  <appender name="FILE" class="org.apache.log4j.DailyRollingFileAppender">
-    <param name="File" value="/var/log/falcon/application.log"/>
-    <param name="Append" value="true"/>
-    <param name="Threshold" value="debug"/>
-    <layout class="org.apache.log4j.PatternLayout">
-      <param name="ConversionPattern" value="%d %-5p - [%t:%x] ~ %m (%c{1}:%L)%n"/>
-    </layout>
-  </appender>
+    <appender name="FILE" class="org.apache.log4j.DailyRollingFileAppender">
+        <param name="File" value="/var/log/falcon/application.log"/>
+        <param name="Append" value="true"/>
+        <param name="Threshold" value="debug"/>
+        <layout class="org.apache.log4j.PatternLayout">
+            <param name="ConversionPattern" value="%d %-5p - [%t:%x] ~ %m (%c{1}:%L)%n"/>
+        </layout>
+    </appender>
+
+    <appender name="AUDIT" class="org.apache.log4j.DailyRollingFileAppender">
+        <param name="File" value="/var/log/falcon/audit.log"/>
+        <param name="Append" value="true"/>
+        <param name="Threshold" value="debug"/>
+        <layout class="org.apache.log4j.PatternLayout">
+            <param name="ConversionPattern" value="%d %x %m%n"/>
+        </layout>
+    </appender>
+
+    <appender name="TRANSACTIONLOG" class="org.apache.log4j.DailyRollingFileAppender">
+        <param name="File" value="/var/log/falcon/tranlog.log"/>
+        <param name="Append" value="true"/>
+        <param name="Threshold" value="debug"/>
+        <layout class="org.apache.log4j.PatternLayout">
+            <param name="ConversionPattern" value="%d %x %m%n"/>
+        </layout>
+    </appender>
 
-  <appender name="AUDIT" class="org.apache.log4j.DailyRollingFileAppender">
-    <param name="File" value="/var/log/falcon/audit.log"/>
-    <param name="Append" value="true"/>
-    <param name="Threshold" value="debug"/>
-    <layout class="org.apache.log4j.PatternLayout">
-      <param name="ConversionPattern" value="%d %x %m%n"/>
-    </layout>
-  </appender>
-  
-  <appender name="TRANSACTIONLOG" class="org.apache.log4j.DailyRollingFileAppender">
-    <param name="File" value="/var/log/falcon/tranlog.log"/>
-    <param name="Append" value="true"/>
-    <param name="Threshold" value="debug"/>
-    <layout class="org.apache.log4j.PatternLayout">
-      <param name="ConversionPattern" value="%d %x %m%n"/>
-    </layout>
-  </appender>
-  
     <appender name="METRIC" class="org.apache.log4j.DailyRollingFileAppender">
-    <param name="File" value="/var/log/falcon/metric.log"/>
-    <param name="Append" value="true"/>
-    <param name="Threshold" value="debug"/>
-    <layout class="org.apache.log4j.PatternLayout">
-      <param name="ConversionPattern" value="%d %m%n"/>
-    </layout>
-  </appender>
+        <param name="File" value="/var/log/falcon/metric.log"/>
+        <param name="Append" value="true"/>
+        <param name="Threshold" value="debug"/>
+        <layout class="org.apache.log4j.PatternLayout">
+            <param name="ConversionPattern" value="%d %m%n"/>
+        </layout>
+    </appender>
+
+    <logger name="org.apache.falcon">
+        <level value="debug"/>
+        <appender-ref ref="FILE"/>
+    </logger>
+
+    <logger name="AUDIT">
+        <level value="info"/>
+        <appender-ref ref="AUDIT"/>
+    </logger>
 
-  <logger name="org.apache.falcon">
-    <level value="debug"/>
-    <appender-ref ref="FILE" />
-  </logger>
+    <logger name="TRANSACTIONLOG">
+        <level value="info"/>
+        <appender-ref ref="TRANSACTIONLOG"/>
+    </logger>
 
-  <logger name="AUDIT">
-    <level value="info"/>
-    <appender-ref ref="AUDIT" />
-  </logger>
-  
-  <logger name="TRANSACTIONLOG">
-    <level value="info"/>
-    <appender-ref ref="TRANSACTIONLOG" />
-  </logger>
-  
     <logger name="METRIC">
-    <level value="info"/>
-    <appender-ref ref="METRIC" />
-  </logger>
+        <level value="info"/>
+        <appender-ref ref="METRIC"/>
+    </logger>
 
-  <root>
-    <priority value ="info" />
-    <appender-ref ref="console" />
-  </root>
+    <root>
+        <priority value="info"/>
+        <appender-ref ref="console"/>
+    </root>
 
 </log4j:configuration>

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/a4d79f0c/common/src/test/java/org/apache/falcon/cleanup/LogCleanupServiceTest.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/falcon/cleanup/LogCleanupServiceTest.java b/common/src/test/java/org/apache/falcon/cleanup/LogCleanupServiceTest.java
index ee6b148..101f987 100644
--- a/common/src/test/java/org/apache/falcon/cleanup/LogCleanupServiceTest.java
+++ b/common/src/test/java/org/apache/falcon/cleanup/LogCleanupServiceTest.java
@@ -17,8 +17,6 @@
  */
 package org.apache.falcon.cleanup;
 
-import org.apache.hadoop.fs.FileSystem;
-import org.apache.hadoop.fs.Path;
 import org.apache.falcon.FalconException;
 import org.apache.falcon.cluster.util.EmbeddedCluster;
 import org.apache.falcon.entity.AbstractTestBase;
@@ -26,6 +24,8 @@ import org.apache.falcon.entity.store.ConfigurationStore;
 import org.apache.falcon.entity.v0.EntityType;
 import org.apache.falcon.entity.v0.Frequency;
 import org.apache.falcon.entity.v0.process.Process;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
 import org.testng.Assert;
 import org.testng.annotations.AfterClass;
 import org.testng.annotations.BeforeClass;
@@ -35,115 +35,115 @@ import java.io.IOException;
 
 public class LogCleanupServiceTest extends AbstractTestBase {
 
-	private FileSystem fs;
-	private FileSystem tfs;
-	private EmbeddedCluster targetDfsCluster;
-	Path instanceLogPath = new Path(
-			"/projects/falcon/staging/falcon/workflows/process/" + "sample"
-					+ "/logs/job-2010-01-01-01-00/000");
-	Path instanceLogPath1 = new Path(
-			"/projects/falcon/staging/falcon/workflows/process/" + "sample"
-					+ "/logs/job-2010-01-01-01-00/001");
-	Path instanceLogPath2 = new Path(
-			"/projects/falcon/staging/falcon/workflows/process/" + "sample"
-					+ "/logs/job-2010-01-01-02-00/001");
-	Path instanceLogPath3 = new Path(
-			"/projects/falcon/staging/falcon/workflows/process/" + "sample2"
-					+ "/logs/job-2010-01-01-01-00/000");
-	Path instanceLogPath4 = new Path(
-			"/projects/falcon/staging/falcon/workflows/process/" + "sample"
-					+ "/logs/latedata/2010-01-01-01-00");
-	Path feedInstanceLogPath = new Path(
-			"/projects/falcon/staging/falcon/workflows/feed/"
-					+ "impressionFeed"
-					+ "/logs/job-2010-01-01-01-00/testCluster/000");
-	Path feedInstanceLogPath1 = new Path(
-			"/projects/falcon/staging/falcon/workflows/feed/"
-					+ "impressionFeed2"
-					+ "/logs/job-2010-01-01-01-00/testCluster/000");
-
-
-	@AfterClass
-	public void tearDown() {
-		this.dfsCluster.shutdown();
-		this.targetDfsCluster.shutdown();
-	}
-
-	@BeforeClass
-	public void setup() throws Exception {
-		this.dfsCluster = EmbeddedCluster.newCluster("testCluster", false);
+    private FileSystem fs;
+    private FileSystem tfs;
+    private EmbeddedCluster targetDfsCluster;
+    Path instanceLogPath = new Path(
+            "/projects/falcon/staging/falcon/workflows/process/" + "sample"
+                    + "/logs/job-2010-01-01-01-00/000");
+    Path instanceLogPath1 = new Path(
+            "/projects/falcon/staging/falcon/workflows/process/" + "sample"
+                    + "/logs/job-2010-01-01-01-00/001");
+    Path instanceLogPath2 = new Path(
+            "/projects/falcon/staging/falcon/workflows/process/" + "sample"
+                    + "/logs/job-2010-01-01-02-00/001");
+    Path instanceLogPath3 = new Path(
+            "/projects/falcon/staging/falcon/workflows/process/" + "sample2"
+                    + "/logs/job-2010-01-01-01-00/000");
+    Path instanceLogPath4 = new Path(
+            "/projects/falcon/staging/falcon/workflows/process/" + "sample"
+                    + "/logs/latedata/2010-01-01-01-00");
+    Path feedInstanceLogPath = new Path(
+            "/projects/falcon/staging/falcon/workflows/feed/"
+                    + "impressionFeed"
+                    + "/logs/job-2010-01-01-01-00/testCluster/000");
+    Path feedInstanceLogPath1 = new Path(
+            "/projects/falcon/staging/falcon/workflows/feed/"
+                    + "impressionFeed2"
+                    + "/logs/job-2010-01-01-01-00/testCluster/000");
+
+
+    @AfterClass
+    public void tearDown() {
+        this.dfsCluster.shutdown();
+        this.targetDfsCluster.shutdown();
+    }
+
+    @BeforeClass
+    public void setup() throws Exception {
+        this.dfsCluster = EmbeddedCluster.newCluster("testCluster", false);
         conf = dfsCluster.getConf();
-		fs = dfsCluster.getFileSystem();
-		
-		storeEntity(EntityType.CLUSTER, "testCluster");
-		System.setProperty("test.build.data",
+        fs = dfsCluster.getFileSystem();
+
+        storeEntity(EntityType.CLUSTER, "testCluster");
+        System.setProperty("test.build.data",
                 "target/tdfs/data" + System.currentTimeMillis());
-		this.targetDfsCluster = EmbeddedCluster.newCluster("backupCluster", false);
+        this.targetDfsCluster = EmbeddedCluster.newCluster("backupCluster", false);
         conf = targetDfsCluster.getConf();
 
-		storeEntity(EntityType.CLUSTER, "backupCluster");
-		storeEntity(EntityType.FEED, "impressionFeed");
-		storeEntity(EntityType.FEED, "clicksFeed");
-		storeEntity(EntityType.FEED, "imp-click-join1");
-		storeEntity(EntityType.FEED, "imp-click-join2");
-		storeEntity(EntityType.PROCESS, "sample");
-		Process process = ConfigurationStore.get().get(EntityType.PROCESS,
-				"sample");
-		Process otherProcess = (Process) process.clone();
-		otherProcess.setName("sample2");
-		otherProcess.setFrequency(new Frequency("days(1)"));
-		ConfigurationStore.get().remove(EntityType.PROCESS,
-				otherProcess.getName());
-		ConfigurationStore.get().publish(EntityType.PROCESS, otherProcess);		
-
-		fs.mkdirs(instanceLogPath);
-		fs.mkdirs(instanceLogPath1);
-		fs.mkdirs(instanceLogPath2);
-		fs.mkdirs(instanceLogPath3);
-		fs.mkdirs(instanceLogPath4);
-
-		// fs.setTimes wont work on dirs
-		fs.createNewFile(new Path(instanceLogPath, "oozie.log"));
-		fs.createNewFile(new Path(instanceLogPath, "pigAction_SUCCEEDED.log"));
-		
-		tfs = targetDfsCluster.getFileSystem();
-		fs.mkdirs(feedInstanceLogPath);
-		fs.mkdirs(feedInstanceLogPath1);
-		tfs.mkdirs(feedInstanceLogPath);
-		tfs.mkdirs(feedInstanceLogPath1);
-		fs.createNewFile(new Path(feedInstanceLogPath, "oozie.log"));
-		tfs.createNewFile(new Path(feedInstanceLogPath, "oozie.log"));
-		
-		Thread.sleep(61000);
-
-
-	}
-
-	@Test
-	public void testProcessLogs() throws IOException, FalconException,
-			InterruptedException {
-
-		AbstractCleanupHandler processCleanupHandler = new ProcessCleanupHandler();
-		processCleanupHandler.cleanup();
-
-		Assert.assertFalse(fs.exists(instanceLogPath));
-		Assert.assertFalse(fs.exists(instanceLogPath1));
-		Assert.assertFalse(fs.exists(instanceLogPath2));
-		Assert.assertTrue(fs.exists(instanceLogPath3));
-
-	}
-
-	@Test
-	public void testFeedLogs() throws IOException, FalconException,
-			InterruptedException {
-
-		AbstractCleanupHandler feedCleanupHandler = new FeedCleanupHandler();
-		feedCleanupHandler.cleanup();
-
-		Assert.assertFalse(fs.exists(feedInstanceLogPath));
-		Assert.assertFalse(tfs.exists(feedInstanceLogPath));
-		Assert.assertTrue(fs.exists(feedInstanceLogPath1));
-		Assert.assertTrue(tfs.exists(feedInstanceLogPath1));
-
-	}
+        storeEntity(EntityType.CLUSTER, "backupCluster");
+        storeEntity(EntityType.FEED, "impressionFeed");
+        storeEntity(EntityType.FEED, "clicksFeed");
+        storeEntity(EntityType.FEED, "imp-click-join1");
+        storeEntity(EntityType.FEED, "imp-click-join2");
+        storeEntity(EntityType.PROCESS, "sample");
+        Process process = ConfigurationStore.get().get(EntityType.PROCESS,
+                "sample");
+        Process otherProcess = (Process) process.clone();
+        otherProcess.setName("sample2");
+        otherProcess.setFrequency(new Frequency("days(1)"));
+        ConfigurationStore.get().remove(EntityType.PROCESS,
+                otherProcess.getName());
+        ConfigurationStore.get().publish(EntityType.PROCESS, otherProcess);
+
+        fs.mkdirs(instanceLogPath);
+        fs.mkdirs(instanceLogPath1);
+        fs.mkdirs(instanceLogPath2);
+        fs.mkdirs(instanceLogPath3);
+        fs.mkdirs(instanceLogPath4);
+
+        // fs.setTimes wont work on dirs
+        fs.createNewFile(new Path(instanceLogPath, "oozie.log"));
+        fs.createNewFile(new Path(instanceLogPath, "pigAction_SUCCEEDED.log"));
+
+        tfs = targetDfsCluster.getFileSystem();
+        fs.mkdirs(feedInstanceLogPath);
+        fs.mkdirs(feedInstanceLogPath1);
+        tfs.mkdirs(feedInstanceLogPath);
+        tfs.mkdirs(feedInstanceLogPath1);
+        fs.createNewFile(new Path(feedInstanceLogPath, "oozie.log"));
+        tfs.createNewFile(new Path(feedInstanceLogPath, "oozie.log"));
+
+        Thread.sleep(61000);
+
+
+    }
+
+    @Test
+    public void testProcessLogs() throws IOException, FalconException,
+                                         InterruptedException {
+
+        AbstractCleanupHandler processCleanupHandler = new ProcessCleanupHandler();
+        processCleanupHandler.cleanup();
+
+        Assert.assertFalse(fs.exists(instanceLogPath));
+        Assert.assertFalse(fs.exists(instanceLogPath1));
+        Assert.assertFalse(fs.exists(instanceLogPath2));
+        Assert.assertTrue(fs.exists(instanceLogPath3));
+
+    }
+
+    @Test
+    public void testFeedLogs() throws IOException, FalconException,
+                                      InterruptedException {
+
+        AbstractCleanupHandler feedCleanupHandler = new FeedCleanupHandler();
+        feedCleanupHandler.cleanup();
+
+        Assert.assertFalse(fs.exists(feedInstanceLogPath));
+        Assert.assertFalse(tfs.exists(feedInstanceLogPath));
+        Assert.assertTrue(fs.exists(feedInstanceLogPath1));
+        Assert.assertTrue(tfs.exists(feedInstanceLogPath1));
+
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/a4d79f0c/common/src/test/java/org/apache/falcon/entity/AbstractTestBase.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/falcon/entity/AbstractTestBase.java b/common/src/test/java/org/apache/falcon/entity/AbstractTestBase.java
index b6e749e..394fa70 100644
--- a/common/src/test/java/org/apache/falcon/entity/AbstractTestBase.java
+++ b/common/src/test/java/org/apache/falcon/entity/AbstractTestBase.java
@@ -18,9 +18,6 @@
 
 package org.apache.falcon.entity;
 
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.fs.FileSystem;
-import org.apache.hadoop.fs.Path;
 import org.apache.falcon.FalconException;
 import org.apache.falcon.cluster.util.EmbeddedCluster;
 import org.apache.falcon.entity.store.ConfigurationStore;
@@ -32,6 +29,9 @@ import org.apache.falcon.entity.v0.cluster.Interfacetype;
 import org.apache.falcon.entity.v0.feed.Feed;
 import org.apache.falcon.entity.v0.process.Process;
 import org.apache.falcon.util.StartupProperties;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
 import org.testng.annotations.BeforeClass;
 
 import javax.xml.bind.JAXBException;
@@ -45,23 +45,24 @@ public class AbstractTestBase {
     protected static final String FEED_XML = "/config/feed/feed-0.1.xml";
     protected static final String CLUSTER_XML = "/config/cluster/cluster-0.1.xml";
     protected EmbeddedCluster dfsCluster;
-    protected Configuration conf= new Configuration();
+    protected Configuration conf = new Configuration();
 
     @BeforeClass
     public void initConfigStore() throws Exception {
         cleanupStore();
         String listeners = StartupProperties.get().getProperty("configstore.listeners");
-        StartupProperties.get().setProperty("configstore.listeners", 
+        StartupProperties.get().setProperty("configstore.listeners",
                 listeners.replace("org.apache.falcon.service.SharedLibraryHostingService", ""));
         ConfigurationStore.get().init();
     }
-    
+
     protected void cleanupStore() throws FalconException {
         ConfigurationStore store = ConfigurationStore.get();
-        for(EntityType type:EntityType.values()) {
+        for (EntityType type : EntityType.values()) {
             Collection<String> entities = store.getEntities(type);
-            for(String entity:entities)
+            for (String entity : entities) {
                 store.remove(type, entity);
+            }
         }
     }
 
@@ -69,8 +70,8 @@ public class AbstractTestBase {
         Unmarshaller unmarshaller = type.getUnmarshaller();
         ConfigurationStore store = ConfigurationStore.get();
         store.remove(type, name);
-		switch (type) {
-		case CLUSTER:
+        switch (type) {
+            case CLUSTER:
                 Cluster cluster = (Cluster) unmarshaller.unmarshal(this.getClass().getResource(CLUSTER_XML));
                 cluster.setName(name);
                 ClusterHelper.getInterface(cluster, Interfacetype.WRITE).setEndpoint(conf.get("fs.default.name"));
@@ -86,10 +87,10 @@ public class AbstractTestBase {
             case PROCESS:
                 Process process = (Process) unmarshaller.unmarshal(this.getClass().getResource(PROCESS_XML));
                 process.setName(name);
-                FileSystem fs =dfsCluster.getFileSystem();
+                FileSystem fs = dfsCluster.getFileSystem();
                 fs.mkdirs(new Path(process.getWorkflow().getPath()));
-                if (!fs.exists(new Path(process.getWorkflow()+"/lib"))) {
-                	fs.mkdirs(new Path(process.getWorkflow()+"/lib"));
+                if (!fs.exists(new Path(process.getWorkflow() + "/lib"))) {
+                    fs.mkdirs(new Path(process.getWorkflow() + "/lib"));
                 }
                 store.publish(type, process);
                 break;
@@ -97,12 +98,12 @@ public class AbstractTestBase {
     }
 
     public void setup() throws Exception {
-		ConfigurationStore store = ConfigurationStore.get();
-		for (EntityType type : EntityType.values()) {
-			for (String name : store.getEntities(type)) {
-				store.remove(type, name);
-			}
-		}
+        ConfigurationStore store = ConfigurationStore.get();
+        for (EntityType type : EntityType.values()) {
+            for (String name : store.getEntities(type)) {
+                store.remove(type, name);
+            }
+        }
         storeEntity(EntityType.CLUSTER, "corp");
         storeEntity(EntityType.FEED, "clicks");
         storeEntity(EntityType.FEED, "impressions");
@@ -110,20 +111,20 @@ public class AbstractTestBase {
         storeEntity(EntityType.PROCESS, "clicksummary");
     }
 
-	public String marshallEntity(final Entity entity) throws FalconException,
-			JAXBException {
-		Marshaller marshaller = entity.getEntityType().getMarshaller();
-		StringWriter stringWriter = new StringWriter();
-		marshaller.marshal(entity, stringWriter);
-		return stringWriter.toString();
-	}
-	
-	private Interface newInterface(Interfacetype type, String endPoint,
-			String version) {
-		Interface iface = new Interface();
-		iface.setType(type);
-		iface.setEndpoint(endPoint);
-		iface.setVersion(version);
-		return iface;
-	}
+    public String marshallEntity(final Entity entity) throws FalconException,
+                                                             JAXBException {
+        Marshaller marshaller = entity.getEntityType().getMarshaller();
+        StringWriter stringWriter = new StringWriter();
+        marshaller.marshal(entity, stringWriter);
+        return stringWriter.toString();
+    }
+
+    private Interface newInterface(Interfacetype type, String endPoint,
+                                   String version) {
+        Interface iface = new Interface();
+        iface.setType(type);
+        iface.setEndpoint(endPoint);
+        iface.setVersion(version);
+        return iface;
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/a4d79f0c/common/src/test/java/org/apache/falcon/entity/ColoClusterRelationTest.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/falcon/entity/ColoClusterRelationTest.java b/common/src/test/java/org/apache/falcon/entity/ColoClusterRelationTest.java
index 1d2ffd3..d60126e 100644
--- a/common/src/test/java/org/apache/falcon/entity/ColoClusterRelationTest.java
+++ b/common/src/test/java/org/apache/falcon/entity/ColoClusterRelationTest.java
@@ -18,23 +18,23 @@
 
 package org.apache.falcon.entity;
 
-import org.testng.Assert;
-import org.testng.annotations.Test;
-import java.util.Set;
-
 import org.apache.falcon.entity.store.ConfigurationStore;
 import org.apache.falcon.entity.v0.EntityType;
 import org.apache.falcon.entity.v0.cluster.Cluster;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+import java.util.Set;
 
 @Test
-public class ColoClusterRelationTest extends AbstractTestBase{
+public class ColoClusterRelationTest extends AbstractTestBase {
     private Cluster newCluster(String name, String colo) {
         Cluster cluster = new Cluster();
         cluster.setName(name);
         cluster.setColo(colo);
         return cluster;
     }
-    
+
     @Test
     public void testMapping() throws Exception {
         Cluster cluster1 = newCluster("cluster1", "colo1");
@@ -44,14 +44,14 @@ public class ColoClusterRelationTest extends AbstractTestBase{
         store.publish(EntityType.CLUSTER, cluster1);
         store.publish(EntityType.CLUSTER, cluster2);
         store.publish(EntityType.CLUSTER, cluster3);
-        
+
         ColoClusterRelation relation = ColoClusterRelation.get();
         Set<String> clusters = relation.getClusters("colo1");
         Assert.assertNotNull(clusters);
         Assert.assertEquals(2, clusters.size());
         Assert.assertTrue(clusters.contains(cluster1.getName()));
         Assert.assertTrue(clusters.contains(cluster2.getName()));
-        
+
         clusters = relation.getClusters("colo2");
         Assert.assertNotNull(clusters);
         Assert.assertEquals(1, clusters.size());
@@ -62,7 +62,7 @@ public class ColoClusterRelationTest extends AbstractTestBase{
         Assert.assertNotNull(clusters);
         Assert.assertEquals(1, clusters.size());
         Assert.assertTrue(clusters.contains(cluster2.getName()));
-        
+
         store.remove(EntityType.CLUSTER, cluster2.getName());
         clusters = relation.getClusters("colo1");
         Assert.assertNotNull(clusters);

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/a4d79f0c/common/src/test/java/org/apache/falcon/entity/EntityTypeTest.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/falcon/entity/EntityTypeTest.java b/common/src/test/java/org/apache/falcon/entity/EntityTypeTest.java
index a3aadba..509fce8 100644
--- a/common/src/test/java/org/apache/falcon/entity/EntityTypeTest.java
+++ b/common/src/test/java/org/apache/falcon/entity/EntityTypeTest.java
@@ -24,16 +24,16 @@ import org.testng.annotations.Test;
 
 public class EntityTypeTest {
 
-	@Test
-	public void testGetEntityClass() {
-		Assert.assertEquals(EntityType.PROCESS.getEntityClass().getName(),
-				"org.apache.falcon.entity.v0.process.Process");
-	}
+    @Test
+    public void testGetEntityClass() {
+        Assert.assertEquals(EntityType.PROCESS.getEntityClass().getName(),
+                "org.apache.falcon.entity.v0.process.Process");
+    }
 
-	@Test
-	public void testIsSchedulable() {
-		Assert.assertTrue(EntityType.PROCESS.isSchedulable());
-		Assert.assertTrue(EntityType.FEED.isSchedulable());
-		Assert.assertFalse(EntityType.CLUSTER.isSchedulable());
-	}
+    @Test
+    public void testIsSchedulable() {
+        Assert.assertTrue(EntityType.PROCESS.isSchedulable());
+        Assert.assertTrue(EntityType.FEED.isSchedulable());
+        Assert.assertFalse(EntityType.CLUSTER.isSchedulable());
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/a4d79f0c/common/src/test/java/org/apache/falcon/entity/EntityUtilTest.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/falcon/entity/EntityUtilTest.java b/common/src/test/java/org/apache/falcon/entity/EntityUtilTest.java
index 8a565bf..622fe48 100644
--- a/common/src/test/java/org/apache/falcon/entity/EntityUtilTest.java
+++ b/common/src/test/java/org/apache/falcon/entity/EntityUtilTest.java
@@ -18,11 +18,6 @@
 
 package org.apache.falcon.entity;
 
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.TimeZone;
-
 import org.apache.falcon.entity.v0.EntityType;
 import org.apache.falcon.entity.v0.Frequency;
 import org.apache.falcon.entity.v0.SchemaHelper;
@@ -32,7 +27,12 @@ import org.apache.falcon.entity.v0.process.Process;
 import org.testng.Assert;
 import org.testng.annotations.Test;
 
-public class EntityUtilTest extends AbstractTestBase{
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.TimeZone;
+
+public class EntityUtilTest extends AbstractTestBase {
     private static TimeZone tz = TimeZone.getTimeZone("UTC");
 
     @Test
@@ -50,7 +50,7 @@ public class EntityUtilTest extends AbstractTestBase{
         Assert.assertEquals(newProcess.getClusters().getClusters().size(), 1);
         Assert.assertEquals(newProcess.getClusters().getClusters().get(0).getName(), currentCluster);
     }
-    
+
     @Test
     public void testFeedView() throws Exception {
         Feed feed = (Feed) EntityType.FEED.getUnmarshaller().unmarshal(
@@ -58,11 +58,11 @@ public class EntityUtilTest extends AbstractTestBase{
         Feed view = EntityUtil.getClusterView(feed, "testCluster");
         Assert.assertEquals(view.getClusters().getClusters().size(), 1);
         Assert.assertEquals(view.getClusters().getClusters().get(0).getName(), "testCluster");
-        
+
         view = EntityUtil.getClusterView(feed, "backupCluster");
         Assert.assertEquals(view.getClusters().getClusters().size(), 2);
     }
-    
+
     @Test
     public void testEquals() throws Exception {
         Process process1 = (Process) EntityType.PROCESS.getUnmarshaller().unmarshal(
@@ -72,10 +72,11 @@ public class EntityUtilTest extends AbstractTestBase{
         Assert.assertTrue(EntityUtil.equals(process1, process2));
         Assert.assertTrue(EntityUtil.md5(process1).equals(EntityUtil.md5(process2)));
 
-        process2.getClusters().getClusters().get(0).getValidity().setEnd(SchemaHelper.parseDateUTC("2013-04-21T00:00Z"));
+        process2.getClusters().getClusters().get(0).getValidity().setEnd(
+                SchemaHelper.parseDateUTC("2013-04-21T00:00Z"));
         Assert.assertFalse(EntityUtil.equals(process1, process2));
         Assert.assertFalse(EntityUtil.md5(process1).equals(EntityUtil.md5(process2)));
-        Assert.assertTrue(EntityUtil.equals(process1, process2, new String[] {"clusters.clusters[\\d+].validity.end"}));
+        Assert.assertTrue(EntityUtil.equals(process1, process2, new String[]{"clusters.clusters[\\d+].validity.end"}));
     }
 
     private static Date getDate(String date) throws Exception {
@@ -145,7 +146,7 @@ public class EntityUtilTest extends AbstractTestBase{
 
         Frequency frequency = Frequency.fromString("hours(1)");
         Assert.assertEquals(198, EntityUtil.getInstanceSequence(start,
-                frequency,tz, instance));
+                frequency, tz, instance));
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/a4d79f0c/common/src/test/java/org/apache/falcon/entity/FeedHelperTest.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/falcon/entity/FeedHelperTest.java b/common/src/test/java/org/apache/falcon/entity/FeedHelperTest.java
index 66a56d6..100fb63 100644
--- a/common/src/test/java/org/apache/falcon/entity/FeedHelperTest.java
+++ b/common/src/test/java/org/apache/falcon/entity/FeedHelperTest.java
@@ -31,7 +31,7 @@ public class FeedHelperTest {
         Assert.assertEquals(FeedHelper.normalizePartitionExpression(null, "  /b// "), "b");
         Assert.assertEquals(FeedHelper.normalizePartitionExpression(null, null), "");
     }
-    
+
     @Test
     public void testEvaluateExpression() throws Exception {
         Cluster cluster = new Cluster();
@@ -42,9 +42,10 @@ public class FeedHelperTest {
         prop.setName("pname");
         prop.setValue("pvalue");
         cluster.getProperties().getProperties().add(prop);
-        
+
         Assert.assertEquals(FeedHelper.evaluateClusterExp(cluster, "${cluster.colo}/*/US"), "colo/*/US");
-        Assert.assertEquals(FeedHelper.evaluateClusterExp(cluster, "${cluster.name}/*/${cluster.pname}"), "name/*/pvalue");
+        Assert.assertEquals(FeedHelper.evaluateClusterExp(cluster, "${cluster.name}/*/${cluster.pname}"),
+                "name/*/pvalue");
         Assert.assertEquals(FeedHelper.evaluateClusterExp(cluster, "IN"), "IN");
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/a4d79f0c/common/src/test/java/org/apache/falcon/entity/TestWorkflowNameBuilder.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/falcon/entity/TestWorkflowNameBuilder.java b/common/src/test/java/org/apache/falcon/entity/TestWorkflowNameBuilder.java
index 332b122..6486397 100644
--- a/common/src/test/java/org/apache/falcon/entity/TestWorkflowNameBuilder.java
+++ b/common/src/test/java/org/apache/falcon/entity/TestWorkflowNameBuilder.java
@@ -17,72 +17,72 @@
  */
 package org.apache.falcon.entity;
 
-import java.util.Arrays;
-
 import org.apache.falcon.Tag;
 import org.apache.falcon.entity.v0.feed.Feed;
 import org.apache.falcon.entity.v0.process.Process;
 import org.testng.Assert;
 import org.testng.annotations.Test;
 
+import java.util.Arrays;
+
 public class TestWorkflowNameBuilder {
 
-	@Test
-	public void getTagTest() {
-		Feed feed = new Feed();
-		feed.setName("raw-logs");
+    @Test
+    public void getTagTest() {
+        Feed feed = new Feed();
+        feed.setName("raw-logs");
 
-		WorkflowNameBuilder<Feed> builder = new WorkflowNameBuilder<Feed>(feed);
-		Tag tag = builder.getWorkflowTag("FALCON_FEED_RETENTION_raw-logs");
-		Assert.assertEquals(tag, Tag.RETENTION);
+        WorkflowNameBuilder<Feed> builder = new WorkflowNameBuilder<Feed>(feed);
+        Tag tag = builder.getWorkflowTag("FALCON_FEED_RETENTION_raw-logs");
+        Assert.assertEquals(tag, Tag.RETENTION);
 
-		tag = builder.getWorkflowTag("FALCON_FEED_raw-logs");
-		Assert.assertNull(tag);
+        tag = builder.getWorkflowTag("FALCON_FEED_raw-logs");
+        Assert.assertNull(tag);
 
-		tag = builder.getWorkflowTag("FALCON_FEED_REPLICATION_raw-logs_corp1");
-		Assert.assertEquals(tag, Tag.REPLICATION);
+        tag = builder.getWorkflowTag("FALCON_FEED_REPLICATION_raw-logs_corp1");
+        Assert.assertEquals(tag, Tag.REPLICATION);
 
-	}
+    }
 
-	@Test
-	public void getSuffixesTest() {
-		Feed feed = new Feed();
-		feed.setName("raw-logs");
-		WorkflowNameBuilder<Feed> builder = new WorkflowNameBuilder<Feed>(feed);
+    @Test
+    public void getSuffixesTest() {
+        Feed feed = new Feed();
+        feed.setName("raw-logs");
+        WorkflowNameBuilder<Feed> builder = new WorkflowNameBuilder<Feed>(feed);
 
-		String suffixes = builder
-				.getWorkflowSuffixes("FALCON_FEED_REPLICATION_raw-logs_corp-1");
-		Assert.assertEquals(suffixes, "_corp-1");
+        String suffixes = builder
+                .getWorkflowSuffixes("FALCON_FEED_REPLICATION_raw-logs_corp-1");
+        Assert.assertEquals(suffixes, "_corp-1");
 
-		suffixes = builder
-				.getWorkflowSuffixes("FALCON_FEED_REPLICATION_raw-logs");
-		Assert.assertEquals(suffixes, "");
-	}
+        suffixes = builder
+                .getWorkflowSuffixes("FALCON_FEED_REPLICATION_raw-logs");
+        Assert.assertEquals(suffixes, "");
+    }
 
-	@Test
-	public void WorkflowNameTest() {
-		Feed feed = new Feed();
-		feed.setName("raw-logs");
+    @Test
+    public void WorkflowNameTest() {
+        Feed feed = new Feed();
+        feed.setName("raw-logs");
 
-		WorkflowNameBuilder<Feed> builder = new WorkflowNameBuilder<Feed>(feed);
-		Assert.assertEquals(builder.getWorkflowName().toString(),
-				"FALCON_FEED_raw-logs");
+        WorkflowNameBuilder<Feed> builder = new WorkflowNameBuilder<Feed>(feed);
+        Assert.assertEquals(builder.getWorkflowName().toString(),
+                "FALCON_FEED_raw-logs");
 
-		builder.setTag(Tag.REPLICATION);
-		Assert.assertEquals(builder.getWorkflowName().toString(),
-				"FALCON_FEED_REPLICATION_raw-logs");
+        builder.setTag(Tag.REPLICATION);
+        Assert.assertEquals(builder.getWorkflowName().toString(),
+                "FALCON_FEED_REPLICATION_raw-logs");
 
-		builder.setSuffixes(Arrays.asList("cluster1"));
-		Assert.assertEquals(builder.getWorkflowName().toString(),
-				"FALCON_FEED_REPLICATION_raw-logs_cluster1");
+        builder.setSuffixes(Arrays.asList("cluster1"));
+        Assert.assertEquals(builder.getWorkflowName().toString(),
+                "FALCON_FEED_REPLICATION_raw-logs_cluster1");
 
-		Process process = new Process();
-		process.setName("agg-logs");
-		WorkflowNameBuilder<Process> processBuilder = new WorkflowNameBuilder<Process>(
-				process);
-		processBuilder.setTag(Tag.DEFAULT);
-		Assert.assertEquals(processBuilder.getWorkflowName().toString(),
-				"FALCON_PROCESS_DEFAULT_agg-logs");
+        Process process = new Process();
+        process.setName("agg-logs");
+        WorkflowNameBuilder<Process> processBuilder = new WorkflowNameBuilder<Process>(
+                process);
+        processBuilder.setTag(Tag.DEFAULT);
+        Assert.assertEquals(processBuilder.getWorkflowName().toString(),
+                "FALCON_PROCESS_DEFAULT_agg-logs");
 
-	}
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/a4d79f0c/common/src/test/java/org/apache/falcon/entity/parser/ClusterEntityParserTest.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/falcon/entity/parser/ClusterEntityParserTest.java b/common/src/test/java/org/apache/falcon/entity/parser/ClusterEntityParserTest.java
index ae4a8fa..b54ca63 100644
--- a/common/src/test/java/org/apache/falcon/entity/parser/ClusterEntityParserTest.java
+++ b/common/src/test/java/org/apache/falcon/entity/parser/ClusterEntityParserTest.java
@@ -79,15 +79,15 @@ public class ClusterEntityParserTest extends AbstractTestBase {
         System.out.println(stringWriter.toString());
         parser.parseAndValidate(stringWriter.toString());
     }
-    
+
     @BeforeClass
     public void init() throws Exception {
         this.dfsCluster = EmbeddedCluster.newCluster("testCluster", false);
         this.conf = dfsCluster.getConf();
     }
-    
-	@AfterClass
-	public void tearDown() {
-		this.dfsCluster.shutdown();
-	}
+
+    @AfterClass
+    public void tearDown() {
+        this.dfsCluster.shutdown();
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/a4d79f0c/common/src/test/java/org/apache/falcon/entity/parser/FeedEntityParserTest.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/falcon/entity/parser/FeedEntityParserTest.java b/common/src/test/java/org/apache/falcon/entity/parser/FeedEntityParserTest.java
index cfdc1b4..c461ee5 100644
--- a/common/src/test/java/org/apache/falcon/entity/parser/FeedEntityParserTest.java
+++ b/common/src/test/java/org/apache/falcon/entity/parser/FeedEntityParserTest.java
@@ -21,14 +21,6 @@ package org.apache.falcon.entity.parser;
 /**
  * Test Cases for ProcessEntityParser
  */
-import static org.testng.AssertJUnit.assertEquals;
-
-import java.io.IOException;
-import java.io.StringWriter;
-
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Marshaller;
-import javax.xml.bind.Unmarshaller;
 
 import org.apache.falcon.FalconException;
 import org.apache.falcon.entity.AbstractTestBase;
@@ -38,126 +30,127 @@ import org.apache.falcon.entity.v0.EntityType;
 import org.apache.falcon.entity.v0.Frequency;
 import org.apache.falcon.entity.v0.SchemaHelper;
 import org.apache.falcon.entity.v0.cluster.Cluster;
-import org.apache.falcon.entity.v0.feed.ActionType;
-import org.apache.falcon.entity.v0.feed.ClusterType;
-import org.apache.falcon.entity.v0.feed.Feed;
-import org.apache.falcon.entity.v0.feed.Location;
-import org.apache.falcon.entity.v0.feed.LocationType;
-import org.apache.falcon.entity.v0.feed.Locations;
-import org.apache.falcon.entity.v0.feed.Validity;
-import org.apache.falcon.group.FeedGroup;
+import org.apache.falcon.entity.v0.feed.*;
 import org.apache.falcon.group.FeedGroupMapTest;
 import org.testng.Assert;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+import java.io.IOException;
+import java.io.StringWriter;
+
+import static org.testng.AssertJUnit.assertEquals;
+
 public class FeedEntityParserTest extends AbstractTestBase {
 
-	private final FeedEntityParser parser = (FeedEntityParser) EntityParserFactory
-			.getParser(EntityType.FEED);
-
-	private Feed modifiableFeed;
-
-	@BeforeMethod
-	public void setUp() throws Exception {
-	    cleanupStore();
-	    ConfigurationStore store = ConfigurationStore.get();
-	    
-		Unmarshaller unmarshaller = EntityType.CLUSTER.getUnmarshaller();
-		Cluster cluster = (Cluster) unmarshaller.unmarshal(this.getClass()
-				.getResourceAsStream(CLUSTER_XML));
-		cluster.setName("testCluster");
-		store.publish(EntityType.CLUSTER, cluster);
-
-		cluster = (Cluster) unmarshaller.unmarshal(this.getClass()
-				.getResourceAsStream(CLUSTER_XML));
-		cluster.setName("backupCluster");
-		store.publish(EntityType.CLUSTER, cluster);
-
-		modifiableFeed = (Feed) parser.parseAndValidate(this.getClass()
-				.getResourceAsStream(FEED_XML));
-	}
-
-	@Test(expectedExceptions = ValidationException.class)
-	public void testValidations() throws Exception {
-		ConfigurationStore.get().remove(EntityType.CLUSTER, "backupCluster");
-		parser.parseAndValidate(this.getClass().getResourceAsStream(FEED_XML));
-	}
-
-	@Test
-	public void testParse() throws IOException, FalconException, JAXBException {
-
-		Feed feed = parser.parseAndValidate(this.getClass()
-				.getResourceAsStream(FEED_XML));
-
-		Assert.assertNotNull(feed);
-		assertEquals(feed.getName(), "clicks");
-		assertEquals(feed.getDescription(), "clicks log");
-		assertEquals(feed.getFrequency().toString(), "hours(1)");
-		assertEquals(feed.getGroups(), "online,bi");
-
-		assertEquals(feed.getClusters().getClusters().get(0).getName(),
-				"testCluster");
-		assertEquals(feed.getClusters().getClusters().get(0).getType(),
-				ClusterType.SOURCE);
-		assertEquals(SchemaHelper.formatDateUTC(feed.getClusters().getClusters().get(0).getValidity()
-				.getStart()), "2011-11-01T00:00Z");
-		assertEquals(SchemaHelper.formatDateUTC(feed.getClusters().getClusters().get(0).getValidity()
-				.getEnd()), "2011-12-31T00:00Z");
-		assertEquals(feed.getTimezone().getID(), "UTC");
-		assertEquals(feed.getClusters().getClusters().get(0).getRetention()
-				.getAction(), ActionType.DELETE);
-		assertEquals(feed.getClusters().getClusters().get(0).getRetention()
-				.getLimit().toString(), "hours(48)");
-
-		assertEquals(feed.getClusters().getClusters().get(1).getName(),
-				"backupCluster");
-		assertEquals(feed.getClusters().getClusters().get(1).getType(),
-				ClusterType.TARGET);
-		assertEquals(SchemaHelper.formatDateUTC(feed.getClusters().getClusters().get(1).getValidity()
-				.getStart()), "2011-11-01T00:00Z");
-		assertEquals(SchemaHelper.formatDateUTC(feed.getClusters().getClusters().get(1).getValidity()
-				.getEnd()), "2011-12-31T00:00Z");
-		assertEquals(feed.getClusters().getClusters().get(1).getRetention()
-				.getAction(), ActionType.ARCHIVE);
-		assertEquals(feed.getClusters().getClusters().get(1).getRetention()
-				.getLimit().toString(), "hours(6)");
-
-		assertEquals(FeedHelper.getLocation(feed, LocationType.DATA).getPath(),
-				"/projects/falcon/clicks");
-		assertEquals(FeedHelper.getLocation(feed, LocationType.META).getPath(),
-				"/projects/falcon/clicksMetaData");
-		assertEquals(FeedHelper.getLocation(feed, LocationType.STATS).getPath(),
-				"/projects/falcon/clicksStats");
-
-		assertEquals(feed.getACL().getGroup(), "group");
-		assertEquals(feed.getACL().getOwner(), "testuser");
-		assertEquals(feed.getACL().getPermission(), "0x755");
-
-		assertEquals(feed.getSchema().getLocation(), "/schema/clicks");
-		assertEquals(feed.getSchema().getProvider(), "protobuf");
-
-		StringWriter stringWriter = new StringWriter();
-		Marshaller marshaller = EntityType.FEED.getMarshaller();
-		marshaller.marshal(feed, stringWriter);
-		System.out.println(stringWriter.toString());
-	}
-
-	@Test(expectedExceptions = ValidationException.class)
-	public void applyValidationInvalidFeed() throws Exception {
-		Feed feed = (Feed) parser
-				.parseAndValidate(ProcessEntityParserTest.class
-						.getResourceAsStream(FEED_XML));
-		feed.getClusters().getClusters().get(0).setName("invalid cluster");
-		parser.validate(feed);
-	}
-
-	
-	@Test
-	public void testPartitionExpression() throws FalconException {
+    private final FeedEntityParser parser = (FeedEntityParser) EntityParserFactory
+            .getParser(EntityType.FEED);
+
+    private Feed modifiableFeed;
+
+    @BeforeMethod
+    public void setUp() throws Exception {
+        cleanupStore();
+        ConfigurationStore store = ConfigurationStore.get();
+
+        Unmarshaller unmarshaller = EntityType.CLUSTER.getUnmarshaller();
+        Cluster cluster = (Cluster) unmarshaller.unmarshal(this.getClass()
+                .getResourceAsStream(CLUSTER_XML));
+        cluster.setName("testCluster");
+        store.publish(EntityType.CLUSTER, cluster);
+
+        cluster = (Cluster) unmarshaller.unmarshal(this.getClass()
+                .getResourceAsStream(CLUSTER_XML));
+        cluster.setName("backupCluster");
+        store.publish(EntityType.CLUSTER, cluster);
+
+        modifiableFeed = (Feed) parser.parseAndValidate(this.getClass()
+                .getResourceAsStream(FEED_XML));
+    }
+
+    @Test(expectedExceptions = ValidationException.class)
+    public void testValidations() throws Exception {
+        ConfigurationStore.get().remove(EntityType.CLUSTER, "backupCluster");
+        parser.parseAndValidate(this.getClass().getResourceAsStream(FEED_XML));
+    }
+
+    @Test
+    public void testParse() throws IOException, FalconException, JAXBException {
+
+        Feed feed = parser.parseAndValidate(this.getClass()
+                .getResourceAsStream(FEED_XML));
+
+        Assert.assertNotNull(feed);
+        assertEquals(feed.getName(), "clicks");
+        assertEquals(feed.getDescription(), "clicks log");
+        assertEquals(feed.getFrequency().toString(), "hours(1)");
+        assertEquals(feed.getGroups(), "online,bi");
+
+        assertEquals(feed.getClusters().getClusters().get(0).getName(),
+                "testCluster");
+        assertEquals(feed.getClusters().getClusters().get(0).getType(),
+                ClusterType.SOURCE);
+        assertEquals(SchemaHelper.formatDateUTC(feed.getClusters().getClusters().get(0).getValidity()
+                .getStart()), "2011-11-01T00:00Z");
+        assertEquals(SchemaHelper.formatDateUTC(feed.getClusters().getClusters().get(0).getValidity()
+                .getEnd()), "2011-12-31T00:00Z");
+        assertEquals(feed.getTimezone().getID(), "UTC");
+        assertEquals(feed.getClusters().getClusters().get(0).getRetention()
+                .getAction(), ActionType.DELETE);
+        assertEquals(feed.getClusters().getClusters().get(0).getRetention()
+                .getLimit().toString(), "hours(48)");
+
+        assertEquals(feed.getClusters().getClusters().get(1).getName(),
+                "backupCluster");
+        assertEquals(feed.getClusters().getClusters().get(1).getType(),
+                ClusterType.TARGET);
+        assertEquals(SchemaHelper.formatDateUTC(feed.getClusters().getClusters().get(1).getValidity()
+                .getStart()), "2011-11-01T00:00Z");
+        assertEquals(SchemaHelper.formatDateUTC(feed.getClusters().getClusters().get(1).getValidity()
+                .getEnd()), "2011-12-31T00:00Z");
+        assertEquals(feed.getClusters().getClusters().get(1).getRetention()
+                .getAction(), ActionType.ARCHIVE);
+        assertEquals(feed.getClusters().getClusters().get(1).getRetention()
+                .getLimit().toString(), "hours(6)");
+
+        assertEquals(FeedHelper.getLocation(feed, LocationType.DATA).getPath(),
+                "/projects/falcon/clicks");
+        assertEquals(FeedHelper.getLocation(feed, LocationType.META).getPath(),
+                "/projects/falcon/clicksMetaData");
+        assertEquals(FeedHelper.getLocation(feed, LocationType.STATS).getPath(),
+                "/projects/falcon/clicksStats");
+
+        assertEquals(feed.getACL().getGroup(), "group");
+        assertEquals(feed.getACL().getOwner(), "testuser");
+        assertEquals(feed.getACL().getPermission(), "0x755");
+
+        assertEquals(feed.getSchema().getLocation(), "/schema/clicks");
+        assertEquals(feed.getSchema().getProvider(), "protobuf");
+
+        StringWriter stringWriter = new StringWriter();
+        Marshaller marshaller = EntityType.FEED.getMarshaller();
+        marshaller.marshal(feed, stringWriter);
+        System.out.println(stringWriter.toString());
+    }
+
+    @Test(expectedExceptions = ValidationException.class)
+    public void applyValidationInvalidFeed() throws Exception {
+        Feed feed = (Feed) parser
+                .parseAndValidate(ProcessEntityParserTest.class
+                        .getResourceAsStream(FEED_XML));
+        feed.getClusters().getClusters().get(0).setName("invalid cluster");
+        parser.validate(feed);
+    }
+
+
+    @Test
+    public void testPartitionExpression() throws FalconException {
         Feed feed = (Feed) parser.parseAndValidate(ProcessEntityParserTest.class
                 .getResourceAsStream(FEED_XML));
-        
+
         //When there are more than 1 src clusters, there should be partition expression
         org.apache.falcon.entity.v0.feed.Cluster newCluster = new org.apache.falcon.entity.v0.feed.Cluster();
         newCluster.setName("newCluster");
@@ -167,264 +160,269 @@ public class FeedEntityParserTest extends AbstractTestBase {
         try {
             parser.validate(feed);
             Assert.fail("Expected ValidationException");
-        } catch(ValidationException e) { }
-        
+        } catch (ValidationException e) {
+        }
+
         //When there are more than 1 src clusters, the partition expression should contain cluster variable
         feed.getClusters().getClusters().get(0).setPartition("*");
         try {
             parser.validate(feed);
             Assert.fail("Expected ValidationException");
-        } catch(ValidationException e) { }
-        
+        } catch (ValidationException e) {
+        }
+
         //When there are more than 1 target cluster, there should be partition expre
         newCluster.setType(ClusterType.TARGET);
         try {
             parser.validate(feed);
             Assert.fail("Expected ValidationException");
-        } catch(ValidationException e) { }
-        
+        } catch (ValidationException e) {
+        }
+
         //When there are more than 1 target clusters, the partition expression should contain cluster variable
         feed.getClusters().getClusters().get(1).setPartition("*");
         try {
             parser.validate(feed);
             Assert.fail("Expected ValidationException");
-        } catch(ValidationException e) { }
-        
+        } catch (ValidationException e) {
+        }
+
         //Number of parts in partition expression < number of partitions defined for feed
         feed.getClusters().getClusters().get(1).setPartition("*/*");
         try {
             parser.validate(feed);
             Assert.fail("Expected ValidationException");
-        } catch(ValidationException e) { }
+        } catch (ValidationException e) {
+        }
 
         feed.getClusters().getClusters().get(0).setPartition(null);
         feed.getClusters().getClusters().get(1).setPartition(null);
         feed.getClusters().getClusters().remove(2);
         feed.setPartitions(null);
         parser.validate(feed);
-	}
-
-	@Test
-	public void testInvalidClusterValidityTime() {
-		Validity validity = modifiableFeed.getClusters().getClusters().get(0)
-				.getValidity();
-		try {
-			validity.setStart(SchemaHelper.parseDateUTC("2007-02-29T00:00Z"));
-			modifiableFeed.getClusters().getClusters().get(0)
-					.setValidity(validity);
-			parser.parseAndValidate(marshallEntity(modifiableFeed));
-			Assert.fail("Cluster validity failed");
-		} catch (Exception e) {
-			System.out.println(e.getMessage());
-			validity.setStart(SchemaHelper.parseDateUTC("2011-11-01T00:00Z"));
-			modifiableFeed.getClusters().getClusters().get(0)
-					.setValidity(validity);
-		}
-
-		try {
-			validity.setEnd(SchemaHelper.parseDateUTC("2010-04-31T00:00Z"));
-			modifiableFeed.getClusters().getClusters().get(0)
-					.setValidity(validity);
-			parser.parseAndValidate(marshallEntity(modifiableFeed));
-			Assert.fail("Cluster validity failed");
-		} catch (Exception e) {
-			System.out.println(e.getMessage());
-			validity.setEnd(SchemaHelper.parseDateUTC("2011-12-31T00:00Z"));
-			modifiableFeed.getClusters().getClusters().get(0)
-					.setValidity(validity);
-		}
-	}
-
-	@Test(expectedExceptions = ValidationException.class)
-	public void testInvalidProcessValidity() throws Exception {
-		Feed feed = parser.parseAndValidate((FeedEntityParserTest.class
-				.getResourceAsStream(FEED_XML)));
-		feed.getClusters().getClusters().get(0).getValidity()
-				.setStart(SchemaHelper.parseDateUTC("2012-11-01T00:00Z"));
-		parser.validate(feed);
-	}
-
-	@Test
-	public void testValidFeedGroup() throws FalconException, JAXBException {
-		Feed feed1 = (Feed) EntityType.FEED.getUnmarshaller().unmarshal(
-				(FeedEntityParserTest.class.getResourceAsStream(FEED_XML)));
-		feed1.setName("f1" + System.currentTimeMillis());
-		feed1.setGroups("group1,group2,group3");
-		feed1.setLocations(new Locations());
-		Location location = new Location();
-		location.setPath("/projects/bi/rmc/daily/ad/${YEAR}/fraud/${MONTH}-${DAY}/ad");
-		location.setType(LocationType.DATA);
-		feed1.getLocations().getLocations().add(location);
-		feed1.getClusters().getClusters().get(0).getLocations().getLocations().set(0, location);
-		parser.parseAndValidate(feed1.toString());
-		ConfigurationStore.get().publish(EntityType.FEED, feed1);
-
-		Feed feed2 = (Feed) EntityType.FEED.getUnmarshaller().unmarshal(
-				(FeedEntityParserTest.class.getResourceAsStream(FEED_XML)));
-		feed2.setName("f2" + System.currentTimeMillis());
-		feed2.setGroups("group1,group2,group5");
-		feed2.setLocations(new Locations());
-		Location location2 = new Location();
-		location2
-				.setPath("/projects/bi/rmc/daily/ad/${YEAR}/fraud/${MONTH}-${DAY}/ad");
-		location2.setType(LocationType.DATA);
-		feed2.getLocations().getLocations().add(location2);
-		feed2.getClusters().getClusters().get(0).getLocations().getLocations().set(0, location);
-		parser.parseAndValidate(feed2.toString());
-	}
-	
-	@Test(expectedExceptions = ValidationException.class)
-	public void testInvalidFeedClusterDataLocation() throws JAXBException, FalconException{
-		Feed feed1 = (Feed) EntityType.FEED.getUnmarshaller().unmarshal(
-				(FeedEntityParserTest.class.getResourceAsStream(FEED_XML)));
-		feed1.setName("f1" + System.currentTimeMillis());
-		feed1.setGroups("group1,group2,group3");
-		feed1.setLocations(new Locations());
-		Location location = new Location();
-		location.setPath("/projects/bi/rmc/daily/ad/${YEAR}/fraud/${MONTH}-${DAY}/ad");
-		location.setType(LocationType.DATA);
-		feed1.getLocations().getLocations().add(location);
-		parser.parseAndValidate(feed1.toString());
-	}
-
-	@Test(expectedExceptions = ValidationException.class)
-	public void testInvalidFeedGroup() throws FalconException, JAXBException {
-		Feed feed1 = (Feed) EntityType.FEED.getUnmarshaller().unmarshal(
-				(FeedEntityParserTest.class.getResourceAsStream(FEED_XML)));
-		feed1.setName("f1" + System.currentTimeMillis());
-		feed1.setGroups("group1,group2,group3");
-		feed1.setLocations(new Locations());
-		Location location = new Location();
-		location.setPath("/projects/bi/rmc/daily/ad/${YEAR}/fraud/${MONTH}-${DAY}/ad");
-		location.setType(LocationType.DATA);
-		feed1.getLocations().getLocations().add(location);
-		parser.parseAndValidate(feed1.toString());
-		
-		feed1.getClusters().getClusters().get(0).getLocations().getLocations().set(0,location);
-		ConfigurationStore.get().publish(EntityType.FEED, feed1);
-
-		Feed feed2 = (Feed) EntityType.FEED.getUnmarshaller().unmarshal(
-				(FeedEntityParserTest.class.getResourceAsStream(FEED_XML)));
-		feed2.setName("f2" + System.currentTimeMillis());
-		feed2.setGroups("group1,group2,group5");
-		feed2.setLocations(new Locations());
-		Location location2 = new Location();
-		location2
-				.setPath("/projects/bi/rmc/daily/ad/${YEAR}/fraud/${MONTH}/${HOUR}/ad");
-		location2.setType(LocationType.DATA);
-		feed2.getLocations().getLocations().add(location2);
-		feed2.getClusters().getClusters().get(0).getLocations().getLocations().set(0,location);
-		parser.parseAndValidate(feed2.toString());
-	}
-
-	@Test
-	public void testValidGroupNames() throws FalconException, JAXBException {
-		Feed feed1 = (Feed) EntityType.FEED.getUnmarshaller().unmarshal(
-				FeedGroupMapTest.class
-						.getResourceAsStream("/config/feed/feed-0.1.xml"));
-		feed1.setName("f1" + System.currentTimeMillis());
-		feed1.setGroups("group7,group8");
-		parser.parseAndValidate(feed1.toString());
-
-		feed1.setGroups("group7");
-		parser.parseAndValidate(feed1.toString());
-
-		feed1.setGroups(null);
-		parser.parseAndValidate(feed1.toString());
-		ConfigurationStore.get().publish(EntityType.FEED, feed1);
-	}
-
-	@Test
-	public void testInvalidGroupNames() throws FalconException, JAXBException {
-		Feed feed1 = (Feed) EntityType.FEED.getUnmarshaller().unmarshal(
-				FeedGroupMapTest.class
-						.getResourceAsStream("/config/feed/feed-0.1.xml"));
-		feed1.setName("f1" + System.currentTimeMillis());
-
-		try {
-			feed1.setGroups("commaend,");
-			parser.parseAndValidate(feed1.toString());
-			Assert.fail("Expected exception");
-		} catch (FalconException e) {
-
-		}
-		try {
-			feed1.setGroups("group8,   group9");
-			parser.parseAndValidate(feed1.toString());
-			Assert.fail("Expected exception");
-		} catch (FalconException e) {
-
-		}
-		try {
-			feed1.setGroups("space in group,group9");
-			parser.parseAndValidate(feed1.toString());
-			Assert.fail("Expected exception");
-		} catch (FalconException e) {
-
-		}
-	}
-	
-	@Test
-	public void testClusterPartitionExp() throws FalconException {
-		Cluster cluster = ConfigurationStore.get().get(EntityType.CLUSTER,
-				"testCluster");
-		Assert.assertEquals(FeedHelper.evaluateClusterExp(cluster,
-				"/*/${cluster.colo}"), "/*/" + cluster.getColo());
-		Assert.assertEquals(FeedHelper.evaluateClusterExp(cluster,
-				"/*/${cluster.name}/Local"), "/*/" + cluster.getName()+"/Local");
-		Assert.assertEquals(FeedHelper.evaluateClusterExp(cluster,
-				"/*/${cluster.field1}/Local"), "/*/value1/Local");
-	}
-	
-	@Test(expectedExceptions=FalconException.class)
-	public void testInvalidFeedName() throws JAXBException, FalconException  {
-		Feed feed1 = (Feed) EntityType.FEED.getUnmarshaller().unmarshal(
-				FeedGroupMapTest.class
-						.getResourceAsStream("/config/feed/feed-0.1.xml"));
-		feed1.setName("Feed_name");
-		parser.parseAndValidate(feed1.toString());
-	}
-	
-	@Test(expectedExceptions=FalconException.class)
-	public void testInvalidFeedGroupName() throws JAXBException, FalconException  {
-		Feed feed1 = (Feed) EntityType.FEED.getUnmarshaller().unmarshal(
-				FeedGroupMapTest.class
-						.getResourceAsStream("/config/feed/feed-0.1.xml"));
-		feed1.setName("feed1");
-		feed1.getLocations().getLocations().get(0)
-				.setPath("/data/clicks/${YEAR}/${MONTH}/${DAY}/${HOUR}");
-		feed1.getClusters().getClusters().get(0).getLocations().getLocations()
-				.get(0).setPath("/data/clicks/${YEAR}/${MONTH}/${DAY}/${HOUR}");
-		ConfigurationStore.get().publish(EntityType.FEED, feed1);
-		
-		Feed feed2 = (Feed) EntityType.FEED.getUnmarshaller().unmarshal(
-				FeedGroupMapTest.class
-						.getResourceAsStream("/config/feed/feed-0.1.xml"));
-		feed2.setName("feed2");
-		feed2.getLocations().getLocations().get(0).setPath("/data/clicks/${YEAR}/${MONTH}/${DAY}/${HOUR}");
-		feed2.getClusters().getClusters().get(0).getLocations().getLocations()
-		.get(0).setPath("/data/clicks/${YEAR}/${MONTH}/${DAY}/${HOUR}");
-		feed2.setFrequency(new Frequency("hours(1)"));
-		try{
-			parser.parseAndValidate(feed2.toString());
-		}catch(FalconException e){
-			e.printStackTrace();
-			Assert.fail("Not expecting exception for same frequency");
-		}
-		feed2.setFrequency(new Frequency("hours(2)"));
-		//expecting exception
-		parser.parseAndValidate(feed2.toString());
-	}
-	
-	@Test
-	public void testNullFeedLateArrival() throws JAXBException, FalconException  {
-		Feed feed = (Feed) EntityType.FEED.getUnmarshaller().unmarshal(
-				FeedGroupMapTest.class
-						.getResourceAsStream("/config/feed/feed-0.1.xml"));
-		
-		feed.setLateArrival(null);
-		parser.parseAndValidate(feed.toString());
-		
-	}
+    }
+
+    @Test
+    public void testInvalidClusterValidityTime() {
+        Validity validity = modifiableFeed.getClusters().getClusters().get(0)
+                .getValidity();
+        try {
+            validity.setStart(SchemaHelper.parseDateUTC("2007-02-29T00:00Z"));
+            modifiableFeed.getClusters().getClusters().get(0)
+                    .setValidity(validity);
+            parser.parseAndValidate(marshallEntity(modifiableFeed));
+            Assert.fail("Cluster validity failed");
+        } catch (Exception e) {
+            System.out.println(e.getMessage());
+            validity.setStart(SchemaHelper.parseDateUTC("2011-11-01T00:00Z"));
+            modifiableFeed.getClusters().getClusters().get(0)
+                    .setValidity(validity);
+        }
+
+        try {
+            validity.setEnd(SchemaHelper.parseDateUTC("2010-04-31T00:00Z"));
+            modifiableFeed.getClusters().getClusters().get(0)
+                    .setValidity(validity);
+            parser.parseAndValidate(marshallEntity(modifiableFeed));
+            Assert.fail("Cluster validity failed");
+        } catch (Exception e) {
+            System.out.println(e.getMessage());
+            validity.setEnd(SchemaHelper.parseDateUTC("2011-12-31T00:00Z"));
+            modifiableFeed.getClusters().getClusters().get(0)
+                    .setValidity(validity);
+        }
+    }
+
+    @Test(expectedExceptions = ValidationException.class)
+    public void testInvalidProcessValidity() throws Exception {
+        Feed feed = parser.parseAndValidate((FeedEntityParserTest.class
+                .getResourceAsStream(FEED_XML)));
+        feed.getClusters().getClusters().get(0).getValidity()
+                .setStart(SchemaHelper.parseDateUTC("2012-11-01T00:00Z"));
+        parser.validate(feed);
+    }
+
+    @Test
+    public void testValidFeedGroup() throws FalconException, JAXBException {
+        Feed feed1 = (Feed) EntityType.FEED.getUnmarshaller().unmarshal(
+                (FeedEntityParserTest.class.getResourceAsStream(FEED_XML)));
+        feed1.setName("f1" + System.currentTimeMillis());
+        feed1.setGroups("group1,group2,group3");
+        feed1.setLocations(new Locations());
+        Location location = new Location();
+        location.setPath("/projects/bi/rmc/daily/ad/${YEAR}/fraud/${MONTH}-${DAY}/ad");
+        location.setType(LocationType.DATA);
+        feed1.getLocations().getLocations().add(location);
+        feed1.getClusters().getClusters().get(0).getLocations().getLocations().set(0, location);
+        parser.parseAndValidate(feed1.toString());
+        ConfigurationStore.get().publish(EntityType.FEED, feed1);
+
+        Feed feed2 = (Feed) EntityType.FEED.getUnmarshaller().unmarshal(
+                (FeedEntityParserTest.class.getResourceAsStream(FEED_XML)));
+        feed2.setName("f2" + System.currentTimeMillis());
+        feed2.setGroups("group1,group2,group5");
+        feed2.setLocations(new Locations());
+        Location location2 = new Location();
+        location2
+                .setPath("/projects/bi/rmc/daily/ad/${YEAR}/fraud/${MONTH}-${DAY}/ad");
+        location2.setType(LocationType.DATA);
+        feed2.getLocations().getLocations().add(location2);
+        feed2.getClusters().getClusters().get(0).getLocations().getLocations().set(0, location);
+        parser.parseAndValidate(feed2.toString());
+    }
+
+    @Test(expectedExceptions = ValidationException.class)
+    public void testInvalidFeedClusterDataLocation() throws JAXBException, FalconException {
+        Feed feed1 = (Feed) EntityType.FEED.getUnmarshaller().unmarshal(
+                (FeedEntityParserTest.class.getResourceAsStream(FEED_XML)));
+        feed1.setName("f1" + System.currentTimeMillis());
+        feed1.setGroups("group1,group2,group3");
+        feed1.setLocations(new Locations());
+        Location location = new Location();
+        location.setPath("/projects/bi/rmc/daily/ad/${YEAR}/fraud/${MONTH}-${DAY}/ad");
+        location.setType(LocationType.DATA);
+        feed1.getLocations().getLocations().add(location);
+        parser.parseAndValidate(feed1.toString());
+    }
+
+    @Test(expectedExceptions = ValidationException.class)
+    public void testInvalidFeedGroup() throws FalconException, JAXBException {
+        Feed feed1 = (Feed) EntityType.FEED.getUnmarshaller().unmarshal(
+                (FeedEntityParserTest.class.getResourceAsStream(FEED_XML)));
+        feed1.setName("f1" + System.currentTimeMillis());
+        feed1.setGroups("group1,group2,group3");
+        feed1.setLocations(new Locations());
+        Location location = new Location();
+        location.setPath("/projects/bi/rmc/daily/ad/${YEAR}/fraud/${MONTH}-${DAY}/ad");
+        location.setType(LocationType.DATA);
+        feed1.getLocations().getLocations().add(location);
+        parser.parseAndValidate(feed1.toString());
+
+        feed1.getClusters().getClusters().get(0).getLocations().getLocations().set(0, location);
+        ConfigurationStore.get().publish(EntityType.FEED, feed1);
+
+        Feed feed2 = (Feed) EntityType.FEED.getUnmarshaller().unmarshal(
+                (FeedEntityParserTest.class.getResourceAsStream(FEED_XML)));
+        feed2.setName("f2" + System.currentTimeMillis());
+        feed2.setGroups("group1,group2,group5");
+        feed2.setLocations(new Locations());
+        Location location2 = new Location();
+        location2
+                .setPath("/projects/bi/rmc/daily/ad/${YEAR}/fraud/${MONTH}/${HOUR}/ad");
+        location2.setType(LocationType.DATA);
+        feed2.getLocations().getLocations().add(location2);
+        feed2.getClusters().getClusters().get(0).getLocations().getLocations().set(0, location);
+        parser.parseAndValidate(feed2.toString());
+    }
+
+    @Test
+    public void testValidGroupNames() throws FalconException, JAXBException {
+        Feed feed1 = (Feed) EntityType.FEED.getUnmarshaller().unmarshal(
+                FeedGroupMapTest.class
+                        .getResourceAsStream("/config/feed/feed-0.1.xml"));
+        feed1.setName("f1" + System.currentTimeMillis());
+        feed1.setGroups("group7,group8");
+        parser.parseAndValidate(feed1.toString());
+
+        feed1.setGroups("group7");
+        parser.parseAndValidate(feed1.toString());
+
+        feed1.setGroups(null);
+        parser.parseAndValidate(feed1.toString());
+        ConfigurationStore.get().publish(EntityType.FEED, feed1);
+    }
+
+    @Test
+    public void testInvalidGroupNames() throws FalconException, JAXBException {
+        Feed feed1 = (Feed) EntityType.FEED.getUnmarshaller().unmarshal(
+                FeedGroupMapTest.class
+                        .getResourceAsStream("/config/feed/feed-0.1.xml"));
+        feed1.setName("f1" + System.currentTimeMillis());
+
+        try {
+            feed1.setGroups("commaend,");
+            parser.parseAndValidate(feed1.toString());
+            Assert.fail("Expected exception");
+        } catch (FalconException e) {
+
+        }
+        try {
+            feed1.setGroups("group8,   group9");
+            parser.parseAndValidate(feed1.toString());
+            Assert.fail("Expected exception");
+        } catch (FalconException e) {
+
+        }
+        try {
+            feed1.setGroups("space in group,group9");
+            parser.parseAndValidate(feed1.toString());
+            Assert.fail("Expected exception");
+        } catch (FalconException e) {
+
+        }
+    }
+
+    @Test
+    public void testClusterPartitionExp() throws FalconException {
+        Cluster cluster = ConfigurationStore.get().get(EntityType.CLUSTER,
+                "testCluster");
+        Assert.assertEquals(FeedHelper.evaluateClusterExp(cluster,
+                "/*/${cluster.colo}"), "/*/" + cluster.getColo());
+        Assert.assertEquals(FeedHelper.evaluateClusterExp(cluster,
+                "/*/${cluster.name}/Local"), "/*/" + cluster.getName() + "/Local");
+        Assert.assertEquals(FeedHelper.evaluateClusterExp(cluster,
+                "/*/${cluster.field1}/Local"), "/*/value1/Local");
+    }
+
+    @Test(expectedExceptions = FalconException.class)
+    public void testInvalidFeedName() throws JAXBException, FalconException {
+        Feed feed1 = (Feed) EntityType.FEED.getUnmarshaller().unmarshal(
+                FeedGroupMapTest.class
+                        .getResourceAsStream("/config/feed/feed-0.1.xml"));
+        feed1.setName("Feed_name");
+        parser.parseAndValidate(feed1.toString());
+    }
+
+    @Test(expectedExceptions = FalconException.class)
+    public void testInvalidFeedGroupName() throws JAXBException, FalconException {
+        Feed feed1 = (Feed) EntityType.FEED.getUnmarshaller().unmarshal(
+                FeedGroupMapTest.class
+                        .getResourceAsStream("/config/feed/feed-0.1.xml"));
+        feed1.setName("feed1");
+        feed1.getLocations().getLocations().get(0)
+                .setPath("/data/clicks/${YEAR}/${MONTH}/${DAY}/${HOUR}");
+        feed1.getClusters().getClusters().get(0).getLocations().getLocations()
+                .get(0).setPath("/data/clicks/${YEAR}/${MONTH}/${DAY}/${HOUR}");
+        ConfigurationStore.get().publish(EntityType.FEED, feed1);
+
+        Feed feed2 = (Feed) EntityType.FEED.getUnmarshaller().unmarshal(
+                FeedGroupMapTest.class
+                        .getResourceAsStream("/config/feed/feed-0.1.xml"));
+        feed2.setName("feed2");
+        feed2.getLocations().getLocations().get(0).setPath("/data/clicks/${YEAR}/${MONTH}/${DAY}/${HOUR}");
+        feed2.getClusters().getClusters().get(0).getLocations().getLocations()
+                .get(0).setPath("/data/clicks/${YEAR}/${MONTH}/${DAY}/${HOUR}");
+        feed2.setFrequency(new Frequency("hours(1)"));
+        try {
+            parser.parseAndValidate(feed2.toString());
+        } catch (FalconException e) {
+            e.printStackTrace();
+            Assert.fail("Not expecting exception for same frequency");
+        }
+        feed2.setFrequency(new Frequency("hours(2)"));
+        //expecting exception
+        parser.parseAndValidate(feed2.toString());
+    }
+
+    @Test
+    public void testNullFeedLateArrival() throws JAXBException, FalconException {
+        Feed feed = (Feed) EntityType.FEED.getUnmarshaller().unmarshal(
+                FeedGroupMapTest.class
+                        .getResourceAsStream("/config/feed/feed-0.1.xml"));
+
+        feed.setLateArrival(null);
+        parser.parseAndValidate(feed.toString());
+
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/a4d79f0c/common/src/test/java/org/apache/falcon/entity/parser/FeedUpdateTest.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/falcon/entity/parser/FeedUpdateTest.java b/common/src/test/java/org/apache/falcon/entity/parser/FeedUpdateTest.java
index 7d5ef5f..4f62431 100644
--- a/common/src/test/java/org/apache/falcon/entity/parser/FeedUpdateTest.java
+++ b/common/src/test/java/org/apache/falcon/entity/parser/FeedUpdateTest.java
@@ -46,10 +46,10 @@ public class FeedUpdateTest extends AbstractTestBase {
         setup();
     }
 
-	@AfterClass
-	public void tearDown() {
-		this.dfsCluster.shutdown();
-	}
+    @AfterClass
+    public void tearDown() {
+        this.dfsCluster.shutdown();
+    }
 
     @Override
     public void setup() throws Exception {

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/a4d79f0c/common/src/test/java/org/apache/falcon/entity/parser/ProcessEntityParserTest.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/falcon/entity/parser/ProcessEntityParserTest.java b/common/src/test/java/org/apache/falcon/entity/parser/ProcessEntityParserTest.java
index 9118bbd..88e9968 100644
--- a/common/src/test/java/org/apache/falcon/entity/parser/ProcessEntityParserTest.java
+++ b/common/src/test/java/org/apache/falcon/entity/parser/ProcessEntityParserTest.java
@@ -18,15 +18,6 @@
 
 package org.apache.falcon.entity.parser;
 
-import java.io.IOException;
-import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Marshaller;
-import javax.xml.bind.Unmarshaller;
-
 import org.apache.falcon.FalconException;
 import org.apache.falcon.cluster.util.EmbeddedCluster;
 import org.apache.falcon.entity.AbstractTestBase;
@@ -41,7 +32,15 @@ import org.testng.annotations.BeforeClass;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
-public class ProcessEntityParserTest extends AbstractTestBase{
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+import java.io.IOException;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.List;
+
+public class ProcessEntityParserTest extends AbstractTestBase {
 
     private final ProcessEntityParser parser = (ProcessEntityParser) EntityParserFactory.getParser(EntityType.PROCESS);
     private String INVALID_PROCESS_XML = "/config/process/process-invalid.xml";
@@ -57,15 +56,15 @@ public class ProcessEntityParserTest extends AbstractTestBase{
         this.dfsCluster = EmbeddedCluster.newCluster("testCluster", false);
         this.conf = dfsCluster.getConf();
     }
-    
-	@AfterClass
-	public void tearDown() {
-		this.dfsCluster.shutdown();
-	}
-    
+
+    @AfterClass
+    public void tearDown() {
+        this.dfsCluster.shutdown();
+    }
+
     @BeforeMethod
     public void setup() throws Exception {
-        storeEntity(EntityType.CLUSTER, "testCluster");        
+        storeEntity(EntityType.CLUSTER, "testCluster");
         storeEntity(EntityType.FEED, "impressionFeed");
         storeEntity(EntityType.FEED, "clicksFeed");
         storeEntity(EntityType.FEED, "imp-click-join1");
@@ -77,7 +76,7 @@ public class ProcessEntityParserTest extends AbstractTestBase{
     public void testParse() throws FalconException, JAXBException {
 
         Process process = parser.parseAndValidate(getClass().getResourceAsStream(PROCESS_XML));
-        
+
         Assert.assertNotNull(process);
         Assert.assertEquals(process.getName(), "sample");
 
@@ -123,28 +122,31 @@ public class ProcessEntityParserTest extends AbstractTestBase{
         try {
             parser.validate(process);
             throw new AssertionError("Expected ValidationException!");
-        } catch (ValidationException e) { }
+        } catch (ValidationException e) {
+        }
 
         process.getInputs().getInputs().get(0).setStart("today(0,0)");
         process.getInputs().getInputs().get(0).setEnd("lastMonth(0,0,0)");
         try {
             parser.validate(process);
             throw new AssertionError("Expected ValidationException!");
-        } catch (ValidationException e) { }
+        } catch (ValidationException e) {
+        }
 
         process.getInputs().getInputs().get(0).setStart("today(2,0)");
         process.getInputs().getInputs().get(0).setEnd("today(0,0)");
         try {
             parser.validate(process);
             throw new AssertionError("Expected ValidationException!");
-        } catch (ValidationException e) { }
+        } catch (ValidationException e) {
+        }
 
     }
-    
+
     @Test(expectedExceptions = FalconException.class)
     public void doParseInvalidXML() throws IOException, FalconException {
 
-        parser.parseAndValidate(this.getClass().getResourceAsStream(INVALID_PROCESS_XML ));
+        parser.parseAndValidate(this.getClass().getResourceAsStream(INVALID_PROCESS_XML));
     }
 
     @Test(expectedExceptions = ValidationException.class)
@@ -162,7 +164,7 @@ public class ProcessEntityParserTest extends AbstractTestBase{
     @Test
     public void testConcurrentParsing() throws Exception {
         List<Thread> threadList = new ArrayList<Thread>();
-        
+
         for (int i = 0; i < 3; i++) {
             threadList.add(new Thread() {
                 public void run() {
@@ -175,102 +177,103 @@ public class ProcessEntityParserTest extends AbstractTestBase{
                 }
             });
         }
-        for(Thread thread:threadList) {
+        for (Thread thread : threadList) {
             thread.start();
         }
-        for(Thread thread:threadList) {
+        for (Thread thread : threadList) {
             thread.join();
         }
     }
 
-	@Test(expectedExceptions = ValidationException.class)
-	public void testInvalidProcessValidity() throws Exception {
-		Process process = parser
-				.parseAndValidate((ProcessEntityParserTest.class
-						.getResourceAsStream(PROCESS_XML)));
-		process.getClusters().getClusters().get(0).getValidity().setStart(SchemaHelper.parseDateUTC("2011-12-31T00:00Z"));
-		parser.validate(process);
-	}
-	
-	@Test(expectedExceptions = ValidationException.class)
-	public void testInvalidDependentFeedsRetentionLimit() throws Exception {
-		Process process = parser
-				.parseAndValidate((ProcessEntityParserTest.class
-						.getResourceAsStream(PROCESS_XML)));
-		process.getInputs().getInputs().get(0).setStart("today(-48,0)");
-		parser.validate(process);
-	}
-	
-	@Test(expectedExceptions = ValidationException.class)
-	public void testDuplicateInputOutputNames() throws FalconException {
-		Process process = parser
-				.parseAndValidate((ProcessEntityParserTest.class
-						.getResourceAsStream(PROCESS_XML)));
-		process.getInputs().getInputs().get(0).setName("duplicateName");
-		process.getOutputs().getOutputs().get(0).setName("duplicateName");
-		parser.validate(process);
-	}
-	
-	@Test(expectedExceptions = FalconException.class)
-	public void testInvalidRetryAttempt() throws FalconException {
-		Process process = parser
-				.parseAndValidate((ProcessEntityParserTest.class
-						.getResourceAsStream(PROCESS_XML)));
-		process.getRetry().setAttempts(-1);
-		parser.parseAndValidate(process.toString());
-	}
-
-	@Test(expectedExceptions = FalconException.class)
-	public void testInvalidRetryDelay() throws FalconException {
-		Process process = parser
-				.parseAndValidate((ProcessEntityParserTest.class
-						.getResourceAsStream(PROCESS_XML)));
-		process.getRetry().setDelay(Frequency.fromString("hours(0)"));
-		parser.parseAndValidate(process.toString());
-	}
-	
-	@Test(expectedExceptions = ValidationException.class)
-	public void testInvalidLateInputs() throws Exception {
-		Process process = parser
-				.parseAndValidate((ProcessEntityParserTest.class
-						.getResourceAsStream(PROCESS_XML)));
-		process.getLateProcess().getLateInputs().get(0).setInput("invalidInput");
-		parser.parseAndValidate(process.toString());
-	}
-	
-	@Test(expectedExceptions = FalconException.class)
-	public void testInvalidProcessName() throws Exception {
-		Process process = parser
-				.parseAndValidate((ProcessEntityParserTest.class
-						.getResourceAsStream(PROCESS_XML)));
-		process.setName("name_with_underscore");
-		parser.parseAndValidate(process.toString());
-	}
-	
-	@Test
-	public void testOozieFutureExpression() throws Exception {
-		Process process = parser
-				.parseAndValidate((ProcessEntityParserTest.class
-						.getResourceAsStream(PROCESS_XML)));
-		process.getInputs().getInputs().get(0).setStart("future(1,2)");
-		parser.parseAndValidate(process.toString());
-	}
-	
-	@Test
-	public void testOozieLatestExpression() throws Exception {
-		Process process = parser
-				.parseAndValidate((ProcessEntityParserTest.class
-						.getResourceAsStream(PROCESS_XML)));
-		process.getInputs().getInputs().get(0).setStart("latest(-1)");
-		parser.parseAndValidate(process.toString());
-	}
-	
-	@Test(expectedExceptions=ValidationException.class)
-	public void testDuplicateClusterName() throws Exception {
-		Process process = parser
-				.parse((ProcessEntityParserTest.class
-						.getResourceAsStream(PROCESS_XML)));
-		process.getClusters().getClusters().add(1, process.getClusters().getClusters().get(0));
-		parser.validate(process);
-	}
+    @Test(expectedExceptions = ValidationException.class)
+    public void testInvalidProcessValidity() throws Exception {
+        Process process = parser
+                .parseAndValidate((ProcessEntityParserTest.class
+                        .getResourceAsStream(PROCESS_XML)));
+        process.getClusters().getClusters().get(0).getValidity().setStart(
+                SchemaHelper.parseDateUTC("2011-12-31T00:00Z"));
+        parser.validate(process);
+    }
+
+    @Test(expectedExceptions = ValidationException.class)
+    public void testInvalidDependentFeedsRetentionLimit() throws Exception {
+        Process process = parser
+                .parseAndValidate((ProcessEntityParserTest.class
+                        .getResourceAsStream(PROCESS_XML)));
+        process.getInputs().getInputs().get(0).setStart("today(-48,0)");
+        parser.validate(process);
+    }
+
+    @Test(expectedExceptions = ValidationException.class)
+    public void testDuplicateInputOutputNames() throws FalconException {
+        Process process = parser
+                .parseAndValidate((ProcessEntityParserTest.class
+                        .getResourceAsStream(PROCESS_XML)));
+        process.getInputs().getInputs().get(0).setName("duplicateName");
+        process.getOutputs().getOutputs().get(0).setName("duplicateName");
+        parser.validate(process);
+    }
+
+    @Test(expectedExceptions = FalconException.class)
+    public void testInvalidRetryAttempt() throws FalconException {
+        Process process = parser
+                .parseAndValidate((ProcessEntityParserTest.class
+                        .getResourceAsStream(PROCESS_XML)));
+        process.getRetry().setAttempts(-1);
+        parser.parseAndValidate(process.toString());
+    }
+
+    @Test(expectedExceptions = FalconException.class)
+    public void testInvalidRetryDelay() throws FalconException {
+        Process process = parser
+                .parseAndValidate((ProcessEntityParserTest.class
+                        .getResourceAsStream(PROCESS_XML)));
+        process.getRetry().setDelay(Frequency.fromString("hours(0)"));
+        parser.parseAndValidate(process.toString());
+    }
+
+    @Test(expectedExceptions = ValidationException.class)
+    public void testInvalidLateInputs() throws Exception {
+        Process process = parser
+                .parseAndValidate((ProcessEntityParserTest.class
+                        .getResourceAsStream(PROCESS_XML)));
+        process.getLateProcess().getLateInputs().get(0).setInput("invalidInput");
+        parser.parseAndValidate(process.toString());
+    }
+
+    @Test(expectedExceptions = FalconException.class)
+    public void testInvalidProcessName() throws Exception {
+        Process process = parser
+                .parseAndValidate((ProcessEntityParserTest.class
+                        .getResourceAsStream(PROCESS_XML)));
+        process.setName("name_with_underscore");
+        parser.parseAndValidate(process.toString());
+    }
+
+    @Test
+    public void testOozieFutureExpression() throws Exception {
+        Process process = parser
+                .parseAndValidate((ProcessEntityParserTest.class
+                        .getResourceAsStream(PROCESS_XML)));
+        process.getInputs().getInputs().get(0).setStart("future(1,2)");
+        parser.parseAndValidate(process.toString());
+    }
+
+    @Test
+    public void testOozieLatestExpression() throws Exception {
+        Process process = parser
+                .parseAndValidate((ProcessEntityParserTest.class
+                        .getResourceAsStream(PROCESS_XML)));
+        process.getInputs().getInputs().get(0).setStart("latest(-1)");
+        parser.parseAndValidate(process.toString());
+    }
+
+    @Test(expectedExceptions = ValidationException.class)
+    public void testDuplicateClusterName() throws Exception {
+        Process process = parser
+                .parse((ProcessEntityParserTest.class
+                        .getResourceAsStream(PROCESS_XML)));
+        process.getClusters().getClusters().add(1, process.getClusters().getClusters().get(0));
+        parser.validate(process);
+    }
 }


Mime
View raw message