You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@falcon.apache.org by sr...@apache.org on 2014/11/28 03:36:57 UTC
[1/2] incubator-falcon git commit: FALCON-807 Fix order of actual and
expected expression in assert statements in webapp module. Contributed by
Ajay Yadav
Repository: incubator-falcon
Updated Branches:
refs/heads/master cc9909ae5 -> 4e7a552dc
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/4e7a552d/webapp/src/test/java/org/apache/falcon/lifecycle/FileSystemFeedReplicationIT.java
----------------------------------------------------------------------
diff --git a/webapp/src/test/java/org/apache/falcon/lifecycle/FileSystemFeedReplicationIT.java b/webapp/src/test/java/org/apache/falcon/lifecycle/FileSystemFeedReplicationIT.java
index 92ff8ac..9383026 100644
--- a/webapp/src/test/java/org/apache/falcon/lifecycle/FileSystemFeedReplicationIT.java
+++ b/webapp/src/test/java/org/apache/falcon/lifecycle/FileSystemFeedReplicationIT.java
@@ -124,17 +124,17 @@ public class FileSystemFeedReplicationIT {
public void testFSReplicationSingleSourceToTarget() throws Exception {
final Map<String, String> overlay = sourceContext.getUniqueOverlay();
String filePath = TestContext.overlayParametersOverTemplate("/table/primary-cluster.xml", overlay);
- Assert.assertEquals(0, TestContext.executeWithURL("entity -submit -type cluster -file " + filePath));
+ Assert.assertEquals(TestContext.executeWithURL("entity -submit -type cluster -file " + filePath), 0);
filePath = TestContext.overlayParametersOverTemplate("/table/bcp-cluster.xml", overlay);
- Assert.assertEquals(0, TestContext.executeWithURL("entity -submit -type cluster -file " + filePath));
+ Assert.assertEquals(TestContext.executeWithURL("entity -submit -type cluster -file " + filePath), 0);
// verify if the partition on the source exists - precondition
FileSystem sourceFS = FileSystem.get(ClusterHelper.getConfiguration(sourceContext.getCluster().getCluster()));
Assert.assertTrue(sourceFS.exists(new Path(SOURCE_LOCATION + PARTITION_VALUE)));
filePath = TestContext.overlayParametersOverTemplate("/table/customer-fs-replicating-feed.xml", overlay);
- Assert.assertEquals(0, TestContext.executeWithURL("entity -submitAndSchedule -type feed -file " + filePath));
+ Assert.assertEquals(TestContext.executeWithURL("entity -submitAndSchedule -type feed -file " + filePath), 0);
// wait until the workflow job completes
final String feedName = "customer-fs-replicating-feed";
@@ -162,23 +162,23 @@ public class FileSystemFeedReplicationIT {
public void testFSReplicationSingleSourceToMultipleTargets() throws Exception {
final Map<String, String> overlay = sourceContext.getUniqueOverlay();
String filePath = TestContext.overlayParametersOverTemplate("/table/primary-cluster.xml", overlay);
- Assert.assertEquals(0, TestContext.executeWithURL("entity -submit -type cluster -file " + filePath));
+ Assert.assertEquals(TestContext.executeWithURL("entity -submit -type cluster -file " + filePath), 0);
filePath = TestContext.overlayParametersOverTemplate("/table/target-cluster-alpha.xml", overlay);
- Assert.assertEquals(0, TestContext.executeWithURL("entity -submit -type cluster -file " + filePath));
+ Assert.assertEquals(TestContext.executeWithURL("entity -submit -type cluster -file " + filePath), 0);
filePath = TestContext.overlayParametersOverTemplate("/table/target-cluster-beta.xml", overlay);
- Assert.assertEquals(0, TestContext.executeWithURL("entity -submit -type cluster -file " + filePath));
+ Assert.assertEquals(TestContext.executeWithURL("entity -submit -type cluster -file " + filePath), 0);
filePath = TestContext.overlayParametersOverTemplate("/table/target-cluster-gamma.xml", overlay);
- Assert.assertEquals(0, TestContext.executeWithURL("entity -submit -type cluster -file " + filePath));
+ Assert.assertEquals(TestContext.executeWithURL("entity -submit -type cluster -file " + filePath), 0);
// verify if the partition on the source exists - precondition
FileSystem sourceFS = FileSystem.get(ClusterHelper.getConfiguration(sourceContext.getCluster().getCluster()));
Assert.assertTrue(sourceFS.exists(new Path(SOURCE_LOCATION + PARTITION_VALUE)));
filePath = TestContext.overlayParametersOverTemplate("/table/multiple-targets-replicating-feed.xml", overlay);
- Assert.assertEquals(0, TestContext.executeWithURL("entity -submitAndSchedule -type feed -file " + filePath));
+ Assert.assertEquals(TestContext.executeWithURL("entity -submitAndSchedule -type feed -file " + filePath), 0);
// wait until the workflow job completes
final String feedName = "multiple-targets-replicating-feed";
@@ -227,19 +227,19 @@ public class FileSystemFeedReplicationIT {
final Map<String, String> overlay = sourceContext.getUniqueOverlay();
String filePath = TestContext.overlayParametersOverTemplate("/table/primary-cluster.xml", overlay);
- Assert.assertEquals(0, TestContext.executeWithURL("entity -submit -type cluster -file " + filePath));
+ Assert.assertEquals(TestContext.executeWithURL("entity -submit -type cluster -file " + filePath), 0);
filePath = TestContext.overlayParametersOverTemplate("/table/target-cluster-alpha.xml", overlay);
- Assert.assertEquals(0, TestContext.executeWithURL("entity -submit -type cluster -file " + filePath));
+ Assert.assertEquals(TestContext.executeWithURL("entity -submit -type cluster -file " + filePath), 0);
filePath = TestContext.overlayParametersOverTemplate("/table/target-cluster-beta.xml", overlay);
- Assert.assertEquals(0, TestContext.executeWithURL("entity -submit -type cluster -file " + filePath));
+ Assert.assertEquals(TestContext.executeWithURL("entity -submit -type cluster -file " + filePath), 0);
// verify if the partition on the source exists - precondition
Assert.assertTrue(sourceFS.exists(sourcePath));
filePath = TestContext.overlayParametersOverTemplate("/table/complex-replicating-feed.xml", overlay);
- Assert.assertEquals(0, TestContext.executeWithURL("entity -submitAndSchedule -type feed -file " + filePath));
+ Assert.assertEquals(TestContext.executeWithURL("entity -submitAndSchedule -type feed -file " + filePath), 0);
// wait until the workflow job completes
final String feedName = "complex-replicating-feed";
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/4e7a552d/webapp/src/test/java/org/apache/falcon/lifecycle/TableStorageFeedReplicationIT.java
----------------------------------------------------------------------
diff --git a/webapp/src/test/java/org/apache/falcon/lifecycle/TableStorageFeedReplicationIT.java b/webapp/src/test/java/org/apache/falcon/lifecycle/TableStorageFeedReplicationIT.java
index 219de3f..181ed05 100644
--- a/webapp/src/test/java/org/apache/falcon/lifecycle/TableStorageFeedReplicationIT.java
+++ b/webapp/src/test/java/org/apache/falcon/lifecycle/TableStorageFeedReplicationIT.java
@@ -145,17 +145,17 @@ public class TableStorageFeedReplicationIT {
final String feedName = "customer-table-replicating-feed";
final Map<String, String> overlay = sourceContext.getUniqueOverlay();
String filePath = TestContext.overlayParametersOverTemplate("/table/primary-cluster.xml", overlay);
- Assert.assertEquals(0, TestContext.executeWithURL("entity -submit -type cluster -file " + filePath));
+ Assert.assertEquals(TestContext.executeWithURL("entity -submit -type cluster -file " + filePath), 0);
filePath = TestContext.overlayParametersOverTemplate("/table/bcp-cluster.xml", overlay);
- Assert.assertEquals(0, TestContext.executeWithURL("entity -submit -type cluster -file " + filePath));
+ Assert.assertEquals(TestContext.executeWithURL("entity -submit -type cluster -file " + filePath), 0);
HCatPartition sourcePartition = HiveTestUtils.getPartition(
sourceMetastoreUrl, SOURCE_DATABASE_NAME, SOURCE_TABLE_NAME, "ds", PARTITION_VALUE);
Assert.assertNotNull(sourcePartition);
filePath = TestContext.overlayParametersOverTemplate("/table/customer-table-replicating-feed.xml", overlay);
- Assert.assertEquals(0, TestContext.executeWithURL("entity -submitAndSchedule -type feed -file " + filePath));
+ Assert.assertEquals(TestContext.executeWithURL("entity -submitAndSchedule -type feed -file " + filePath), 0);
// wait until the workflow job completes
WorkflowJob jobInfo = OozieTestUtils.getWorkflowJob(targetContext.getCluster().getCluster(),
@@ -183,10 +183,10 @@ public class TableStorageFeedReplicationIT {
final String feedName = "customer-table-replicating-feed";
final Map<String, String> overlay = sourceContext.getUniqueOverlay();
String filePath = TestContext.overlayParametersOverTemplate("/table/primary-cluster.xml", overlay);
- Assert.assertEquals(0, TestContext.executeWithURL("entity -submit -type cluster -file " + filePath));
+ Assert.assertEquals(TestContext.executeWithURL("entity -submit -type cluster -file " + filePath), 0);
filePath = TestContext.overlayParametersOverTemplate("/table/bcp-cluster.xml", overlay);
- Assert.assertEquals(0, TestContext.executeWithURL("entity -submit -type cluster -file " + filePath));
+ Assert.assertEquals(TestContext.executeWithURL("entity -submit -type cluster -file " + filePath), 0);
HCatPartition sourcePartition = HiveTestUtils.getPartition(
sourceMetastoreUrl, SOURCE_DATABASE_NAME, SOURCE_TABLE_NAME, "ds", PARTITION_VALUE);
@@ -200,7 +200,7 @@ public class TableStorageFeedReplicationIT {
Assert.assertNotNull(targetPartition);
filePath = TestContext.overlayParametersOverTemplate("/table/customer-table-replicating-feed.xml", overlay);
- Assert.assertEquals(0, TestContext.executeWithURL("entity -submitAndSchedule -type feed -file " + filePath));
+ Assert.assertEquals(TestContext.executeWithURL("entity -submitAndSchedule -type feed -file " + filePath), 0);
// wait until the workflow job completes
WorkflowJob jobInfo = OozieTestUtils.getWorkflowJob(targetContext.getCluster().getCluster(),
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/4e7a552d/webapp/src/test/java/org/apache/falcon/process/PigProcessIT.java
----------------------------------------------------------------------
diff --git a/webapp/src/test/java/org/apache/falcon/process/PigProcessIT.java b/webapp/src/test/java/org/apache/falcon/process/PigProcessIT.java
index 0f2a971..edbe32a 100644
--- a/webapp/src/test/java/org/apache/falcon/process/PigProcessIT.java
+++ b/webapp/src/test/java/org/apache/falcon/process/PigProcessIT.java
@@ -89,27 +89,24 @@ public class PigProcessIT {
overlay.put("cluster", "primary-cluster");
String filePath = TestContext.overlayParametersOverTemplate(TestContext.CLUSTER_TEMPLATE, overlay);
- Assert.assertEquals(0, TestContext.executeWithURL("entity -submit -type cluster -file " + filePath));
+ Assert.assertEquals(TestContext.executeWithURL("entity -submit -type cluster -file " + filePath), 0);
// context.setCluster(filePath);
filePath = TestContext.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE1, overlay);
- Assert.assertEquals(0,
- TestContext.executeWithURL("entity -submit -type feed -file " + filePath));
+ Assert.assertEquals(TestContext.executeWithURL("entity -submit -type feed -file " + filePath), 0);
filePath = TestContext.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE2, overlay);
- Assert.assertEquals(0,
- TestContext.executeWithURL("entity -submit -type feed -file " + filePath));
+ Assert.assertEquals(TestContext.executeWithURL("entity -submit -type feed -file " + filePath), 0);
final String pigProcessName = "pig-" + context.getProcessName();
overlay.put("processName", pigProcessName);
filePath = TestContext.overlayParametersOverTemplate(TestContext.PIG_PROCESS_TEMPLATE, overlay);
- Assert.assertEquals(0,
- TestContext.executeWithURL("entity -submitAndSchedule -type process -file " + filePath));
+ Assert.assertEquals(TestContext.executeWithURL("entity -submitAndSchedule -type process -file " + filePath), 0);
WorkflowJob jobInfo = OozieTestUtils.getWorkflowJob(context.getCluster().getCluster(),
OozieClient.FILTER_NAME + "=FALCON_PROCESS_DEFAULT_" + pigProcessName);
- Assert.assertEquals(WorkflowJob.Status.SUCCEEDED, jobInfo.getStatus());
+ Assert.assertEquals(jobInfo.getStatus(), WorkflowJob.Status.SUCCEEDED);
InstancesResult response = context.getService().path("api/instance/running/process/" + pigProcessName)
.header("Cookie", context.getAuthenticationToken())
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/4e7a552d/webapp/src/test/java/org/apache/falcon/process/TableStorageProcessIT.java
----------------------------------------------------------------------
diff --git a/webapp/src/test/java/org/apache/falcon/process/TableStorageProcessIT.java b/webapp/src/test/java/org/apache/falcon/process/TableStorageProcessIT.java
index 51afbb8..b27b692 100644
--- a/webapp/src/test/java/org/apache/falcon/process/TableStorageProcessIT.java
+++ b/webapp/src/test/java/org/apache/falcon/process/TableStorageProcessIT.java
@@ -118,15 +118,13 @@ public class TableStorageProcessIT {
overlay.put("cluster", "primary-cluster");
String filePath = TestContext.overlayParametersOverTemplate(CLUSTER_TEMPLATE, overlay);
- Assert.assertEquals(0, TestContext.executeWithURL("entity -submit -type cluster -file " + filePath));
+ Assert.assertEquals(TestContext.executeWithURL("entity -submit -type cluster -file " + filePath), 0);
filePath = TestContext.overlayParametersOverTemplate("/table/table-feed-input.xml", overlay);
- Assert.assertEquals(0,
- TestContext.executeWithURL("entity -submitAndSchedule -type feed -file " + filePath));
+ Assert.assertEquals(TestContext.executeWithURL("entity -submitAndSchedule -type feed -file " + filePath), 0);
filePath = TestContext.overlayParametersOverTemplate("/table/table-feed-output.xml", overlay);
- Assert.assertEquals(0,
- TestContext.executeWithURL("entity -submitAndSchedule -type feed -file " + filePath));
+ Assert.assertEquals(TestContext.executeWithURL("entity -submitAndSchedule -type feed -file " + filePath), 0);
}
@AfterClass
@@ -162,8 +160,7 @@ public class TableStorageProcessIT {
overlay.put("processName", pigProcessName);
String filePath = TestContext.overlayParametersOverTemplate("/table/pig-process-tables.xml", overlay);
- Assert.assertEquals(0,
- TestContext.executeWithURL("entity -submitAndSchedule -type process -file " + filePath));
+ Assert.assertEquals(TestContext.executeWithURL("entity -submitAndSchedule -type process -file " + filePath), 0);
WorkflowJob jobInfo = OozieTestUtils.getWorkflowJob(context.getCluster().getCluster(),
OozieClient.FILTER_NAME + "=FALCON_PROCESS_DEFAULT_" + pigProcessName);
@@ -189,8 +186,7 @@ public class TableStorageProcessIT {
overlay.put("processName", hiveProcessName);
String filePath = TestContext.overlayParametersOverTemplate("/table/hive-process-template.xml", overlay);
- Assert.assertEquals(0,
- TestContext.executeWithURL("entity -submitAndSchedule -type process -file " + filePath));
+ Assert.assertEquals(TestContext.executeWithURL("entity -submitAndSchedule -type process -file " + filePath), 0);
WorkflowJob jobInfo = OozieTestUtils.getWorkflowJob(context.getCluster().getCluster(),
OozieClient.FILTER_NAME + "=FALCON_PROCESS_DEFAULT_" + hiveProcessName);
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/4e7a552d/webapp/src/test/java/org/apache/falcon/resource/ProcessInstanceManagerIT.java
----------------------------------------------------------------------
diff --git a/webapp/src/test/java/org/apache/falcon/resource/ProcessInstanceManagerIT.java b/webapp/src/test/java/org/apache/falcon/resource/ProcessInstanceManagerIT.java
index 863b109..6e58064 100644
--- a/webapp/src/test/java/org/apache/falcon/resource/ProcessInstanceManagerIT.java
+++ b/webapp/src/test/java/org/apache/falcon/resource/ProcessInstanceManagerIT.java
@@ -63,9 +63,9 @@ public class ProcessInstanceManagerIT {
.header("Cookie", context.getAuthenticationToken())
.accept(MediaType.APPLICATION_JSON)
.get(InstancesResult.class);
- Assert.assertEquals(APIResult.Status.SUCCEEDED, response.getStatus());
+ Assert.assertEquals(response.getStatus(), APIResult.Status.SUCCEEDED);
Assert.assertNotNull(response.getInstances());
- Assert.assertEquals(1, response.getInstances().length);
+ Assert.assertEquals(response.getInstances().length, 1);
assertInstance(response.getInstances()[0], START_INSTANCE, WorkflowStatus.RUNNING);
}
@@ -77,7 +77,7 @@ public class ProcessInstanceManagerIT {
.header("Cookie", context.getAuthenticationToken())
.accept(MediaType.APPLICATION_JSON)
.get(InstancesResult.class);
- Assert.assertEquals(APIResult.Status.SUCCEEDED, response.getStatus());
+ Assert.assertEquals(response.getStatus(), APIResult.Status.SUCCEEDED);
Assert.assertNotNull(response.getInstances());
assertInstance(response.getInstances()[0], START_INSTANCE, WorkflowStatus.RUNNING);
@@ -87,9 +87,9 @@ public class ProcessInstanceManagerIT {
.header("Cookie", context.getAuthenticationToken())
.accept(MediaType.APPLICATION_JSON)
.get(InstancesResult.class);
- Assert.assertEquals(APIResult.Status.SUCCEEDED, response.getStatus());
+ Assert.assertEquals(response.getStatus(), APIResult.Status.SUCCEEDED);
Assert.assertNotNull(response.getInstances());
- Assert.assertEquals(1, response.getInstances().length);
+ Assert.assertEquals(response.getInstances().length, 1);
assertInstance(response.getInstances()[0], START_INSTANCE, WorkflowStatus.RUNNING);
}
@@ -109,9 +109,9 @@ public class ProcessInstanceManagerIT {
.header("Cookie", context.getAuthenticationToken())
.accept(MediaType.APPLICATION_JSON)
.get(InstancesResult.class);
- Assert.assertEquals(APIResult.Status.SUCCEEDED, response.getStatus());
+ Assert.assertEquals(response.getStatus(), APIResult.Status.SUCCEEDED);
Assert.assertNotNull(response.getInstances());
- Assert.assertEquals(1, response.getInstances().length);
+ Assert.assertEquals(response.getInstances().length, 1);
assertInstance(response.getInstances()[0], START_INSTANCE, WorkflowStatus.RUNNING);
}
@@ -127,9 +127,9 @@ public class ProcessInstanceManagerIT {
.header("Cookie", context.getAuthenticationToken())
.accept(MediaType.APPLICATION_JSON)
.get(InstancesResult.class);
- Assert.assertEquals(APIResult.Status.SUCCEEDED, response.getStatus());
+ Assert.assertEquals(response.getStatus(), APIResult.Status.SUCCEEDED);
Assert.assertNotNull(response.getInstances());
- Assert.assertEquals(1, response.getInstances().length);
+ Assert.assertEquals(response.getInstances().length, 1);
assertInstance(response.getInstances()[0], START_INSTANCE, WorkflowStatus.RUNNING);
}
@@ -142,9 +142,9 @@ public class ProcessInstanceManagerIT {
.accept(MediaType.APPLICATION_JSON)
.post(InstancesResult.class);
- Assert.assertEquals(APIResult.Status.SUCCEEDED, response.getStatus());
+ Assert.assertEquals(response.getStatus(), APIResult.Status.SUCCEEDED);
Assert.assertNotNull(response.getInstances());
- Assert.assertEquals(1, response.getInstances().length);
+ Assert.assertEquals(response.getInstances().length, 1);
assertInstance(response.getInstances()[0], START_INSTANCE, WorkflowStatus.RUNNING);
waitForWorkflow(START_INSTANCE, WorkflowJob.Status.RUNNING);
@@ -158,9 +158,9 @@ public class ProcessInstanceManagerIT {
.header("Cookie", context.getAuthenticationToken())
.accept(MediaType.APPLICATION_JSON)
.post(InstancesResult.class);
- Assert.assertEquals(APIResult.Status.SUCCEEDED, response.getStatus());
+ Assert.assertEquals(response.getStatus(), APIResult.Status.SUCCEEDED);
Assert.assertNotNull(response.getInstances());
- Assert.assertEquals(1, response.getInstances().length);
+ Assert.assertEquals(response.getInstances().length, 1);
assertInstance(response.getInstances()[0], START_INSTANCE, WorkflowStatus.KILLED);
response = context.service.path("api/instance/status/process/" + context.processName)
@@ -169,9 +169,9 @@ public class ProcessInstanceManagerIT {
.header("Cookie", context.getAuthenticationToken())
.accept(MediaType.APPLICATION_JSON)
.get(InstancesResult.class);
- Assert.assertEquals(APIResult.Status.SUCCEEDED, response.getStatus());
+ Assert.assertEquals(response.getStatus(), APIResult.Status.SUCCEEDED);
Assert.assertNotNull(response.getInstances());
- Assert.assertEquals(1, response.getInstances().length);
+ Assert.assertEquals(response.getInstances().length, 1);
assertInstance(response.getInstances()[0], START_INSTANCE, WorkflowStatus.KILLED);
response = context.service.path("api/instance/status/process/" + context.processName)
@@ -180,9 +180,9 @@ public class ProcessInstanceManagerIT {
.header("Cookie", context.getAuthenticationToken())
.accept(MediaType.APPLICATION_JSON)
.get(InstancesResult.class);
- Assert.assertEquals(APIResult.Status.SUCCEEDED, response.getStatus());
+ Assert.assertEquals(response.getStatus(), APIResult.Status.SUCCEEDED);
Assert.assertNotNull(response.getInstances());
- Assert.assertEquals(1, response.getInstances().length);
+ Assert.assertEquals(response.getInstances().length, 1);
assertInstance(response.getInstances()[0], START_INSTANCE, WorkflowStatus.KILLED);
waitForWorkflow(START_INSTANCE, WorkflowJob.Status.KILLED);
@@ -196,9 +196,9 @@ public class ProcessInstanceManagerIT {
.header("Cookie", context.getAuthenticationToken())
.accept(MediaType.APPLICATION_JSON)
.post(InstancesResult.class);
- Assert.assertEquals(APIResult.Status.SUCCEEDED, response.getStatus());
+ Assert.assertEquals(response.getStatus(), APIResult.Status.SUCCEEDED);
Assert.assertNotNull(response.getInstances());
- Assert.assertEquals(1, response.getInstances().length);
+ Assert.assertEquals(response.getInstances().length, 1);
assertInstance(response.getInstances()[0], START_INSTANCE, WorkflowStatus.SUSPENDED);
waitForWorkflow(START_INSTANCE, WorkflowJob.Status.SUSPENDED);
@@ -213,9 +213,9 @@ public class ProcessInstanceManagerIT {
.header("Cookie", context.getAuthenticationToken())
.accept(MediaType.APPLICATION_JSON)
.post(InstancesResult.class);
- Assert.assertEquals(APIResult.Status.SUCCEEDED, response.getStatus());
+ Assert.assertEquals(response.getStatus(), APIResult.Status.SUCCEEDED);
Assert.assertNotNull(response.getInstances());
- Assert.assertEquals(1, response.getInstances().length);
+ Assert.assertEquals(response.getInstances().length, 1);
assertInstance(response.getInstances()[0], START_INSTANCE, WorkflowStatus.RUNNING);
waitForWorkflow(START_INSTANCE, WorkflowJob.Status.RUNNING);
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/4e7a552d/webapp/src/test/java/org/apache/falcon/util/ResourcesReflectionUtilTest.java
----------------------------------------------------------------------
diff --git a/webapp/src/test/java/org/apache/falcon/util/ResourcesReflectionUtilTest.java b/webapp/src/test/java/org/apache/falcon/util/ResourcesReflectionUtilTest.java
index bd63a07..d3653df 100644
--- a/webapp/src/test/java/org/apache/falcon/util/ResourcesReflectionUtilTest.java
+++ b/webapp/src/test/java/org/apache/falcon/util/ResourcesReflectionUtilTest.java
@@ -45,9 +45,8 @@ public class ResourcesReflectionUtilTest {
Assert.assertEquals("wf-instance-failed",
ResourcesReflectionUtil.getResourceMonitorName("GenericAlert.instrumentFailedInstance"));
- Assert.assertEquals(new Integer(11),
- ResourcesReflectionUtil.getResourceTimeTakenName("GenericAlert.instrumentFailedInstance"));
- Assert.assertEquals(null,
- ResourcesReflectionUtil.getResourceTimeTakenName("GenericAlert.alertLateRerunFailed"));
+ Assert.assertEquals(ResourcesReflectionUtil.getResourceTimeTakenName("GenericAlert.instrumentFailedInstance"),
+ new Integer(11));
+ Assert.assertNull(ResourcesReflectionUtil.getResourceTimeTakenName("GenericAlert.alertLateRerunFailed"));
}
}
[2/2] incubator-falcon git commit: FALCON-807 Fix order of actual and
expected expression in assert statements in webapp module. Contributed by
Ajay Yadav
Posted by sr...@apache.org.
FALCON-807 Fix order of actual and expected expression in assert statements in webapp module. Contributed by Ajay Yadav
Project: http://git-wip-us.apache.org/repos/asf/incubator-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-falcon/commit/4e7a552d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-falcon/tree/4e7a552d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-falcon/diff/4e7a552d
Branch: refs/heads/master
Commit: 4e7a552dcb3cb737f352bdfef0ab4b24f9b6e31c
Parents: cc9909a
Author: srikanth.sundarrajan <sr...@apache.org>
Authored: Fri Nov 28 08:05:08 2014 +0530
Committer: srikanth.sundarrajan <sr...@apache.org>
Committed: Fri Nov 28 08:05:08 2014 +0530
----------------------------------------------------------------------
CHANGES.txt | 10 +-
.../falcon/catalog/HiveCatalogServiceIT.java | 2 +-
.../java/org/apache/falcon/cli/FalconCLIIT.java | 871 +++++++------------
.../org/apache/falcon/cli/FalconCLISmokeIT.java | 53 +-
.../apache/falcon/late/LateDataHandlerIT.java | 4 +-
.../lifecycle/FileSystemFeedReplicationIT.java | 24 +-
.../TableStorageFeedReplicationIT.java | 12 +-
.../org/apache/falcon/process/PigProcessIT.java | 13 +-
.../falcon/process/TableStorageProcessIT.java | 14 +-
.../resource/ProcessInstanceManagerIT.java | 42 +-
.../util/ResourcesReflectionUtilTest.java | 7 +-
11 files changed, 408 insertions(+), 644 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/4e7a552d/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 79e498f..c9fda80 100755
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -7,8 +7,14 @@ Trunk (Unreleased)
NEW FEATURES
IMPROVEMENTS
- FALCON-784 Update release notes in CHANGES.txt in branch and trunk (Venkatesh Seetharam)
- FALCON-782 Update trunk version to 0.7-incubating-SNAPSHOT (Venkatesh Seetharam)
+ FALCON-784 Update release notes in CHANGES.txt in branch and trunk
+ (Venkatesh Seetharam)
+
+ FALCON-782 Update trunk version to 0.7-incubating-SNAPSHOT (Venkatesh
+ Seetharam)
+
+ FALCON-807 Fix order of actual and expected expression in assert
+ statements in webapp module (Ajay Yadav via Srikanth Sundarrajan)
OPTIMIZATIONS
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/4e7a552d/webapp/src/test/java/org/apache/falcon/catalog/HiveCatalogServiceIT.java
----------------------------------------------------------------------
diff --git a/webapp/src/test/java/org/apache/falcon/catalog/HiveCatalogServiceIT.java b/webapp/src/test/java/org/apache/falcon/catalog/HiveCatalogServiceIT.java
index 87101c5..fcf7f96 100644
--- a/webapp/src/test/java/org/apache/falcon/catalog/HiveCatalogServiceIT.java
+++ b/webapp/src/test/java/org/apache/falcon/catalog/HiveCatalogServiceIT.java
@@ -279,7 +279,7 @@ public class HiveCatalogServiceIT {
conf, METASTORE_URL, DATABASE_NAME, TABLE_NAME, partialPartitionSpec));
List<HCatPartition> partitions = client.getPartitions(DATABASE_NAME, TABLE_NAME);
- Assert.assertEquals(1, partitions.size(), "Unexpected number of partitions");
+ Assert.assertEquals(partitions.size(), 1, "Unexpected number of partitions");
Assert.assertEquals(new String[]{"20130902", "in"},
partitions.get(0).getValues().toArray(), "Mismatched partition");
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/4e7a552d/webapp/src/test/java/org/apache/falcon/cli/FalconCLIIT.java
----------------------------------------------------------------------
diff --git a/webapp/src/test/java/org/apache/falcon/cli/FalconCLIIT.java b/webapp/src/test/java/org/apache/falcon/cli/FalconCLIIT.java
index 0bcb525..a3acbdb 100644
--- a/webapp/src/test/java/org/apache/falcon/cli/FalconCLIIT.java
+++ b/webapp/src/test/java/org/apache/falcon/cli/FalconCLIIT.java
@@ -63,33 +63,27 @@ public class FalconCLIIT {
Map<String, String> overlay = context.getUniqueOverlay();
filePath = TestContext.overlayParametersOverTemplate(TestContext.CLUSTER_TEMPLATE, overlay);
- Assert.assertEquals(
- 0,
- executeWithURL("entity -submit -type cluster -file " + filePath));
+ Assert.assertEquals(executeWithURL("entity -submit -type cluster -file " + filePath), 0);
context.setCluster(overlay.get("cluster"));
Assert.assertEquals(stream.buffer.toString().trim(),
"falcon/default/Submit successful (cluster) " + context.getClusterName());
filePath = TestContext.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE1, overlay);
- Assert.assertEquals(0,
- executeWithURL("entity -submit -type feed -file " + filePath));
+ Assert.assertEquals(executeWithURL("entity -submit -type feed -file " + filePath), 0);
Assert.assertEquals(
stream.buffer.toString().trim(),
"falcon/default/Submit successful (feed) "
+ overlay.get("inputFeedName"));
filePath = TestContext.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE2, overlay);
- Assert.assertEquals(0,
- executeWithURL("entity -submit -type feed -file " + filePath));
+ Assert.assertEquals(executeWithURL("entity -submit -type feed -file " + filePath), 0);
Assert.assertEquals(
stream.buffer.toString().trim(),
"falcon/default/Submit successful (feed) "
+ overlay.get("outputFeedName"));
filePath = TestContext.overlayParametersOverTemplate(TestContext.PROCESS_TEMPLATE, overlay);
- Assert.assertEquals(
- 0,
- executeWithURL("entity -submit -type process -file " + filePath));
+ Assert.assertEquals(executeWithURL("entity -submit -type process -file " + filePath), 0);
Assert.assertEquals(
stream.buffer.toString().trim(),
"falcon/default/Submit successful (process) "
@@ -97,9 +91,7 @@ public class FalconCLIIT {
}
public void testListWithEmptyConfigStore() throws Exception {
- Assert.assertEquals(
- 0,
- executeWithURL("entity -list -type process "));
+ Assert.assertEquals(executeWithURL("entity -list -type process "), 0);
}
public void testSubmitAndScheduleEntityValidCommands() throws Exception {
@@ -109,35 +101,24 @@ public class FalconCLIIT {
Map<String, String> overlay = context.getUniqueOverlay();
filePath = TestContext.overlayParametersOverTemplate(context.getClusterFileTemplate(), overlay);
- Assert.assertEquals(-1,
- executeWithURL("entity -submitAndSchedule -type cluster -file "
- + filePath));
+ Assert.assertEquals(executeWithURL("entity -submitAndSchedule -type cluster -file " + filePath), -1);
context.setCluster(overlay.get("cluster"));
filePath = TestContext.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE1, overlay);
- Assert.assertEquals(0,
- executeWithURL("entity -submitAndSchedule -type feed -file "
- + filePath));
+ Assert.assertEquals(executeWithURL("entity -submitAndSchedule -type feed -file " + filePath), 0);
filePath = TestContext.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE2, overlay);
- Assert.assertEquals(0,
- executeWithURL("entity -submitAndSchedule -type feed -file "
- + filePath));
+ Assert.assertEquals(executeWithURL("entity -submitAndSchedule -type feed -file " + filePath), 0);
filePath = TestContext.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE1, overlay);
- Assert.assertEquals(0,
- executeWithURL("entity -submit -type feed -file " + filePath));
+ Assert.assertEquals(executeWithURL("entity -submit -type feed -file " + filePath), 0);
filePath = TestContext.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE2, overlay);
- Assert.assertEquals(0,
- executeWithURL("entity -submit -type feed -file " + filePath));
+ Assert.assertEquals(executeWithURL("entity -submit -type feed -file " + filePath), 0);
filePath = TestContext.overlayParametersOverTemplate(TestContext.PROCESS_TEMPLATE, overlay);
- Assert.assertEquals(0,
- executeWithURL("entity -submitAndSchedule -type process -file "
- + filePath));
+ Assert.assertEquals(executeWithURL("entity -submitAndSchedule -type process -file " + filePath), 0);
- Assert.assertEquals(0,
- executeWithURL("entity -update -name " + overlay.get("processName") + " -type process -file "
- + filePath + " -effective 2025-04-20T00:00Z"));
+ Assert.assertEquals(executeWithURL("entity -update -name " + overlay.get("processName")
+ + " -type process -file " + filePath + " -effective 2025-04-20T00:00Z"), 0);
}
public void testValidateValidCommands() throws Exception {
@@ -147,35 +128,23 @@ public class FalconCLIIT {
Map<String, String> overlay = context.getUniqueOverlay();
filePath = TestContext.overlayParametersOverTemplate(context.getClusterFileTemplate(), overlay);
- Assert.assertEquals(0,
- executeWithURL("entity -validate -type cluster -file "
- + filePath));
+ Assert.assertEquals(executeWithURL("entity -validate -type cluster -file " + filePath), 0);
context.setCluster(overlay.get("cluster"));
- Assert.assertEquals(
- 0,
- executeWithURL("entity -submit -type cluster -file " + filePath));
+ Assert.assertEquals(executeWithURL("entity -submit -type cluster -file " + filePath), 0);
context.setCluster(overlay.get("cluster"));
filePath = TestContext.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE1, overlay);
- Assert.assertEquals(0,
- executeWithURL("entity -validate -type feed -file " + filePath));
- Assert.assertEquals(0,
- executeWithURL("entity -submit -type feed -file " + filePath));
+ Assert.assertEquals(executeWithURL("entity -validate -type feed -file " + filePath), 0);
+ Assert.assertEquals(executeWithURL("entity -submit -type feed -file " + filePath), 0);
filePath = TestContext.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE2, overlay);
- Assert.assertEquals(0,
- executeWithURL("entity -validate -type feed -file " + filePath));
- Assert.assertEquals(0,
- executeWithURL("entity -submit -type feed -file " + filePath));
+ Assert.assertEquals(executeWithURL("entity -validate -type feed -file " + filePath), 0);
+ Assert.assertEquals(executeWithURL("entity -submit -type feed -file " + filePath), 0);
filePath = TestContext.overlayParametersOverTemplate(TestContext.PROCESS_TEMPLATE, overlay);
- Assert.assertEquals(0,
- executeWithURL("entity -validate -type process -file "
- + filePath));
+ Assert.assertEquals(executeWithURL("entity -validate -type process -file " + filePath), 0);
- Assert.assertEquals(
- 0,
- executeWithURL("entity -submit -type process -file " + filePath));
+ Assert.assertEquals(executeWithURL("entity -submit -type process -file " + filePath), 0);
}
public void testDefinitionEntityValidCommands() throws Exception {
@@ -183,23 +152,13 @@ public class FalconCLIIT {
Map<String, String> overlay = context.getUniqueOverlay();
submitTestFiles(context, overlay);
- Assert.assertEquals(0,
- executeWithURL("entity -definition -type cluster -name "
- + overlay.get("cluster")));
+ Assert.assertEquals(executeWithURL("entity -definition -type cluster -name " + overlay.get("cluster")), 0);
- Assert.assertEquals(
- 0,
- executeWithURL("entity -definition -type feed -name "
- + overlay.get("inputFeedName")));
+ Assert.assertEquals(executeWithURL("entity -definition -type feed -name " + overlay.get("inputFeedName")), 0);
- Assert.assertEquals(
- 0,
- executeWithURL("entity -definition -type feed -name "
- + overlay.get("outputFeedName")));
+ Assert.assertEquals(executeWithURL("entity -definition -type feed -name " + overlay.get("outputFeedName")), 0);
- Assert.assertEquals(0,
- executeWithURL("entity -definition -type process -name "
- + overlay.get("processName")));
+ Assert.assertEquals(executeWithURL("entity -definition -type process -name " + overlay.get("processName")), 0);
}
@@ -209,18 +168,11 @@ public class FalconCLIIT {
Map<String, String> overlay = context.getUniqueOverlay();
submitTestFiles(context, overlay);
- Assert.assertEquals(-1,
- executeWithURL("entity -schedule -type cluster -name "
- + overlay.get("cluster")));
+ Assert.assertEquals(executeWithURL("entity -schedule -type cluster -name " + overlay.get("cluster")), -1);
- Assert.assertEquals(
- 0,
- executeWithURL("entity -schedule -type feed -name "
- + overlay.get("outputFeedName")));
+ Assert.assertEquals(executeWithURL("entity -schedule -type feed -name " + overlay.get("outputFeedName")), 0);
- Assert.assertEquals(0,
- executeWithURL("entity -schedule -type process -name "
- + overlay.get("processName")));
+ Assert.assertEquals(executeWithURL("entity -schedule -type process -name " + overlay.get("processName")), 0);
}
@@ -230,94 +182,56 @@ public class FalconCLIIT {
Map<String, String> overlay = context.getUniqueOverlay();
submitTestFiles(context, overlay);
- Assert.assertEquals(
- 0,
- executeWithURL("entity -status -type feed -name "
- + overlay.get("outputFeedName")));
+ Assert.assertEquals(executeWithURL("entity -status -type feed -name " + overlay.get("outputFeedName")), 0);
- Assert.assertEquals(
- 0,
- executeWithURL("entity -status -type process -name "
- + overlay.get("processName")));
+ Assert.assertEquals(executeWithURL("entity -status -type process -name " + overlay.get("processName")), 0);
- Assert.assertEquals(
- 0,
- executeWithURL("entity -schedule -type feed -name "
- + overlay.get("outputFeedName")));
+ Assert.assertEquals(executeWithURL("entity -schedule -type feed -name " + overlay.get("outputFeedName")), 0);
- Assert.assertEquals(0,
- executeWithURL("entity -schedule -type process -name "
- + overlay.get("processName")));
+ Assert.assertEquals(executeWithURL("entity -schedule -type process -name " + overlay.get("processName")), 0);
OozieTestUtils.waitForProcessWFtoStart(context);
- Assert.assertEquals(
- 0,
- executeWithURL("entity -suspend -type feed -name "
- + overlay.get("outputFeedName")));
+ Assert.assertEquals(executeWithURL("entity -suspend -type feed -name " + overlay.get("outputFeedName")), 0);
- Assert.assertEquals(
- 0,
- executeWithURL("entity -suspend -type process -name "
- + overlay.get("processName")));
+ Assert.assertEquals(executeWithURL("entity -suspend -type process -name " + overlay.get("processName")), 0);
- Assert.assertEquals(
- 0,
- executeWithURL("entity -status -type feed -name "
- + overlay.get("outputFeedName")));
+ Assert.assertEquals(executeWithURL("entity -status -type feed -name " + overlay.get("outputFeedName")), 0);
- Assert.assertEquals(
- 0,
- executeWithURL("entity -status -type process -name "
- + overlay.get("processName")));
+ Assert.assertEquals(executeWithURL("entity -status -type process -name " + overlay.get("processName")), 0);
- Assert.assertEquals(
- 0,
- executeWithURL("entity -resume -type feed -name "
- + overlay.get("outputFeedName")));
+ Assert.assertEquals(executeWithURL("entity -resume -type feed -name " + overlay.get("outputFeedName")), 0);
- Assert.assertEquals(
- 0,
- executeWithURL("entity -resume -type process -name "
- + overlay.get("processName")));
+ Assert.assertEquals(executeWithURL("entity -resume -type process -name " + overlay.get("processName")), 0);
- Assert.assertEquals(
- 0,
- executeWithURL("entity -status -type feed -name "
- + overlay.get("outputFeedName")));
+ Assert.assertEquals(executeWithURL("entity -status -type feed -name " + overlay.get("outputFeedName")), 0);
- Assert.assertEquals(
- 0,
- executeWithURL("entity -status -type process -name "
- + overlay.get("processName")));
+ Assert.assertEquals(executeWithURL("entity -status -type process -name " + overlay.get("processName")), 0);
- Assert.assertEquals(0,
- executeWithURL("entity -summary -type feed -cluster "+ overlay.get("cluster")
+ Assert.assertEquals(executeWithURL("entity -summary -type feed -cluster "+ overlay.get("cluster")
+ " -fields status,tags -start " + START_INSTANCE
+ " -filterBy TYPE:FEED -orderBy name -sortOrder asc "
- + " -offset 0 -numResults 1 -numInstances 5"));
- Assert.assertEquals(0,
- executeWithURL("entity -summary -type process -fields status,pipelines"
+ + " -offset 0 -numResults 1 -numInstances 5"), 0);
+
+ Assert.assertEquals(executeWithURL("entity -summary -type process -fields status,pipelines"
+ " -cluster " + overlay.get("cluster")
+ " -start " + SchemaHelper.getDateFormat().format(new Date(0))
+ " -end " + SchemaHelper.getDateFormat().format(new Date())
+ " -filterBy TYPE:PROCESS -orderBy name -sortOrder desc "
- + " -offset 0 -numResults 1 -numInstances 7"));
+ + " -offset 0 -numResults 1 -numInstances 7"), 0);
- Assert.assertEquals(-1,
- executeWithURL("entity -summary -type process -fields status,pipelines"
+ Assert.assertEquals(executeWithURL("entity -summary -type process -fields status,pipelines"
+ " -cluster " + overlay.get("cluster")
+ " -start " + SchemaHelper.getDateFormat().format(new Date(0))
+ " -end " + SchemaHelper.getDateFormat().format(new Date())
+ " -filterBy TYPE:PROCESS -orderBy name -sortOrder invalid "
- + " -offset 0 -numResults 1 -numInstances 7"));
+ + " -offset 0 -numResults 1 -numInstances 7"), -1);
// No start or end date
- Assert.assertEquals(0,
- executeWithURL("entity -summary -type process -fields status,pipelines"
- + " -cluster " + overlay.get("cluster")
- + " -filterBy TYPE:PROCESS -orderBy name "
- + " -offset 0 -numResults 1 -numInstances 7"));
+ Assert.assertEquals(executeWithURL("entity -summary -type process -fields status,pipelines"
+ + " -cluster " + overlay.get("cluster")
+ + " -filterBy TYPE:PROCESS -orderBy name "
+ + " -offset 0 -numResults 1 -numInstances 7"), 0);
}
@@ -331,35 +245,17 @@ public class FalconCLIIT {
Map<String, String> overlay = context.getUniqueOverlay();
submitTestFiles(context, overlay);
- Assert.assertEquals(
- -1,
- executeWithURL("entity -delete -type cluster -name "
- + overlay.get("cluster")));
+ Assert.assertEquals(executeWithURL("entity -delete -type cluster -name " + overlay.get("cluster")), -1);
- Assert.assertEquals(
- -1,
- executeWithURL("entity -delete -type feed -name "
- + overlay.get("inputFeedName")));
+ Assert.assertEquals(executeWithURL("entity -delete -type feed -name " + overlay.get("inputFeedName")), -1);
- Assert.assertEquals(
- -1,
- executeWithURL("entity -delete -type feed -name "
- + overlay.get("outputFeedName")));
+ Assert.assertEquals(executeWithURL("entity -delete -type feed -name " + overlay.get("outputFeedName")), -1);
- Assert.assertEquals(
- 0,
- executeWithURL("entity -delete -type process -name "
- + overlay.get("processName")));
+ Assert.assertEquals(executeWithURL("entity -delete -type process -name " + overlay.get("processName")), 0);
- Assert.assertEquals(
- 0,
- executeWithURL("entity -delete -type feed -name "
- + overlay.get("inputFeedName")));
+ Assert.assertEquals(executeWithURL("entity -delete -type feed -name " + overlay.get("inputFeedName")), 0);
- Assert.assertEquals(
- 0,
- executeWithURL("entity -delete -type feed -name "
- + overlay.get("outputFeedName")));
+ Assert.assertEquals(executeWithURL("entity -delete -type feed -name " + overlay.get("outputFeedName")), 0);
}
@@ -368,11 +264,9 @@ public class FalconCLIIT {
TestContext context = new TestContext();
Map<String, String> overlay = context.getUniqueOverlay();
TestContext.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE1, overlay);
- Assert.assertEquals(-1,
- executeWithURL("entity -submit -type feed -name " + "name"));
+ Assert.assertEquals(executeWithURL("entity -submit -type feed -name " + "name"), -1);
- Assert.assertEquals(-1,
- executeWithURL("entity -schedule -type feed -file " + "name"));
+ Assert.assertEquals(executeWithURL("entity -schedule -type feed -file " + "name"), -1);
}
public void testInstanceRunningAndStatusCommands() throws Exception {
@@ -380,146 +274,127 @@ public class FalconCLIIT {
Map<String, String> overlay = context.getUniqueOverlay();
submitTestFiles(context, overlay);
- Assert.assertEquals(0,
- executeWithURL("entity -schedule -type process -name "
- + overlay.get("processName")));
+ Assert.assertEquals(executeWithURL("entity -schedule -type process -name " + overlay.get("processName")), 0);
- Assert.assertEquals(0,
- executeWithURL("entity -schedule -type feed -name "
- + overlay.get("outputFeedName")));
+ Assert.assertEquals(executeWithURL("entity -schedule -type feed -name " + overlay.get("outputFeedName")), 0);
OozieTestUtils.waitForProcessWFtoStart(context);
- Assert.assertEquals(0,
- executeWithURL("instance -status -type feed -name "
- + overlay.get("outputFeedName")
- + " -start " + START_INSTANCE));
+ Assert.assertEquals(executeWithURL("instance -status -type feed -name "
+ + overlay.get("outputFeedName")
+ + " -start " + START_INSTANCE), 0);
- Assert.assertEquals(0,
- executeWithURL("instance -running -type process -name "
- + overlay.get("processName")));
+ Assert.assertEquals(executeWithURL("instance -running -type process -name " + overlay.get("processName")), 0);
- Assert.assertEquals(0,
- executeWithURL("instance -running -type feed -lifecycle eviction -name "
- + overlay.get("outputFeedName")
- + " -start " + SchemaHelper.getDateFormat().format(new Date())));
+ Assert.assertEquals(executeWithURL("instance -running -type feed -lifecycle eviction -name "
+ + overlay.get("outputFeedName")
+ + " -start " + SchemaHelper.getDateFormat().format(new Date())), 0);
- Assert.assertEquals(0,
- executeWithURL("instance -listing -type feed -name "
- + overlay.get("outputFeedName")
- + " -start " + SchemaHelper.getDateFormat().format(new Date())));
+ Assert.assertEquals(executeWithURL("instance -listing -type feed -name "
+ + overlay.get("outputFeedName")
+ + " -start " + SchemaHelper.getDateFormat().format(new Date())), 0);
- Assert.assertEquals(0,
- executeWithURL("instance -status -type process -name "
- + overlay.get("processName")
- + " -start " + START_INSTANCE));
- Assert.assertEquals(0,
- executeWithURL("instance -status -type feed -lifecycle eviction,replication -name "
- + overlay.get("outputFeedName")
- + " -start "+ SchemaHelper.getDateFormat().format(new Date())));
+ Assert.assertEquals(executeWithURL("instance -status -type process -name "
+ + overlay.get("processName")
+ + " -start " + START_INSTANCE), 0);
- Assert.assertEquals(0,
- executeWithURL("instance -status -type feed -lifecycle eviction -name "
- + overlay.get("outputFeedName")
- + " -start "+ SchemaHelper.getDateFormat().format(new Date())));
+ Assert.assertEquals(executeWithURL("instance -status -type feed -lifecycle eviction,replication -name "
+ + overlay.get("outputFeedName")
+ + " -start " + SchemaHelper.getDateFormat().format(new Date())), 0);
- Assert.assertEquals(0,
- executeWithURL("instance -params -type process -name "
- + overlay.get("processName")
- + " -start " + START_INSTANCE));
+ Assert.assertEquals(executeWithURL("instance -status -type feed -lifecycle eviction -name "
+ + overlay.get("outputFeedName")
+ + " -start " + SchemaHelper.getDateFormat().format(new Date())), 0);
+
+ Assert.assertEquals(executeWithURL("instance -params -type process -name "
+ + overlay.get("processName")
+ + " -start " + START_INSTANCE), 0);
// test filterBy, orderBy, offset, numResults
String startTimeString = SchemaHelper.getDateFormat().format(new Date());
- Assert.assertEquals(0,
- executeWithURL("instance -running -type feed -lifecycle eviction -name "
- + overlay.get("outputFeedName")
- + " -start " + startTimeString
- + " -orderBy startTime -sortOrder asc -offset 0 -numResults 1"));
- Assert.assertEquals(-1,
- executeWithURL("instance -running -type feed -lifecycle eviction -name "
+ Assert.assertEquals(executeWithURL("instance -running -type feed -lifecycle eviction -name "
+ + overlay.get("outputFeedName")
+ + " -start " + startTimeString
+ + " -orderBy startTime -sortOrder asc -offset 0 -numResults 1"), 0);
+
+ Assert.assertEquals(executeWithURL("instance -running -type feed -lifecycle eviction -name "
+ overlay.get("outputFeedName")
+ " -start " + SchemaHelper.getDateFormat().format(new Date())
- + " -orderBy INVALID -offset 0 -numResults 1"));
- Assert.assertEquals(0,
- executeWithURL("instance -running -type feed -lifecycle eviction -name "
- + overlay.get("outputFeedName")
- + " -start " + startTimeString
- + " -orderBy startTime -sortOrder desc -offset 0 -numResults 1"));
- Assert.assertEquals(-1,
- executeWithURL("instance -running -type feed -lifecycle eviction -name "
+ + " -orderBy INVALID -offset 0 -numResults 1"), -1);
+
+ Assert.assertEquals(executeWithURL("instance -running -type feed -lifecycle eviction -name "
+ + overlay.get("outputFeedName")
+ + " -start " + startTimeString
+ + " -orderBy startTime -sortOrder desc -offset 0 -numResults 1"), 0);
+
+ Assert.assertEquals(executeWithURL("instance -running -type feed -lifecycle eviction -name "
+ overlay.get("outputFeedName")
+ " -start " + startTimeString
- + " -orderBy startTime -sortOrder invalid -offset 0 -numResults 1"));
+ + " -orderBy startTime -sortOrder invalid -offset 0 -numResults 1"), -1);
- Assert.assertEquals(-1,
- executeWithURL("instance -running -type feed -lifecycle eviction -name "
+ Assert.assertEquals(executeWithURL("instance -running -type feed -lifecycle eviction -name "
+ overlay.get("outputFeedName")
+ " -start " + SchemaHelper.getDateFormat().format(new Date())
- + " -filterBy INVALID:FILTER -offset 0 -numResults 1"));
+ + " -filterBy INVALID:FILTER -offset 0 -numResults 1"), -1);
// testcase : start str is older than entity schedule time.
- Assert.assertEquals(0,
- executeWithURL("instance -running -type feed -lifecycle eviction -name "
- + overlay.get("outputFeedName")
- + " -start " + SchemaHelper.getDateFormat().format(new Date(10000))
- + " -orderBy startTime -sortOrder asc -offset 0 -numResults 1"));
+ Assert.assertEquals(executeWithURL("instance -running -type feed -lifecycle eviction -name "
+ + overlay.get("outputFeedName")
+ + " -start " + SchemaHelper.getDateFormat().format(new Date(10000))
+ + " -orderBy startTime -sortOrder asc -offset 0 -numResults 1"), 0);
// testcase : end str is in future
long futureTimeinMilliSecs = (new Date()).getTime()+ 86400000;
- Assert.assertEquals(0,
- executeWithURL("instance -running -type feed -lifecycle eviction -name "
- + overlay.get("outputFeedName")
- + " -start " + SchemaHelper.getDateFormat().format(new Date(10000))
- + " -end " + SchemaHelper.getDateFormat().format(new Date(futureTimeinMilliSecs))
- + " -orderBy startTime -offset 0 -numResults 1"));
+ Assert.assertEquals(executeWithURL("instance -running -type feed -lifecycle eviction -name "
+ + overlay.get("outputFeedName")
+ + " -start " + SchemaHelper.getDateFormat().format(new Date(10000))
+ + " -end " + SchemaHelper.getDateFormat().format(new Date(futureTimeinMilliSecs))
+ + " -orderBy startTime -offset 0 -numResults 1"), 0);
// Both start and end dates are optional
- Assert.assertEquals(0,
- executeWithURL("instance -running -type feed -lifecycle eviction -name "
- + overlay.get("outputFeedName")
- + " -orderBy startTime -offset 0 -numResults 1"));
-
- Assert.assertEquals(0,
- executeWithURL("instance -status -type process -name "
- + overlay.get("processName")
- + " -start "+ START_INSTANCE
- + " -filterBy STATUS:SUCCEEDED,STARTEDAFTER:"+START_INSTANCE
- + " -orderBy startTime -sortOrder desc -offset 0 -numResults 1"));
- Assert.assertEquals(0,
- executeWithURL("instance -status -type process -name "
- + overlay.get("processName")
- + " -start "+ START_INSTANCE
- + " -filterBy SOURCECLUSTER:"+ overlay.get("cluster")
- + " -orderBy startTime -sortOrder desc -offset 0 -numResults 1"));
-
- Assert.assertEquals(0,
- executeWithURL("instance -list -type feed -lifecycle eviction -name "
- + overlay.get("outputFeedName")
- + " -start "+ SchemaHelper.getDateFormat().format(new Date())
- +" -filterBy STATUS:SUCCEEDED -orderBy startTime -offset 0 -numResults 1"));
- Assert.assertEquals(0,
- executeWithURL("instance -list -type feed -lifecycle eviction -name "
- + overlay.get("outputFeedName")
- + " -start "+ SchemaHelper.getDateFormat().format(new Date())
- +" -filterBy SOURCECLUSTER:" + overlay.get("src.cluster.name")
- + " -orderBy startTime -offset 0 -numResults 1"));
- Assert.assertEquals(-1,
- executeWithURL("instance -status -type feed -lifecycle eviction -name "
- + overlay.get("outputFeedName")
- + " -start "+ SchemaHelper.getDateFormat().format(new Date())
- +" -filterBy INVALID:FILTER -orderBy startTime -offset 0 -numResults 1"));
- Assert.assertEquals(-1,
- executeWithURL("instance -list -type feed -lifecycle eviction -name "
+ Assert.assertEquals(executeWithURL("instance -running -type feed -lifecycle eviction -name "
+ + overlay.get("outputFeedName")
+ + " -orderBy startTime -offset 0 -numResults 1"), 0);
+
+ Assert.assertEquals(executeWithURL("instance -status -type process -name "
+ + overlay.get("processName")
+ + " -start " + START_INSTANCE
+ + " -filterBy STATUS:SUCCEEDED,STARTEDAFTER:" + START_INSTANCE
+ + " -orderBy startTime -sortOrder desc -offset 0 -numResults 1"), 0);
+
+ Assert.assertEquals(executeWithURL("instance -status -type process -name "
+ + overlay.get("processName")
+ + " -start " + START_INSTANCE
+ + " -filterBy SOURCECLUSTER:" + overlay.get("cluster")
+ + " -orderBy startTime -sortOrder desc -offset 0 -numResults 1"), 0);
+
+ Assert.assertEquals(executeWithURL("instance -list -type feed -lifecycle eviction -name "
+ + overlay.get("outputFeedName")
+ + " -start " + SchemaHelper.getDateFormat().format(new Date())
+ + " -filterBy STATUS:SUCCEEDED -orderBy startTime -offset 0 -numResults 1"), 0);
+
+ Assert.assertEquals(executeWithURL("instance -list -type feed -lifecycle eviction -name "
+ + overlay.get("outputFeedName")
+ + " -start " + SchemaHelper.getDateFormat().format(new Date())
+ + " -filterBy SOURCECLUSTER:" + overlay.get("src.cluster.name")
+ + " -orderBy startTime -offset 0 -numResults 1"), 0);
+
+ Assert.assertEquals(executeWithURL("instance -status -type feed -lifecycle eviction -name "
+ overlay.get("outputFeedName")
+ " -start "+ SchemaHelper.getDateFormat().format(new Date())
- +" -filterBy STATUS:SUCCEEDED -orderBy INVALID -offset 0 -numResults 1"));
- Assert.assertEquals(0,
- executeWithURL("instance -status -type feed -lifecycle eviction -name "
+ +" -filterBy INVALID:FILTER -orderBy startTime -offset 0 -numResults 1"), -1);
+
+ Assert.assertEquals(executeWithURL("instance -list -type feed -lifecycle eviction -name "
+ overlay.get("outputFeedName")
+ " -start "+ SchemaHelper.getDateFormat().format(new Date())
- +" -filterBy STATUS:SUCCEEDED -orderBy startTime -offset 1 -numResults 1"));
+ +" -filterBy STATUS:SUCCEEDED -orderBy INVALID -offset 0 -numResults 1"), -1);
+ Assert.assertEquals(executeWithURL("instance -status -type feed -lifecycle eviction -name "
+ + overlay.get("outputFeedName")
+ + " -start " + SchemaHelper.getDateFormat().format(new Date())
+ + " -filterBy STATUS:SUCCEEDED -orderBy startTime -offset 1 -numResults 1"), 0);
+
// When you get a cluster for which there are no feed entities,
- Assert.assertEquals(0,
- executeWithURL("entity -summary -type feed -cluster " + overlay.get("cluster") + " -fields status,tags"
- + " -start "+ SchemaHelper.getDateFormat().format(new Date())
- + " -offset 0 -numResults 1 -numInstances 3"));
+ Assert.assertEquals(executeWithURL("entity -summary -type feed -cluster " + overlay.get("cluster")
+ + " -fields status,tags"
+ + " -start " + SchemaHelper.getDateFormat().format(new Date())
+ + " -offset 0 -numResults 1 -numInstances 3"), 0);
}
@@ -528,39 +403,27 @@ public class FalconCLIIT {
Map<String, String> overlay = context.getUniqueOverlay();
submitTestFiles(context, overlay);
- Assert.assertEquals(0,
- executeWithURL("entity -schedule -type process -name "
- + overlay.get("processName")));
+ Assert.assertEquals(executeWithURL("entity -schedule -type process -name " + overlay.get("processName")), 0);
- Assert.assertEquals(0,
- executeWithURL("entity -schedule -type feed -name "
- + overlay.get("outputFeedName")));
+ Assert.assertEquals(executeWithURL("entity -schedule -type feed -name " + overlay.get("outputFeedName")), 0);
OozieTestUtils.waitForProcessWFtoStart(context);
- Assert.assertEquals(0,
- executeWithURL("instance -status -type feed -name "
- + overlay.get("outputFeedName")
- + " -start " + START_INSTANCE));
+ Assert.assertEquals(executeWithURL("instance -status -type feed -name " + overlay.get("outputFeedName")
+ + " -start " + START_INSTANCE), 0);
- Assert.assertEquals(0,
- executeWithURL("instance -running -type process -name "
- + overlay.get("processName")));
+ Assert.assertEquals(executeWithURL("instance -running -type process -name " + overlay.get("processName")), 0);
- Assert.assertEquals(0,
- executeWithURL("instance -summary -type process -name "
- + overlay.get("processName")
- + " -start " + START_INSTANCE));
+ Assert.assertEquals(executeWithURL("instance -summary -type process -name "
+ + overlay.get("processName") + " -start " + START_INSTANCE), 0);
- Assert.assertEquals(0,
- executeWithURL("instance -summary -type feed -lifecycle eviction -name "
- + overlay.get("outputFeedName")
- + " -start "+ SchemaHelper.getDateFormat().format(new Date())));
+ Assert.assertEquals(executeWithURL("instance -summary -type feed -lifecycle eviction -name "
+ + overlay.get("outputFeedName")
+ + " -start " + SchemaHelper.getDateFormat().format(new Date())), 0);
- Assert.assertEquals(0,
- executeWithURL("instance -params -type process -name "
- + overlay.get("processName")
- + " -start " + START_INSTANCE));
+ Assert.assertEquals(executeWithURL("instance -params -type process -name "
+ + overlay.get("processName")
+ + " -start " + START_INSTANCE), 0);
}
public void testInstanceSuspendAndResume() throws Exception {
@@ -568,35 +431,27 @@ public class FalconCLIIT {
Map<String, String> overlay = context.getUniqueOverlay();
submitTestFiles(context, overlay);
- Assert.assertEquals(0,
- executeWithURL("entity -schedule -type process -name "
- + overlay.get("processName")));
+ Assert.assertEquals(executeWithURL("entity -schedule -type process -name " + overlay.get("processName")), 0);
- Assert.assertEquals(0,
- executeWithURL("entity -schedule -type feed -name "
- + overlay.get("outputFeedName")));
+ Assert.assertEquals(executeWithURL("entity -schedule -type feed -name " + overlay.get("outputFeedName")), 0);
- Assert.assertEquals(0,
- executeWithURL("instance -suspend -type process -name "
- + overlay.get("processName")
- + " -start " + START_INSTANCE + " -end " + START_INSTANCE));
+ Assert.assertEquals(executeWithURL("instance -suspend -type process -name "
+ + overlay.get("processName")
+ + " -start " + START_INSTANCE + " -end " + START_INSTANCE), 0);
// No end date, should fail.
- Assert.assertEquals(-1,
- executeWithURL("instance -suspend -type feed -lifecycle eviction -name "
+ Assert.assertEquals(executeWithURL("instance -suspend -type feed -lifecycle eviction -name "
+ overlay.get("outputFeedName")
- + " -start "+ SchemaHelper.getDateFormat().format(new Date())));
+ + " -start "+ SchemaHelper.getDateFormat().format(new Date())), -1);
- Assert.assertEquals(0,
- executeWithURL("instance -resume -type process -name "
- + overlay.get("processName")
- + " -start " + START_INSTANCE + " -end " + START_INSTANCE));
+ Assert.assertEquals(executeWithURL("instance -resume -type process -name "
+ + overlay.get("processName")
+ + " -start " + START_INSTANCE + " -end " + START_INSTANCE), 0);
- Assert.assertEquals(0,
- executeWithURL("instance -resume -type feed -lifecycle eviction -name "
- + overlay.get("outputFeedName")
- + " -start "+ SchemaHelper.getDateFormat().format(new Date())
- + " -end " + SchemaHelper.getDateFormat().format(new Date())));
+ Assert.assertEquals(executeWithURL("instance -resume -type feed -lifecycle eviction -name "
+ + overlay.get("outputFeedName")
+ + " -start " + SchemaHelper.getDateFormat().format(new Date())
+ + " -end " + SchemaHelper.getDateFormat().format(new Date())), 0);
}
private static final String START_INSTANCE = "2012-04-20T00:00Z";
@@ -606,39 +461,30 @@ public class FalconCLIIT {
Map<String, String> overlay = context.getUniqueOverlay();
submitTestFiles(context, overlay);
- Assert.assertEquals(0,
- executeWithURL("entity -schedule -type process -name "
- + overlay.get("processName")));
+ Assert.assertEquals(executeWithURL("entity -schedule -type process -name " + overlay.get("processName")), 0);
- Assert.assertEquals(0,
- executeWithURL("entity -schedule -type feed -name "
- + overlay.get("outputFeedName")));
+ Assert.assertEquals(executeWithURL("entity -schedule -type feed -name " + overlay.get("outputFeedName")), 0);
OozieTestUtils.waitForProcessWFtoStart(context);
- Assert.assertEquals(
- 0,
- executeWithURL("instance -kill -type process -name "
+ Assert.assertEquals(executeWithURL("instance -kill -type process -name "
+ overlay.get("processName")
- + " -start " + START_INSTANCE + " -end " + START_INSTANCE));
+ + " -start " + START_INSTANCE + " -end " + START_INSTANCE), 0);
// Fail due to no end date
- Assert.assertEquals(-1,
- executeWithURL("instance -kill -type feed -lifecycle eviction -name "
+ Assert.assertEquals(executeWithURL("instance -kill -type feed -lifecycle eviction -name "
+ overlay.get("outputFeedName")
- + " -start "+ SchemaHelper.getDateFormat().format(new Date())));
+ + " -start "+ SchemaHelper.getDateFormat().format(new Date())), -1);
- Assert.assertEquals(0,
- executeWithURL("instance -rerun -type process -name "
- + overlay.get("processName")
- + " -start " + START_INSTANCE + " -end " + START_INSTANCE
- + " -file " + createTempJobPropertiesFile()));
+ Assert.assertEquals(executeWithURL("instance -rerun -type process -name "
+ + overlay.get("processName")
+ + " -start " + START_INSTANCE + " -end " + START_INSTANCE
+ + " -file " + createTempJobPropertiesFile()), 0);
- Assert.assertEquals(0,
- executeWithURL("instance -rerun -type feed -lifecycle eviction -name "
- + overlay.get("outputFeedName")
- + " -start "+ SchemaHelper.getDateFormat().format(new Date())
- + " -end "+ SchemaHelper.getDateFormat().format(new Date())
- + " -file "+ createTempJobPropertiesFile()));
+ Assert.assertEquals(executeWithURL("instance -rerun -type feed -lifecycle eviction -name "
+ + overlay.get("outputFeedName")
+ + " -start " + SchemaHelper.getDateFormat().format(new Date())
+ + " -end " + SchemaHelper.getDateFormat().format(new Date())
+ + " -file " + createTempJobPropertiesFile()), 0);
}
@Test
@@ -649,80 +495,63 @@ public class FalconCLIIT {
Map<String, String> overlay = context.getUniqueOverlay();
filePath = TestContext.overlayParametersOverTemplate(context.getClusterFileTemplate(), overlay);
- Assert.assertEquals(-1,
- executeWithURL("entity -submitAndSchedule -type cluster -file " + filePath));
+ Assert.assertEquals(executeWithURL("entity -submitAndSchedule -type cluster -file " + filePath), -1);
context.setCluster(overlay.get("cluster"));
// this is necessary for lineage
- Assert.assertEquals(0, executeWithURL("entity -submit -type cluster -file " + filePath));
+ Assert.assertEquals(executeWithURL("entity -submit -type cluster -file " + filePath), 0);
filePath = TestContext.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE1, overlay);
- Assert.assertEquals(0,
- executeWithURL("entity -submitAndSchedule -type feed -file " + filePath));
+ Assert.assertEquals(executeWithURL("entity -submitAndSchedule -type feed -file " + filePath), 0);
filePath = TestContext.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE2, overlay);
- Assert.assertEquals(0,
- executeWithURL("entity -submitAndSchedule -type feed -file " + filePath));
+ Assert.assertEquals(executeWithURL("entity -submitAndSchedule -type feed -file " + filePath), 0);
filePath = TestContext.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE1, overlay);
- Assert.assertEquals(0,
- executeWithURL("entity -submit -type feed -file " + filePath));
+ Assert.assertEquals(executeWithURL("entity -submit -type feed -file " + filePath), 0);
filePath = TestContext.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE2, overlay);
- Assert.assertEquals(0,
- executeWithURL("entity -submit -type feed -file " + filePath));
+ Assert.assertEquals(executeWithURL("entity -submit -type feed -file " + filePath), 0);
filePath = TestContext.overlayParametersOverTemplate(TestContext.PROCESS_TEMPLATE, overlay);
- Assert.assertEquals(0,
- executeWithURL("entity -validate -type process -file " + filePath));
+ Assert.assertEquals(executeWithURL("entity -validate -type process -file " + filePath), 0);
filePath = TestContext.overlayParametersOverTemplate(TestContext.PROCESS_TEMPLATE, overlay);
- Assert.assertEquals(0,
- executeWithURL("entity -submitAndSchedule -type process -file "
- + filePath));
+ Assert.assertEquals(executeWithURL("entity -submitAndSchedule -type process -file " + filePath), 0);
OozieTestUtils.waitForProcessWFtoStart(context);
// test entity List cli
- Assert.assertEquals(0,
- executeWithURL("entity -list -type cluster"
- + " -offset 0 -numResults 1"));
- Assert.assertEquals(0,
- executeWithURL("entity -list -type process -fields status "
- + " -filterBy STATUS:SUBMITTED,TYPE:process -orderBy name "
- + " -sortOrder asc -offset 1 -numResults 1"));
- Assert.assertEquals(0,
- executeWithURL("entity -list -type process -fields status,pipelines "
- + " -filterBy STATUS:SUBMITTED,type:process -orderBy name -offset 1 -numResults 1"));
- Assert.assertEquals(0,
- executeWithURL("entity -list -type process -fields status,pipelines "
- + " -filterBy STATUS:SUBMITTED,pipelines:testPipeline "
- + " -orderBy name -sortOrder desc -offset 1 -numResults 1"));
- Assert.assertEquals(0,
- executeWithURL("entity -list -type process -fields status,tags "
- + " -tags owner=producer@xyz.com,department=forecasting "
- + " -filterBy STATUS:SUBMITTED,type:process -orderBy name -offset 1 -numResults 1"));
- Assert.assertEquals(-1,
- executeWithURL("entity -list -type process -fields status "
- + " -filterBy STATUS:SUCCEEDED,TYPE:process -orderBy INVALID -offset 0 -numResults 1"));
- Assert.assertEquals(-1,
- executeWithURL("entity -list -type process -fields INVALID "
- + " -filterBy STATUS:SUCCEEDED,TYPE:process -orderBy name -offset 1 -numResults 1"));
- Assert.assertEquals(-1,
- executeWithURL("entity -list -type process -fields status "
- + " -filterBy INVALID:FILTER,TYPE:process -orderBy name -offset 1 -numResults 1"));
- Assert.assertEquals(0,
- executeWithURL("entity -definition -type cluster -name " + overlay.get("cluster")));
- Assert.assertEquals(-1,
- executeWithURL("entity -list -type process -fields status,tags "
- + " -tags owner=producer@xyz.com,department=forecasting "
- + " -filterBy STATUS:SUBMITTED,type:process "
- + " -orderBy name -sortOrder invalid -offset 1 -numResults 1"));
- Assert.assertEquals(0,
- executeWithURL("instance -status -type feed -name "
- + overlay.get("outputFeedName") + " -start " + START_INSTANCE));
- Assert.assertEquals(0,
- executeWithURL("instance -running -type process -name " + overlay.get("processName")));
+ Assert.assertEquals(executeWithURL("entity -list -type cluster" + " -offset 0 -numResults 1"), 0);
+ Assert.assertEquals(executeWithURL("entity -list -type process -fields status "
+ + " -filterBy STATUS:SUBMITTED,TYPE:process -orderBy name "
+ + " -sortOrder asc -offset 1 -numResults 1"), 0);
+ Assert.assertEquals(executeWithURL("entity -list -type process -fields status,pipelines "
+ + " -filterBy STATUS:SUBMITTED,type:process -orderBy name -offset 1 -numResults 1"), 0);
+ Assert.assertEquals(executeWithURL("entity -list -type process -fields status,pipelines "
+ + " -filterBy STATUS:SUBMITTED,pipelines:testPipeline "
+ + " -orderBy name -sortOrder desc -offset 1 -numResults 1"), 0);
+ Assert.assertEquals(executeWithURL("entity -list -type process -fields status,tags "
+ + " -tags owner=producer@xyz.com,department=forecasting "
+ + " -filterBy STATUS:SUBMITTED,type:process -orderBy name -offset 1 -numResults 1"), 0);
+ Assert.assertEquals(executeWithURL("entity -list -type process -fields status "
+ + " -filterBy STATUS:SUCCEEDED,TYPE:process -orderBy INVALID -offset 0 -numResults 1"), -1);
+
+ Assert.assertEquals(executeWithURL("entity -list -type process -fields INVALID "
+ + " -filterBy STATUS:SUCCEEDED,TYPE:process -orderBy name -offset 1 -numResults 1"), -1);
+
+ Assert.assertEquals(executeWithURL("entity -list -type process -fields status "
+ + " -filterBy INVALID:FILTER,TYPE:process -orderBy name -offset 1 -numResults 1"), -1);
+
+ Assert.assertEquals(executeWithURL("entity -definition -type cluster -name " + overlay.get("cluster")), 0);
+
+ Assert.assertEquals(executeWithURL("entity -list -type process -fields status,tags "
+ + " -tags owner=producer@xyz.com,department=forecasting "
+ + " -filterBy STATUS:SUBMITTED,type:process "
+ + " -orderBy name -sortOrder invalid -offset 1 -numResults 1"), -1);
+ Assert.assertEquals(executeWithURL("instance -status -type feed -name "
+ + overlay.get("outputFeedName") + " -start " + START_INSTANCE), 0);
+ Assert.assertEquals(executeWithURL("instance -running -type process -name " + overlay.get("processName")), 0);
}
@Test
@@ -735,13 +564,12 @@ public class FalconCLIIT {
String feedName = overlay.get("outputFeedName");
String clusterName = overlay.get("cluster");
- Assert.assertEquals(0,
- executeWithURL(FalconCLI.ENTITY_CMD + " -" + FalconCLI.SCHEDULE_OPT + " -"
- + FalconCLI.ENTITY_TYPE_OPT + " process -" + FalconCLI.ENTITY_NAME_OPT + " " + processName));
+ Assert.assertEquals(executeWithURL(FalconCLI.ENTITY_CMD + " -" + FalconCLI.SCHEDULE_OPT + " -"
+ + FalconCLI.ENTITY_TYPE_OPT + " process -" + FalconCLI.ENTITY_NAME_OPT + " " + processName),
+ 0);
- Assert.assertEquals(0,
- executeWithURL(FalconCLI.ENTITY_CMD + " -" + FalconCLI.SCHEDULE_OPT + " -"
- + FalconCLI.ENTITY_TYPE_OPT + " feed -" + FalconCLI.ENTITY_NAME_OPT + " " + feedName));
+ Assert.assertEquals(executeWithURL(FalconCLI.ENTITY_CMD + " -" + FalconCLI.SCHEDULE_OPT + " -"
+ + FalconCLI.ENTITY_TYPE_OPT + " feed -" + FalconCLI.ENTITY_NAME_OPT + " " + feedName), 0);
OozieTestUtils.waitForProcessWFtoStart(context);
@@ -749,24 +577,18 @@ public class FalconCLIIT {
+ FalconMetadataCLI.TYPE_OPT + " ";
String clusterString = " -" + FalconMetadataCLI.CLUSTER_OPT + " " + clusterName;
- Assert.assertEquals(0,
- executeWithURL(metadataListCommand + RelationshipType.CLUSTER_ENTITY.name()));
- Assert.assertEquals(0,
- executeWithURL(metadataListCommand + RelationshipType.PROCESS_ENTITY.name()));
- Assert.assertEquals(0,
- executeWithURL(metadataListCommand + RelationshipType.FEED_ENTITY.name()));
- Assert.assertEquals(0,
- executeWithURL(metadataListCommand + RelationshipType.PROCESS_ENTITY.name()
- + clusterString));
- Assert.assertEquals(0,
- executeWithURL(metadataListCommand + RelationshipType.FEED_ENTITY.name()
- + clusterString));
- Assert.assertEquals(0,
- executeWithURL(metadataListCommand + RelationshipType.CLUSTER_ENTITY.name()
- + clusterString));
-
- Assert.assertEquals(-1, executeWithURL(metadataListCommand + "feed"));
- Assert.assertEquals(-1, executeWithURL(metadataListCommand + "invalid"));
+ Assert.assertEquals(executeWithURL(metadataListCommand + RelationshipType.CLUSTER_ENTITY.name()), 0);
+ Assert.assertEquals(executeWithURL(metadataListCommand + RelationshipType.PROCESS_ENTITY.name()), 0);
+ Assert.assertEquals(executeWithURL(metadataListCommand + RelationshipType.FEED_ENTITY.name()), 0);
+ Assert.assertEquals(executeWithURL(metadataListCommand + RelationshipType.PROCESS_ENTITY.name()
+ + clusterString), 0);
+ Assert.assertEquals(executeWithURL(metadataListCommand + RelationshipType.FEED_ENTITY.name()
+ + clusterString), 0);
+ Assert.assertEquals(executeWithURL(metadataListCommand + RelationshipType.CLUSTER_ENTITY.name()
+ + clusterString), 0);
+
+ Assert.assertEquals(executeWithURL(metadataListCommand + "feed"), -1);
+ Assert.assertEquals(executeWithURL(metadataListCommand + "invalid"), -1);
}
@Test
@@ -779,32 +601,29 @@ public class FalconCLIIT {
String feedName = overlay.get("outputFeedName");
String clusterName = overlay.get("cluster");
- Assert.assertEquals(0,
- executeWithURL(FalconCLI.ENTITY_CMD + " -" + FalconCLI.SCHEDULE_OPT + " -"
- + FalconCLI.ENTITY_TYPE_OPT + " process -" + FalconCLI.ENTITY_NAME_OPT + " " + processName));
+ Assert.assertEquals(executeWithURL(FalconCLI.ENTITY_CMD + " -" + FalconCLI.SCHEDULE_OPT + " -"
+ + FalconCLI.ENTITY_TYPE_OPT + " process -" + FalconCLI.ENTITY_NAME_OPT + " " + processName),
+ 0);
- Assert.assertEquals(0,
- executeWithURL(FalconCLI.ENTITY_CMD + " -" + FalconCLI.SCHEDULE_OPT + " -"
- + FalconCLI.ENTITY_TYPE_OPT + " feed -" + FalconCLI.ENTITY_NAME_OPT + " " + feedName));
+ Assert.assertEquals(executeWithURL(FalconCLI.ENTITY_CMD + " -" + FalconCLI.SCHEDULE_OPT + " -"
+ + FalconCLI.ENTITY_TYPE_OPT + " feed -" + FalconCLI.ENTITY_NAME_OPT + " " + feedName), 0);
OozieTestUtils.waitForProcessWFtoStart(context);
String metadataRelationsCommand = FalconCLI.METADATA_CMD + " -" + FalconMetadataCLI.RELATIONS_OPT + " -"
+ FalconMetadataCLI.TYPE_OPT + " ";
- Assert.assertEquals(0,
- executeWithURL(metadataRelationsCommand + RelationshipType.CLUSTER_ENTITY.name()
- + " -" + FalconMetadataCLI.NAME_OPT + " " + clusterName));
- Assert.assertEquals(0,
- executeWithURL(metadataRelationsCommand + RelationshipType.PROCESS_ENTITY.name()
- + " -" + FalconMetadataCLI.NAME_OPT + " " + processName));
-
- Assert.assertEquals(-1, executeWithURL(metadataRelationsCommand + "feed -"
- + FalconMetadataCLI.NAME_OPT + " " + clusterName));
- Assert.assertEquals(-1, executeWithURL(metadataRelationsCommand + "invalid -"
- + FalconMetadataCLI.NAME_OPT + " " + clusterName));
- Assert.assertEquals(-1,
- executeWithURL(metadataRelationsCommand + RelationshipType.CLUSTER_ENTITY.name()));
+ Assert.assertEquals(executeWithURL(metadataRelationsCommand + RelationshipType.CLUSTER_ENTITY.name()
+ + " -" + FalconMetadataCLI.NAME_OPT + " " + clusterName), 0);
+ Assert.assertEquals(executeWithURL(metadataRelationsCommand + RelationshipType.PROCESS_ENTITY.name()
+ + " -" + FalconMetadataCLI.NAME_OPT + " " + processName), 0);
+
+ Assert.assertEquals(executeWithURL(metadataRelationsCommand + "feed -"
+ + FalconMetadataCLI.NAME_OPT + " " + clusterName), -1);
+
+ Assert.assertEquals(executeWithURL(metadataRelationsCommand + "invalid -"
+ + FalconMetadataCLI.NAME_OPT + " " + clusterName), -1);
+ Assert.assertEquals(executeWithURL(metadataRelationsCommand + RelationshipType.CLUSTER_ENTITY.name()), -1);
}
public void testContinue() throws Exception {
@@ -812,73 +631,61 @@ public class FalconCLIIT {
Map<String, String> overlay = context.getUniqueOverlay();
submitTestFiles(context, overlay);
- Assert.assertEquals(0,
- executeWithURL("entity -schedule -type process -name "
- + overlay.get("processName")));
+ Assert.assertEquals(executeWithURL("entity -schedule -type process -name " + overlay.get("processName")), 0);
- Assert.assertEquals(0,
- executeWithURL("entity -schedule -type feed -name "
- + overlay.get("outputFeedName")));
+ Assert.assertEquals(executeWithURL("entity -schedule -type feed -name " + overlay.get("outputFeedName")), 0);
OozieTestUtils.waitForProcessWFtoStart(context);
- Assert.assertEquals(
- 0,
- executeWithURL("instance -kill -type process -name "
+ Assert.assertEquals(executeWithURL("instance -kill -type process -name "
+ overlay.get("processName")
- + " -start " + START_INSTANCE + " -end " + START_INSTANCE));
+ + " -start " + START_INSTANCE + " -end " + START_INSTANCE), 0);
- Assert.assertEquals(0,
- executeWithURL("instance -kill -type feed -lifecycle eviction -name "
+ Assert.assertEquals(executeWithURL("instance -kill -type feed -lifecycle eviction -name "
+ overlay.get("outputFeedName")
+ " -start "+ SchemaHelper.getDateFormat().format(new Date())
- + " -end " + SchemaHelper.getDateFormat().format(new Date())));
+ + " -end " + SchemaHelper.getDateFormat().format(new Date())), 0);
- Assert.assertEquals(-1,
- executeWithURL("instance -rerun -type process -name "
+ Assert.assertEquals(executeWithURL("instance -rerun -type process -name "
+ overlay.get("processName")
- + " -start " + START_INSTANCE));
+ + " -start " + START_INSTANCE), -1);
- Assert.assertEquals(0,
- executeWithURL("instance -rerun -type process -name "
+ Assert.assertEquals(executeWithURL("instance -rerun -type process -name "
+ overlay.get("processName")
- + " -start " + START_INSTANCE + " -end " + START_INSTANCE));
+ + " -start " + START_INSTANCE + " -end " + START_INSTANCE), 0);
- Assert.assertEquals(0,
- executeWithURL("instance -rerun -type feed -lifecycle eviction -name "
+ Assert.assertEquals(executeWithURL("instance -rerun -type feed -lifecycle eviction -name "
+ overlay.get("outputFeedName")
+ " -start "+ SchemaHelper.getDateFormat().format(new Date())
- + " -end " + SchemaHelper.getDateFormat().format(new Date())));
+ + " -end " + SchemaHelper.getDateFormat().format(new Date())), 0);
}
public void testInvalidCLIInstanceCommands() throws Exception {
// no command
- Assert.assertEquals(-1, executeWithURL(" -kill -type process -name "
- + "name" + " -start 2010-01-01T01:00Z -end 2010-01-01T03:00Z"));
+ Assert.assertEquals(executeWithURL(" -kill -type process -name "
+ + "name" + " -start 2010-01-01T01:00Z -end 2010-01-01T03:00Z"), -1);
- Assert.assertEquals(-1, executeWithURL("instance -kill " + "name"
- + " -start 2010-01-01T01:00Z -end 2010-01-01T01:00Z"));
+ Assert.assertEquals(executeWithURL("instance -kill " + "name"
+ + " -start 2010-01-01T01:00Z -end 2010-01-01T01:00Z"), -1);
- Assert.assertEquals(-1,
- executeWithURL("instance -kill -type process -name " + "name"
- + " -end 2010-01-01T03:00Z"));
+ Assert.assertEquals(executeWithURL("instance -kill -type process -name " + "name"
+ + " -end 2010-01-01T03:00Z"), -1);
- Assert.assertEquals(-1,
- executeWithURL("instance -kill -type process -name "
- + " -start 2010-01-01T01:00Z -end 2010-01-01T03:00Z"));
+ Assert.assertEquals(executeWithURL("instance -kill -type process -name "
+ + " -start 2010-01-01T01:00Z -end 2010-01-01T03:00Z"), -1);
}
public void testFalconURL() throws Exception {
- Assert.assertEquals(-1, new FalconCLI()
+ Assert.assertEquals(new FalconCLI()
.run(("instance -status -type process -name " + "processName"
+ " -start 2010-01-01T01:00Z -end 2010-01-01T03:00Z")
- .split("\\s")));
+ .split("\\s")), -1);
- Assert.assertEquals(-1, new FalconCLI()
+ Assert.assertEquals(new FalconCLI()
.run(("instance -status -type process -name "
+ "processName -url http://unknownhost:1234/"
+ " -start 2010-01-01T01:00Z -end 2010-01-01T03:00Z")
- .split("\\s")));
+ .split("\\s")), -1);
}
public void testClientProperties() throws Exception {
@@ -886,30 +693,25 @@ public class FalconCLIIT {
Map<String, String> overlay = context.getUniqueOverlay();
submitTestFiles(context, overlay);
- Assert.assertEquals(0,
- new FalconCLI().run(("entity -schedule -type feed -name "
+ Assert.assertEquals(new FalconCLI().run(("entity -schedule -type feed -name "
+ overlay.get("outputFeedName") + " -url "
- + TestContext.BASE_URL).split("\\s+")));
+ + TestContext.BASE_URL).split("\\s+")), 0);
- Assert.assertEquals(0,
- new FalconCLI().run(("entity -schedule -type process -name "
+ Assert.assertEquals(new FalconCLI().run(("entity -schedule -type process -name "
+ overlay.get("processName")+ " -url "
- + TestContext.BASE_URL).split("\\s+")));
+ + TestContext.BASE_URL).split("\\s+")), 0);
}
public void testGetVersion() throws Exception {
- Assert.assertEquals(0,
- new FalconCLI().run(("admin -version -url " + TestContext.BASE_URL).split("\\s")));
+ Assert.assertEquals(new FalconCLI().run(("admin -version -url " + TestContext.BASE_URL).split("\\s")), 0);
}
public void testGetStatus() throws Exception {
- Assert.assertEquals(0,
- new FalconCLI().run(("admin -status -url " + TestContext.BASE_URL).split("\\s")));
+ Assert.assertEquals(new FalconCLI().run(("admin -status -url " + TestContext.BASE_URL).split("\\s")), 0);
}
public void testGetThreadStackDump() throws Exception {
- Assert.assertEquals(0,
- new FalconCLI().run(("admin -stack -url " + TestContext.BASE_URL).split("\\s")));
+ Assert.assertEquals(new FalconCLI().run(("admin -stack -url " + TestContext.BASE_URL).split("\\s")), 0);
}
public void testInstanceGetLogs() throws Exception {
@@ -917,71 +719,59 @@ public class FalconCLIIT {
Map<String, String> overlay = context.getUniqueOverlay();
submitTestFiles(context, overlay);
- Assert.assertEquals(0,
- executeWithURL("entity -schedule -type process -name "
- + overlay.get("processName")));
+ Assert.assertEquals(executeWithURL("entity -schedule -type process -name " + overlay.get("processName")), 0);
- Assert.assertEquals(0,
- executeWithURL("entity -schedule -type feed -name "
- + overlay.get("outputFeedName")));
+ Assert.assertEquals(executeWithURL("entity -schedule -type feed -name " + overlay.get("outputFeedName")), 0);
Thread.sleep(500);
- Assert.assertEquals(0,
- executeWithURL("instance -logs -type process -name "
+ Assert.assertEquals(executeWithURL("instance -logs -type process -name "
+ overlay.get("processName")
- + " -start " + START_INSTANCE + " -end " + START_INSTANCE));
+ + " -start " + START_INSTANCE + " -end " + START_INSTANCE), 0);
- Assert.assertEquals(0,
- executeWithURL("instance -logs -type feed -lifecycle eviction -name "
+ Assert.assertEquals(executeWithURL("instance -logs -type feed -lifecycle eviction -name "
+ overlay.get("outputFeedName")
- + " -start "+ SchemaHelper.getDateFormat().format(new Date())));
+ + " -start "+ SchemaHelper.getDateFormat().format(new Date())), 0);
// test filterBy, orderBy, offset, numResults
- Assert.assertEquals(0,
- executeWithURL("instance -logs -type process -name "
+ Assert.assertEquals(executeWithURL("instance -logs -type process -name "
+ overlay.get("processName")
+ " -start " + START_INSTANCE + " -end " + START_INSTANCE
+ " -filterBy STATUS:SUCCEEDED -orderBy endtime "
- + " -sortOrder asc -offset 0 -numResults 1"));
- Assert.assertEquals(0,
- executeWithURL("instance -logs -type process -name "
+ + " -sortOrder asc -offset 0 -numResults 1"), 0);
+ Assert.assertEquals(executeWithURL("instance -logs -type process -name "
+ overlay.get("processName")
+ " -start " + START_INSTANCE + " -end " + START_INSTANCE
+ " -filterBy STATUS:SUCCEEDED -orderBy starttime "
- + " -sortOrder asc -offset 0 -numResults 1"));
- Assert.assertEquals(0,
- executeWithURL("instance -logs -type process -name "
+ + " -sortOrder asc -offset 0 -numResults 1"), 0);
+ Assert.assertEquals(executeWithURL("instance -logs -type process -name "
+ overlay.get("processName")
+ " -start " + START_INSTANCE + " -end " + START_INSTANCE
+ " -filterBy STATUS:SUCCEEDED -orderBy cluster "
- + " -sortOrder asc -offset 0 -numResults 1"));
- Assert.assertEquals(0,
- executeWithURL("instance -logs -type process -name "
+ + " -sortOrder asc -offset 0 -numResults 1"), 0);
+
+ Assert.assertEquals(executeWithURL("instance -logs -type process -name "
+ overlay.get("processName")
+ " -start " + START_INSTANCE + " -end " + START_INSTANCE
- + " -filterBy STATUS:WAITING -orderBy startTime -offset 0 -numResults 1"));
- Assert.assertEquals(-1,
- executeWithURL("instance -logs -type process -name "
+ + " -filterBy STATUS:WAITING -orderBy startTime -offset 0 -numResults 1"), 0);
+
+ Assert.assertEquals(executeWithURL("instance -logs -type process -name "
+ overlay.get("processName")
+ " -start " + START_INSTANCE + " -end " + START_INSTANCE
+ " -filterBy STATUS:SUCCEEDED -orderBy endtime "
- + " -sortOrder invalid -offset 0 -numResults 1"));
- Assert.assertEquals(0,
- executeWithURL("instance -logs -type process -name "
+ + " -sortOrder invalid -offset 0 -numResults 1"), -1);
+ Assert.assertEquals(executeWithURL("instance -logs -type process -name "
+ overlay.get("processName")
+ " -start " + START_INSTANCE + " -end " + START_INSTANCE
- + " -filterBy STATUS:SUCCEEDED,STARTEDAFTER:"+START_INSTANCE+" -offset 1 -numResults 1"));
- Assert.assertEquals(-1,
- executeWithURL("instance -logs -type process -name "
+ + " -filterBy STATUS:SUCCEEDED,STARTEDAFTER:"+START_INSTANCE+" -offset 1 -numResults 1"), 0);
+ Assert.assertEquals(executeWithURL("instance -logs -type process -name "
+ overlay.get("processName")
+ " -start " + START_INSTANCE + " -end " + START_INSTANCE
- + " -filterBy INVALID:FILTER -orderBy startTime -offset 0 -numResults 1"));
- Assert.assertEquals(-1,
- executeWithURL("instance -logs -type process -name "
+ + " -filterBy INVALID:FILTER -orderBy startTime -offset 0 -numResults 1"), -1);
+ Assert.assertEquals(executeWithURL("instance -logs -type process -name "
+ overlay.get("processName")
+ " -start " + START_INSTANCE + " -end " + START_INSTANCE
- + " -filterBy STATUS:SUCCEEDED -orderBy wrongOrder -offset 0 -numResults 1"));
+ + " -filterBy STATUS:SUCCEEDED -orderBy wrongOrder -offset 0 -numResults 1"), -1);
}
@SuppressWarnings("ResultOfMethodCallIgnored")
@@ -1004,17 +794,14 @@ public class FalconCLIIT {
createPropertiesFile(context);
String filePath = TestContext.overlayParametersOverTemplate(context.getClusterFileTemplate(),
overlay);
- Assert.assertEquals(0,
- executeWithURL("entity -submit -type cluster -file " + filePath));
+ Assert.assertEquals(executeWithURL("entity -submit -type cluster -file " + filePath), 0);
context.setCluster(overlay.get("cluster"));
filePath = TestContext.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE1, overlay);
- Assert.assertEquals(0,
- executeWithURL("entity -submit -type feed -file " + filePath));
+ Assert.assertEquals(executeWithURL("entity -submit -type feed -file " + filePath), 0);
filePath = TestContext.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE2, overlay);
- Assert.assertEquals(0,
- executeWithURL("entity -submit -type feed -file " + filePath));
+ Assert.assertEquals(executeWithURL("entity -submit -type feed -file " + filePath), 0);
}
private void createPropertiesFile(TestContext context) throws Exception {
@@ -1066,23 +853,17 @@ public class FalconCLIIT {
String filePath = TestContext.overlayParametersOverTemplate(context.getClusterFileTemplate(),
overlay);
- Assert.assertEquals(
- 0,
- executeWithURL("entity -submit -type cluster -file " + filePath));
+ Assert.assertEquals(executeWithURL("entity -submit -type cluster -file " + filePath), 0);
context.setCluster(overlay.get("cluster"));
filePath = TestContext.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE1, overlay);
- Assert.assertEquals(0,
- executeWithURL("entity -submit -type feed -file " + filePath));
+ Assert.assertEquals(executeWithURL("entity -submit -type feed -file " + filePath), 0);
filePath = TestContext.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE2, overlay);
- Assert.assertEquals(0,
- executeWithURL("entity -submit -type feed -file " + filePath));
+ Assert.assertEquals(executeWithURL("entity -submit -type feed -file " + filePath), 0);
filePath = TestContext.overlayParametersOverTemplate(TestContext.PROCESS_TEMPLATE, overlay);
- Assert.assertEquals(
- 0,
- executeWithURL("entity -submit -type process -file " + filePath));
+ Assert.assertEquals(executeWithURL("entity -submit -type process -file " + filePath), 0);
}
private static class InMemoryWriter extends PrintStream {
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/4e7a552d/webapp/src/test/java/org/apache/falcon/cli/FalconCLISmokeIT.java
----------------------------------------------------------------------
diff --git a/webapp/src/test/java/org/apache/falcon/cli/FalconCLISmokeIT.java b/webapp/src/test/java/org/apache/falcon/cli/FalconCLISmokeIT.java
index 8d54c38..ee5534a 100644
--- a/webapp/src/test/java/org/apache/falcon/cli/FalconCLISmokeIT.java
+++ b/webapp/src/test/java/org/apache/falcon/cli/FalconCLISmokeIT.java
@@ -51,60 +51,45 @@ public class FalconCLISmokeIT {
Map<String, String> overlay = context.getUniqueOverlay();
filePath = TestContext.overlayParametersOverTemplate(context.getClusterFileTemplate(), overlay);
- Assert.assertEquals(-1,
- executeWithURL("entity -submitAndSchedule -type cluster -file " + filePath));
+ Assert.assertEquals(executeWithURL("entity -submitAndSchedule -type cluster -file " + filePath), -1);
context.setCluster(overlay.get("cluster"));
// this is necessary for lineage
- Assert.assertEquals(0, executeWithURL("entity -submit -type cluster -file " + filePath));
+ Assert.assertEquals(executeWithURL("entity -submit -type cluster -file " + filePath), 0);
// verify
- Assert.assertEquals(0, executeWithURL("metadata -vertices -key name -value " + context.getClusterName()));
+ Assert.assertEquals(executeWithURL("metadata -vertices -key name -value " + context.getClusterName()), 0);
filePath = TestContext.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE1, overlay);
- Assert.assertEquals(0,
- executeWithURL("entity -submitAndSchedule -type feed -file " + filePath));
+ Assert.assertEquals(executeWithURL("entity -submitAndSchedule -type feed -file " + filePath), 0);
filePath = TestContext.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE2, overlay);
- Assert.assertEquals(0,
- executeWithURL("entity -submitAndSchedule -type feed -file " + filePath));
+ Assert.assertEquals(executeWithURL("entity -submitAndSchedule -type feed -file " + filePath), 0);
filePath = TestContext.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE1, overlay);
- Assert.assertEquals(0,
- executeWithURL("entity -submit -type feed -file " + filePath));
+ Assert.assertEquals(executeWithURL("entity -submit -type feed -file " + filePath), 0);
filePath = TestContext.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE2, overlay);
- Assert.assertEquals(0,
- executeWithURL("entity -submit -type feed -file " + filePath));
+ Assert.assertEquals(executeWithURL("entity -submit -type feed -file " + filePath), 0);
filePath = TestContext.overlayParametersOverTemplate(TestContext.PROCESS_TEMPLATE, overlay);
- Assert.assertEquals(0,
- executeWithURL("entity -validate -type process -file " + filePath));
+ Assert.assertEquals(executeWithURL("entity -validate -type process -file " + filePath), 0);
filePath = TestContext.overlayParametersOverTemplate(TestContext.PROCESS_TEMPLATE, overlay);
- Assert.assertEquals(0,
- executeWithURL("entity -submitAndSchedule -type process -file "
- + filePath));
+ Assert.assertEquals(executeWithURL("entity -submitAndSchedule -type process -file " + filePath), 0);
OozieTestUtils.waitForProcessWFtoStart(context);
// test entity List cli
- Assert.assertEquals(0,
- executeWithURL("entity -list -type cluster"
- + " -offset 0 -numResults 1"));
- Assert.assertEquals(0,
- executeWithURL("entity -list -type process -fields status "
- + " -filterBy STATUS:SUBMITTED,TYPE:process -orderBy name -offset 1 -numResults 1"));
- Assert.assertEquals(-1,
- executeWithURL("entity -list -type process -fields status "
- + " -filterBy STATUS:SUCCEEDED,TYPE:process -orderBy INVALID -offset 0 -numResults 1"));
- Assert.assertEquals(0,
- executeWithURL("entity -definition -type cluster -name " + overlay.get("cluster")));
-
- Assert.assertEquals(0,
- executeWithURL("instance -status -type feed -name "
- + overlay.get("outputFeedName") + " -start " + START_INSTANCE));
- Assert.assertEquals(0,
- executeWithURL("instance -running -type process -name " + overlay.get("processName")));
+ Assert.assertEquals(executeWithURL("entity -list -type cluster -offset 0 -numResults 1"), 0);
+ Assert.assertEquals(executeWithURL("entity -list -type process -fields status "
+ + " -filterBy STATUS:SUBMITTED,TYPE:process -orderBy name -offset 1 -numResults 1"), 0);
+ Assert.assertEquals(executeWithURL("entity -list -type process -fields status "
+ + " -filterBy STATUS:SUCCEEDED,TYPE:process -orderBy INVALID -offset 0 -numResults 1"), -1);
+ Assert.assertEquals(executeWithURL("entity -definition -type cluster -name " + overlay.get("cluster")), 0);
+
+ Assert.assertEquals(executeWithURL("instance -status -type feed -name "
+ + overlay.get("outputFeedName") + " -start " + START_INSTANCE), 0);
+ Assert.assertEquals(executeWithURL("instance -running -type process -name " + overlay.get("processName")), 0);
}
private int executeWithURL(String command) throws Exception {
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/4e7a552d/webapp/src/test/java/org/apache/falcon/late/LateDataHandlerIT.java
----------------------------------------------------------------------
diff --git a/webapp/src/test/java/org/apache/falcon/late/LateDataHandlerIT.java b/webapp/src/test/java/org/apache/falcon/late/LateDataHandlerIT.java
index cf537c9..c4e046b 100644
--- a/webapp/src/test/java/org/apache/falcon/late/LateDataHandlerIT.java
+++ b/webapp/src/test/java/org/apache/falcon/late/LateDataHandlerIT.java
@@ -150,7 +150,7 @@ public class LateDataHandlerIT {
Assert.assertEquals(recordedMetrics.get("foo").longValue(), metric);
final String changes = lateDataHandler.detectChanges(lateDataPath, recordedMetrics, conf);
- Assert.assertEquals("", changes);
+ Assert.assertEquals(changes, "");
}
@Test
@@ -195,7 +195,7 @@ public class LateDataHandlerIT {
computedMetrics.put("foo", metric);
String changes = lateDataHandler.detectChanges(lateDataPath, computedMetrics, conf);
- Assert.assertEquals("foo", changes);
+ Assert.assertEquals(changes, "foo");
}
private void reinstatePartition() throws Exception {