Repository: falcon Updated Branches: refs/heads/master c1d37bfab -> 491cd8eaa
FALCON-2062 Fix Checkstyle issues in trunk Author: Ajay Yadava <[email protected]> Reviewers: "Balu Vellanki <[email protected]>" Closes #216 from ajayyadava/2062 Project: http://git-wip-us.apache.org/repos/asf/falcon/repo Commit: http://git-wip-us.apache.org/repos/asf/falcon/commit/491cd8ea Tree: http://git-wip-us.apache.org/repos/asf/falcon/tree/491cd8ea Diff: http://git-wip-us.apache.org/repos/asf/falcon/diff/491cd8ea Branch: refs/heads/master Commit: 491cd8eaaa6b8117bb1a911280fbc580b98bf83d Parents: c1d37bf Author: Ajay Yadava <[email protected]> Authored: Fri Jul 8 13:33:57 2016 -0700 Committer: bvellanki <[email protected]> Committed: Fri Jul 8 13:33:57 2016 -0700 ---------------------------------------------------------------------- .../apache/falcon/unit/FalconUnitClient.java | 3 +- .../apache/falcon/unit/FalconUnitTestBase.java | 23 +++++------- .../org/apache/falcon/unit/TestFalconUnit.java | 11 +++--- .../AbstractSchedulerManagerJerseyIT.java | 38 +++++++++---------- .../falcon/resource/EntityManagerJerseyIT.java | 39 ++++++++++---------- 5 files changed, 54 insertions(+), 60 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/falcon/blob/491cd8ea/unit/src/main/java/org/apache/falcon/unit/FalconUnitClient.java ---------------------------------------------------------------------- diff --git a/unit/src/main/java/org/apache/falcon/unit/FalconUnitClient.java b/unit/src/main/java/org/apache/falcon/unit/FalconUnitClient.java index fed50cf..1025ced 100644 --- a/unit/src/main/java/org/apache/falcon/unit/FalconUnitClient.java +++ b/unit/src/main/java/org/apache/falcon/unit/FalconUnitClient.java @@ -370,7 +370,8 @@ public class FalconUnitClient extends AbstractFalconClient { } @Override - public SchedulableEntityInstanceResult getFeedSlaMissPendingAlerts(String entityType, String entityName, String start, String end, String colo) { + public SchedulableEntityInstanceResult getFeedSlaMissPendingAlerts(String entityType, String entityName, + String start, String end, String colo) { return null; } http://git-wip-us.apache.org/repos/asf/falcon/blob/491cd8ea/unit/src/test/java/org/apache/falcon/unit/FalconUnitTestBase.java ---------------------------------------------------------------------- diff --git a/unit/src/test/java/org/apache/falcon/unit/FalconUnitTestBase.java b/unit/src/test/java/org/apache/falcon/unit/FalconUnitTestBase.java index fab794c..bfc8b08 100644 --- a/unit/src/test/java/org/apache/falcon/unit/FalconUnitTestBase.java +++ b/unit/src/test/java/org/apache/falcon/unit/FalconUnitTestBase.java @@ -21,7 +21,6 @@ import org.apache.commons.io.FileUtils; import org.apache.commons.lang.StringUtils; import org.apache.falcon.FalconException; import org.apache.falcon.LifeCycle; -import org.apache.falcon.client.FalconCLIException; import org.apache.falcon.entity.EntityUtil; import org.apache.falcon.entity.FeedHelper; import org.apache.falcon.entity.Storage; @@ -140,7 +139,7 @@ public class FalconUnitTestBase { } public boolean submitCluster(String colo, String cluster, - Map<String, String> props) throws IOException, FalconCLIException { + Map<String, String> props) throws IOException { props = updateColoAndCluster(colo, cluster, props); fs.mkdirs(new Path(STAGING_PATH), HadoopClientFactory.ALL_PERMISSION); fs.mkdirs(new Path(WORKING_PATH), HadoopClientFactory.READ_EXECUTE_PERMISSION); @@ -149,26 +148,26 @@ public class FalconUnitTestBase { return true ? APIResult.Status.SUCCEEDED.equals(result.getStatus()) : false; } - public boolean submitCluster() throws IOException, FalconCLIException { + public boolean submitCluster() throws IOException { return submitCluster(DEFAULT_COLO, DEFAULT_CLUSTER, null); } - public APIResult submit(EntityType entityType, String filePath) throws FalconCLIException, IOException { + public APIResult submit(EntityType entityType, String filePath) throws IOException { return submit(entityType.toString(), filePath); } - public APIResult submit(String entityType, String filePath) throws FalconCLIException, IOException { + public APIResult submit(String entityType, String filePath) throws IOException { return falconUnitClient.submit(entityType, filePath, ""); } - public APIResult submitProcess(String filePath, String appDirectory) throws IOException, FalconCLIException { + public APIResult submitProcess(String filePath, String appDirectory) throws IOException { createDir(appDirectory); return submit(EntityType.PROCESS, filePath); } public APIResult scheduleProcess(String processName, String startTime, int numInstances, String cluster, String localWfPath, Boolean skipDryRun, - String properties) throws FalconException, IOException, FalconCLIException { + String properties) throws FalconException, IOException { Process processEntity = configStore.get(EntityType.PROCESS, processName); if (processEntity == null) { throw new FalconException("Process not found " + processName); @@ -180,7 +179,7 @@ public class FalconUnitTestBase { } public APIResult scheduleProcess(String processName, String cluster, String localWfPath) throws FalconException, - IOException, FalconCLIException { + IOException { Process processEntity = configStore.get(EntityType.PROCESS, processName); if (processEntity == null) { throw new FalconException("Process not found " + processName); @@ -190,8 +189,7 @@ public class FalconUnitTestBase { return falconUnitClient.schedule(EntityType.PROCESS, processName, cluster, false, null, null); } - public APIResult schedule(EntityType entityType, String entityName, String cluster) throws FalconException, - FalconCLIException { + public APIResult schedule(EntityType entityType, String entityName, String cluster) throws FalconException { Entity entity = configStore.get(entityType, entityName); if (entity == null) { throw new FalconException("Process not found " + entityName); @@ -201,7 +199,7 @@ public class FalconUnitTestBase { public APIResult submitAndSchedule(String type, String filePath, String localWfPath, Boolean skipDryRun, String doAsUser, String properties, String appDirectory) throws IOException, - FalconException, FalconCLIException { + FalconException { createDir(appDirectory); fs.copyFromLocalFile(new Path(localWfPath), new Path(appDirectory, "workflow.xml")); return falconUnitClient.submitAndSchedule(type, filePath, skipDryRun, doAsUser, properties); @@ -368,8 +366,7 @@ public class FalconUnitTestBase { Assert.assertEquals(APIResult.Status.SUCCEEDED, apiResult.getStatus()); } - public InstancesResult.WorkflowStatus getRetentionStatus(String feedName, String cluster) throws FalconException, - FalconCLIException { + public InstancesResult.WorkflowStatus getRetentionStatus(String feedName, String cluster) throws FalconException { Feed feedEntity = EntityUtil.getEntity(EntityType.FEED, feedName); Frequency feedFrequency = feedEntity.getFrequency(); http://git-wip-us.apache.org/repos/asf/falcon/blob/491cd8ea/unit/src/test/java/org/apache/falcon/unit/TestFalconUnit.java ---------------------------------------------------------------------- diff --git a/unit/src/test/java/org/apache/falcon/unit/TestFalconUnit.java b/unit/src/test/java/org/apache/falcon/unit/TestFalconUnit.java index 56dcf87..0bc7755 100644 --- a/unit/src/test/java/org/apache/falcon/unit/TestFalconUnit.java +++ b/unit/src/test/java/org/apache/falcon/unit/TestFalconUnit.java @@ -19,7 +19,6 @@ package org.apache.falcon.unit; import org.apache.falcon.FalconException; import org.apache.falcon.FalconWebException; -import org.apache.falcon.client.FalconCLIException; import org.apache.falcon.entity.v0.EntityType; import org.apache.falcon.entity.v0.process.Process; import org.apache.falcon.entity.v0.process.Property; @@ -83,7 +82,7 @@ public class TestFalconUnit extends FalconUnitTestBase { } @Test - public void testRetention() throws IOException, FalconCLIException, FalconException, + public void testRetention() throws IOException, FalconException, ParseException, InterruptedException { // submit with default props submitCluster(); @@ -129,7 +128,7 @@ public class TestFalconUnit extends FalconUnitTestBase { } @Test - public void testDelete() throws IOException, FalconCLIException, FalconException, + public void testDelete() throws IOException, FalconException, ParseException, InterruptedException { // submit cluster and feeds submitClusterAndFeeds(); @@ -162,7 +161,7 @@ public class TestFalconUnit extends FalconUnitTestBase { } @Test - public void testValidate() throws IOException, FalconCLIException, FalconException { + public void testValidate() throws IOException, FalconException { submitClusterAndFeeds(); APIResult result = getClient().validate(EntityType.PROCESS.name(), getAbsolutePath(PROCESS), true, null); @@ -177,7 +176,7 @@ public class TestFalconUnit extends FalconUnitTestBase { } @Test - public void testUpdateAndTouch() throws IOException, FalconCLIException, FalconException, ParseException, + public void testUpdateAndTouch() throws IOException, FalconException, ParseException, InterruptedException { submitClusterAndFeeds(); APIResult result = submitProcess(getAbsolutePath(PROCESS), PROCESS_APP_PATH); @@ -212,7 +211,7 @@ public class TestFalconUnit extends FalconUnitTestBase { file.delete(); } - private void submitClusterAndFeeds() throws IOException, FalconCLIException { + private void submitClusterAndFeeds() throws IOException { // submit with default props submitCluster(); // submitting feeds http://git-wip-us.apache.org/repos/asf/falcon/blob/491cd8ea/webapp/src/test/java/org/apache/falcon/resource/AbstractSchedulerManagerJerseyIT.java ---------------------------------------------------------------------- diff --git a/webapp/src/test/java/org/apache/falcon/resource/AbstractSchedulerManagerJerseyIT.java b/webapp/src/test/java/org/apache/falcon/resource/AbstractSchedulerManagerJerseyIT.java index c5425b2..92a1319 100644 --- a/webapp/src/test/java/org/apache/falcon/resource/AbstractSchedulerManagerJerseyIT.java +++ b/webapp/src/test/java/org/apache/falcon/resource/AbstractSchedulerManagerJerseyIT.java @@ -18,13 +18,23 @@ package org.apache.falcon.resource; +import java.io.File; +import java.io.IOException; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.TimeZone; + import org.apache.commons.lang3.StringUtils; import org.apache.falcon.FalconException; -import org.apache.falcon.client.FalconCLIException; import org.apache.falcon.entity.v0.EntityType; import org.apache.falcon.hadoop.HadoopClientFactory; -import org.apache.falcon.state.AbstractSchedulerTestBase; import org.apache.falcon.service.FalconJPAService; +import org.apache.falcon.state.AbstractSchedulerTestBase; import org.apache.falcon.unit.FalconUnitTestBase; import org.apache.falcon.util.StartupProperties; import org.apache.falcon.util.StateStoreProperties; @@ -36,17 +46,6 @@ import org.testng.Assert; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; -import java.io.File; -import java.io.IOException; -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Date; -import java.util.List; -import java.util.Map; -import java.util.TimeZone; - /** * Base class for tests using Native Scheduler. */ @@ -94,14 +93,14 @@ public class AbstractSchedulerManagerJerseyIT extends FalconUnitTestBase { "org.apache.falcon.state.store.jdbc.JDBCStateStore"); } - protected void submitProcess(Map<String, String> overlay) throws IOException, FalconCLIException { + protected void submitProcess(Map<String, String> overlay) throws IOException { String tmpFile = TestContext.overlayParametersOverTemplate(PROCESS_TEMPLATE, overlay); APIResult result = submit(EntityType.PROCESS, tmpFile); assertStatus(result); } protected void scheduleProcess(String processName, String cluster, - String startTime, int noOfInstances) throws FalconCLIException { + String startTime, int noOfInstances) { APIResult result = falconUnitClient.schedule(EntityType.PROCESS, processName, startTime, noOfInstances, cluster, true, null); assertStatus(result); @@ -137,7 +136,7 @@ public class AbstractSchedulerManagerJerseyIT extends FalconUnitTestBase { localFS.delete(new Path(DB_BASE_DIR), true); } - protected void submitCluster(UnitTestContext context) throws IOException, FalconCLIException { + protected void submitCluster(UnitTestContext context) throws IOException { String mode = System.getProperty(IT_RUN_MODE); if (StringUtils.isNotEmpty(mode) && mode.toLowerCase().equals(LOCAL_MODE)) { submitCluster(context.colo, context.clusterName, null); @@ -150,14 +149,13 @@ public class AbstractSchedulerManagerJerseyIT extends FalconUnitTestBase { } } - protected APIResult submitFeed(String template, Map<String, String> overlay) throws IOException, - FalconCLIException { + protected APIResult submitFeed(String template, Map<String, String> overlay) throws IOException { String tmpFile = TestContext.overlayParametersOverTemplate(template, overlay); APIResult result = falconUnitClient.submit(EntityType.FEED.name(), tmpFile, null); return result; } - protected void submitFeeds(Map<String, String> overlay) throws IOException, FalconCLIException { + protected void submitFeeds(Map<String, String> overlay) throws IOException { String tmpFile = TestContext.overlayParametersOverTemplate(UnitTestContext.FEED_TEMPLATE1, overlay); APIResult result = falconUnitClient.submit(EntityType.FEED.name(), tmpFile, null); Assert.assertEquals(result.getStatus(), APIResult.Status.SUCCEEDED); @@ -172,7 +170,7 @@ public class AbstractSchedulerManagerJerseyIT extends FalconUnitTestBase { Assert.assertEquals(result.getStatus(), APIResult.Status.SUCCEEDED); } - protected void scheduleProcess(UnitTestContext context) throws FalconCLIException, IOException, FalconException { + protected void scheduleProcess(UnitTestContext context) throws IOException, FalconException { String scheduleTime = START_INSTANCE; APIResult result = scheduleProcess(context.getProcessName(), scheduleTime, 1, context.getClusterName(), getAbsolutePath(SLEEP_WORKFLOW), true, ""); http://git-wip-us.apache.org/repos/asf/falcon/blob/491cd8ea/webapp/src/test/java/org/apache/falcon/resource/EntityManagerJerseyIT.java ---------------------------------------------------------------------- diff --git a/webapp/src/test/java/org/apache/falcon/resource/EntityManagerJerseyIT.java b/webapp/src/test/java/org/apache/falcon/resource/EntityManagerJerseyIT.java index b6553e9..876ada5 100644 --- a/webapp/src/test/java/org/apache/falcon/resource/EntityManagerJerseyIT.java +++ b/webapp/src/test/java/org/apache/falcon/resource/EntityManagerJerseyIT.java @@ -17,10 +17,25 @@ */ package org.apache.falcon.resource; +import java.io.File; +import java.io.IOException; +import java.util.Calendar; +import java.util.Date; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.TimeZone; +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import java.util.regex.Pattern; +import javax.ws.rs.core.MediaType; + import com.sun.jersey.api.client.ClientResponse; import org.apache.commons.io.FileUtils; import org.apache.falcon.FalconException; -import org.apache.falcon.client.FalconCLIException; import org.apache.falcon.entity.v0.Entity; import org.apache.falcon.entity.v0.EntityType; import org.apache.falcon.entity.v0.feed.Cluster; @@ -51,22 +66,6 @@ import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; -import javax.ws.rs.core.MediaType; -import java.io.File; -import java.io.IOException; -import java.util.Calendar; -import java.util.Date; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.TimeZone; -import java.util.concurrent.Callable; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.Future; -import java.util.regex.Pattern; - /** * Test class for Entity REST APIs. * @@ -430,7 +429,7 @@ public class EntityManagerJerseyIT extends AbstractSchedulerManagerJerseyIT { submitCluster(context); } - public void testNotFoundStatus() throws FalconException, IOException, FalconCLIException { + public void testNotFoundStatus() throws FalconException, IOException { String feed1 = "f1" + System.currentTimeMillis(); try { falconUnitClient.getStatus(EntityType.FEED, feed1, null, null, false); @@ -440,7 +439,7 @@ public class EntityManagerJerseyIT extends AbstractSchedulerManagerJerseyIT { } } - public void testVersion() throws FalconException, IOException, FalconCLIException { + public void testVersion() throws FalconException, IOException { String json = falconUnitClient.getVersion(null); String buildVersion = BuildProperties.get().getProperty("build.version"); String deployMode = DeploymentProperties.get().getProperty("deploy.mode"); @@ -630,7 +629,7 @@ public class EntityManagerJerseyIT extends AbstractSchedulerManagerJerseyIT { Assert.assertEquals(feed.getName(), context.overlay.get("inputFeedName")); } - public void testInvalidGetEntityDefinition() throws FalconException, IOException, FalconCLIException { + public void testInvalidGetEntityDefinition() throws FalconException, IOException { try { falconUnitClient.getDefinition(EntityType.PROCESS.name(), "sample1", null); Assert.fail("Exception should be Thrown");
