falcon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sowmya...@apache.org
Subject falcon git commit: FALCON-1462 Modify use of "testuser" in UTs and ITs. Contributed by Narayan Periwal.
Date Thu, 24 Sep 2015 21:17:38 GMT
Repository: falcon
Updated Branches:
  refs/heads/master 88d105519 -> 9a2acebf7


FALCON-1462 Modify use of "testuser" in UTs and ITs. Contributed by Narayan Periwal.


Project: http://git-wip-us.apache.org/repos/asf/falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/falcon/commit/9a2acebf
Tree: http://git-wip-us.apache.org/repos/asf/falcon/tree/9a2acebf
Diff: http://git-wip-us.apache.org/repos/asf/falcon/diff/9a2acebf

Branch: refs/heads/master
Commit: 9a2acebf79015e264240e1371c862f3ca9d0fc98
Parents: 88d1055
Author: Sowmya Ramesh <sramesh@hortonworks.com>
Authored: Thu Sep 24 14:17:34 2015 -0700
Committer: Sowmya Ramesh <sramesh@hortonworks.com>
Committed: Thu Sep 24 14:17:34 2015 -0700

----------------------------------------------------------------------
 CHANGES.txt                                     |   2 +
 .../falcon/security/SecurityUtilTest.java       |   2 +-
 .../FalconAuthenticationFilterTest.java         |  14 +--
 webapp/pom.xml                                  |   8 ++
 .../java/org/apache/falcon/cli/FalconCLIIT.java | 125 ++++++++++---------
 .../falcon/resource/EntityManagerJerseyIT.java  |   5 +-
 .../resource/MetadataResourceJerseyIT.java      |   3 +-
 7 files changed, 90 insertions(+), 69 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/falcon/blob/9a2acebf/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 160e9b2..4c0462a 100755
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -39,6 +39,8 @@ Trunk (Unreleased)
     FALCON-1403 Revisit IT cleanup and teardown(Narayan Periwal via Pallavi Rao)
 
   BUG FIXES
+    FALCON-1462 Modify use of "testuser" in UTs and ITs(Narayan Periwal via Sowmya Ramesh)
+
     FALCON-1484 Find Bundles fails in case of hadoop namenode moving to HA(Sandeep Samudrala
via Pallavi Rao)
 
     FALCON-1343 Fix validation of read/write endpoints in ClusterEntityParser(Balu Vellanki
via Ajay Yadava)

http://git-wip-us.apache.org/repos/asf/falcon/blob/9a2acebf/common/src/test/java/org/apache/falcon/security/SecurityUtilTest.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/falcon/security/SecurityUtilTest.java b/common/src/test/java/org/apache/falcon/security/SecurityUtilTest.java
index 76d9f45..d47acbc 100644
--- a/common/src/test/java/org/apache/falcon/security/SecurityUtilTest.java
+++ b/common/src/test/java/org/apache/falcon/security/SecurityUtilTest.java
@@ -148,7 +148,7 @@ public class SecurityUtilTest {
         final String currentUser = "foo";
 
         ACL acl = new ACL();
-        acl.setOwner("testuser");
+        acl.setOwner(FalconTestUtil.TEST_USER_2);
         acl.setGroup("users");
         Mockito.when(process.getACL()).thenReturn(acl);
 

http://git-wip-us.apache.org/repos/asf/falcon/blob/9a2acebf/prism/src/test/java/org/apache/falcon/security/FalconAuthenticationFilterTest.java
----------------------------------------------------------------------
diff --git a/prism/src/test/java/org/apache/falcon/security/FalconAuthenticationFilterTest.java
b/prism/src/test/java/org/apache/falcon/security/FalconAuthenticationFilterTest.java
index 5627e68..51a0c04 100644
--- a/prism/src/test/java/org/apache/falcon/security/FalconAuthenticationFilterTest.java
+++ b/prism/src/test/java/org/apache/falcon/security/FalconAuthenticationFilterTest.java
@@ -251,13 +251,13 @@ public class FalconAuthenticationFilterTest {
             filter.init(mockConfig);
         }
 
-        CurrentUser.authenticate("testuser");
+        CurrentUser.authenticate(FalconTestUtil.TEST_USER_2);
         Mockito.when(mockRequest.getMethod()).thenReturn("POST");
-        Mockito.when(mockRequest.getQueryString()).thenReturn("user.name=testuser");
-        Mockito.when(mockRequest.getRemoteUser()).thenReturn("testuser");
+        Mockito.when(mockRequest.getQueryString()).thenReturn("user.name=" + FalconTestUtil.TEST_USER_2);
+        Mockito.when(mockRequest.getRemoteUser()).thenReturn(FalconTestUtil.TEST_USER_2);
         Mockito.when(mockRequest.getParameter(FalconAuthenticationFilter.DO_AS_PARAM)).thenReturn("");
         filter.doFilter(mockRequest, mockResponse, mockChain);
-        Assert.assertEquals(CurrentUser.getUser(), "testuser");
+        Assert.assertEquals(CurrentUser.getUser(), FalconTestUtil.TEST_USER_2);
     }
 
     @Test
@@ -287,10 +287,10 @@ public class FalconAuthenticationFilterTest {
             filter.init(mockConfig);
         }
 
-        CurrentUser.authenticate("testuser");
+        CurrentUser.authenticate(FalconTestUtil.TEST_USER_2);
         Mockito.when(mockRequest.getMethod()).thenReturn("POST");
-        Mockito.when(mockRequest.getQueryString()).thenReturn("user.name=testuser");
-        Mockito.when(mockRequest.getRemoteUser()).thenReturn("testuser");
+        Mockito.when(mockRequest.getQueryString()).thenReturn("user.name=" + FalconTestUtil.TEST_USER_2);
+        Mockito.when(mockRequest.getRemoteUser()).thenReturn(FalconTestUtil.TEST_USER_2);
         Mockito.when(mockRequest.getParameter(FalconAuthenticationFilter.DO_AS_PARAM)).thenReturn("doAsProxyUser");
         Mockito.when(mockRequest.getMethod()).thenReturn("POST");
         filter.doFilter(mockRequest, mockResponse, mockChain);

http://git-wip-us.apache.org/repos/asf/falcon/blob/9a2acebf/webapp/pom.xml
----------------------------------------------------------------------
diff --git a/webapp/pom.xml b/webapp/pom.xml
index 77ef662..a4d5a8d 100644
--- a/webapp/pom.xml
+++ b/webapp/pom.xml
@@ -89,6 +89,14 @@
         <dependency>
             <groupId>org.apache.falcon</groupId>
             <artifactId>falcon-common</artifactId>
+            <version>${project.version}</version>
+            <type>test-jar</type>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.falcon</groupId>
+            <artifactId>falcon-common</artifactId>
             <exclusions>
                 <exclusion>
                     <groupId>javax.servlet.jsp</groupId>

http://git-wip-us.apache.org/repos/asf/falcon/blob/9a2acebf/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 577b60d..07aacdd 100644
--- a/webapp/src/test/java/org/apache/falcon/cli/FalconCLIIT.java
+++ b/webapp/src/test/java/org/apache/falcon/cli/FalconCLIIT.java
@@ -22,6 +22,7 @@ import org.apache.commons.io.FilenameUtils;
 import org.apache.falcon.entity.v0.SchemaHelper;
 import org.apache.falcon.metadata.RelationshipType;
 import org.apache.falcon.resource.TestContext;
+import org.apache.falcon.util.FalconTestUtil;
 import org.apache.falcon.util.OozieTestUtils;
 import org.testng.Assert;
 import org.testng.annotations.AfterClass;
@@ -86,14 +87,16 @@ public class FalconCLIIT {
                 + "/falcon/test/input/2014/11/23/23"), 0);
 
         filePath = TestContext.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE2,
overlay);
-        Assert.assertEquals(executeWithURL("entity -submit -type feed -doAs testUser -file
" + filePath), 0);
+        Assert.assertEquals(executeWithURL("entity -submit -type feed -doAs " + FalconTestUtil.TEST_USER_2
+                + " -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(executeWithURL("entity -submit -type process -doAs testUser -file
" + filePath), 0);
+        Assert.assertEquals(executeWithURL("entity -submit -type process -doAs " + FalconTestUtil.TEST_USER_2
+                + " -file " + filePath), 0);
         Assert.assertEquals(
                 stream.buffer.toString().trim(),
                 "falcon/default/Submit successful (process) "
@@ -115,14 +118,16 @@ public class FalconCLIIT {
         context.setCluster(overlay.get("cluster"));
 
         filePath = TestContext.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE1,
overlay);
-        Assert.assertEquals(executeWithURL("entity -submitAndSchedule -type feed -doAs testUser
-file " + filePath), 0);
+        Assert.assertEquals(executeWithURL("entity -submitAndSchedule -type feed -doAs "
+ FalconTestUtil.TEST_USER_2
+                + " -file " + filePath), 0);
         filePath = TestContext.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE2,
overlay);
         Assert.assertEquals(executeWithURL("entity -submitAndSchedule -type feed -file "
+ filePath), 0);
         filePath = TestContext.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE1,
overlay);
         Assert.assertEquals(executeWithURL("entity -submit -type feed -file " + filePath),
0);
 
         filePath = TestContext.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE2,
overlay);
-        Assert.assertEquals(executeWithURL("entity -submit -type feed -doAs testUser -file
" + filePath), 0);
+        Assert.assertEquals(executeWithURL("entity -submit -type feed -doAs " + FalconTestUtil.TEST_USER_2
+                + " -file " + filePath), 0);
 
         filePath = TestContext.overlayParametersOverTemplate(TestContext.PROCESS_TEMPLATE,
overlay);
         Assert.assertEquals(executeWithURL("entity -submitAndSchedule -type process -file
" + filePath), 0);
@@ -153,7 +158,8 @@ public class FalconCLIIT {
 
         filePath = TestContext.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE2,
overlay);
         Assert.assertEquals(executeWithURL("entity -validate -type feed -file " + filePath),
0);
-        Assert.assertEquals(executeWithURL("entity -submit -type feed -doAs testUser -file
" + filePath), 0);
+        Assert.assertEquals(executeWithURL("entity -submit -type feed -doAs " + FalconTestUtil.TEST_USER_2
+                + " -file " + filePath), 0);
 
         filePath = TestContext.overlayParametersOverTemplate(TestContext.PROCESS_TEMPLATE,
overlay);
         Assert.assertEquals(executeWithURL("entity -validate -type process -file " + filePath),
0);
@@ -170,8 +176,8 @@ public class FalconCLIIT {
 
         Assert.assertEquals(executeWithURL("entity -definition -type feed -name " + overlay.get("inputFeedName")),
0);
 
-        Assert.assertEquals(executeWithURL("entity -definition -type feed  -doAs testUser
-name " + overlay.get(
-            "outputFeedName")), 0);
+        Assert.assertEquals(executeWithURL("entity -definition -type feed  -doAs " + FalconTestUtil.TEST_USER_2
+                + " -name " + overlay.get("outputFeedName")), 0);
 
         Assert.assertEquals(executeWithURL("entity -definition -type process -name " + overlay.get("processName")),
0);
 
@@ -185,8 +191,8 @@ public class FalconCLIIT {
 
         Assert.assertEquals(executeWithURL("entity -schedule -type cluster -name " + overlay.get("cluster")),
-1);
 
-        Assert.assertEquals(executeWithURL("entity -schedule -type feed -doAs testUser -name
" + overlay.get(
-            "inputFeedName")), 0);
+        Assert.assertEquals(executeWithURL("entity -schedule -type feed -doAs " + FalconTestUtil.TEST_USER_2
+                + " -name " + overlay.get("inputFeedName")), 0);
 
         Assert.assertEquals(executeWithURL("entity -schedule -type feed -name " + overlay.get("outputFeedName")),
0);
 
@@ -228,15 +234,15 @@ public class FalconCLIIT {
         Map<String, String> overlay = context.getUniqueOverlay();
         submitTestFiles(context, overlay);
 
-        Assert.assertEquals(executeWithURL("entity -status -type feed -doAs testUser -name
"
-                + overlay.get("inputFeedName")), 0);
+        Assert.assertEquals(executeWithURL("entity -status -type feed -doAs " + FalconTestUtil.TEST_USER_2
+                + " -name " + overlay.get("inputFeedName")), 0);
 
         Assert.assertEquals(executeWithURL("entity -status -type feed -name " + overlay.get("outputFeedName")),
0);
 
         Assert.assertEquals(executeWithURL("entity -status -type process -name " + overlay.get("processName")),
0);
 
-        Assert.assertEquals(executeWithURL("entity -schedule -type feed -doAs testUser  -name
"
-                + overlay.get("inputFeedName")), 0);
+        Assert.assertEquals(executeWithURL("entity -schedule -type feed -doAs " + FalconTestUtil.TEST_USER_2
+                + " -name " + overlay.get("inputFeedName")), 0);
 
         Assert.assertEquals(executeWithURL("entity -schedule -type feed -name " + overlay.get("outputFeedName")),
0);
 
@@ -244,29 +250,29 @@ public class FalconCLIIT {
 
         OozieTestUtils.waitForProcessWFtoStart(context);
 
-        Assert.assertEquals(executeWithURL("entity -suspend -type feed -doAs testUser -name
"
-                + overlay.get("inputFeedName")), 0);
+        Assert.assertEquals(executeWithURL("entity -suspend -type feed -doAs " + FalconTestUtil.TEST_USER_2
+                + " -name " + overlay.get("inputFeedName")), 0);
 
         Assert.assertEquals(executeWithURL("entity -suspend -type feed -name " + overlay.get("outputFeedName")),
0);
 
         Assert.assertEquals(executeWithURL("entity -suspend -type process -name " + overlay.get("processName")),
0);
 
-        Assert.assertEquals(executeWithURL("entity -status -type feed -doAs testUser -name
"
-                + overlay.get("inputFeedName")), 0);
+        Assert.assertEquals(executeWithURL("entity -status -type feed -doAs " + FalconTestUtil.TEST_USER_2
+                + " -name " + overlay.get("inputFeedName")), 0);
 
         Assert.assertEquals(executeWithURL("entity -status -type feed -name " + overlay.get("outputFeedName")),
0);
 
         Assert.assertEquals(executeWithURL("entity -status -type process -name " + overlay.get("processName")),
0);
 
-        Assert.assertEquals(executeWithURL("entity -resume -type feed -doAs testUse -name
"
-                + overlay.get("inputFeedName")), 0);
+        Assert.assertEquals(executeWithURL("entity -resume -type feed -doAs " + FalconTestUtil.TEST_USER_2
+                + " -name " + overlay.get("inputFeedName")), 0);
 
         Assert.assertEquals(executeWithURL("entity -resume -type feed -name " + overlay.get("outputFeedName")),
0);
 
         Assert.assertEquals(executeWithURL("entity -resume -type process -name " + overlay.get("processName")),
0);
 
-        Assert.assertEquals(executeWithURL("entity -status -type feed -doAs testUse -name
"
-                + overlay.get("inputFeedName")), 0);
+        Assert.assertEquals(executeWithURL("entity -status -type feed -doAs " + FalconTestUtil.TEST_USER_2
+                + " -name " + overlay.get("inputFeedName")), 0);
 
         Assert.assertEquals(executeWithURL("entity -status -type feed -name " + overlay.get("outputFeedName")),
0);
 
@@ -292,7 +298,8 @@ public class FalconCLIIT {
                 + " -offset 0 -numResults 1 -numInstances 7"), -1);
 
         // No start or end date and with doAs option
-        Assert.assertEquals(executeWithURL("entity -summary -type process -doAs testUser
-fields status,pipelines"
+        Assert.assertEquals(executeWithURL("entity -summary -type process -doAs " + FalconTestUtil.TEST_USER_2
+                + " -fields status,pipelines"
                 + " -cluster " + overlay.get("cluster")
                 + " -filterBy TYPE:PROCESS -orderBy name "
                 + " -offset 0 -numResults 1 -numInstances 7"), 0);
@@ -313,11 +320,11 @@ public class FalconCLIIT {
 
         Assert.assertEquals(executeWithURL("entity -delete -type feed -name " + overlay.get("inputFeedName")),
-1);
 
-        Assert.assertEquals(executeWithURL("entity -delete -type feed -doAs testUser -name
"
+        Assert.assertEquals(executeWithURL("entity -delete -type feed -doAs " + FalconTestUtil.TEST_USER_2
+ " -name "
                 + overlay.get("outputFeedName")), -1);
 
-        Assert.assertEquals(executeWithURL("entity -delete -type process -doAs testUser -name
"
-                + overlay.get("processName")), 0);
+        Assert.assertEquals(executeWithURL("entity -delete -type process -doAs " + FalconTestUtil.TEST_USER_2
+                + " -name " + overlay.get("processName")), 0);
 
         Assert.assertEquals(executeWithURL("entity -delete -type feed -name " + overlay.get("inputFeedName")),
0);
 
@@ -349,8 +356,8 @@ public class FalconCLIIT {
                 + " -instanceTime 2010-01-01T00:00Z"), 0);
 
         //Test the dependency command with doAs
-        Assert.assertEquals(executeWithURL("instance -dependency -type feed -doAs testUser
-name "
-                + overlay.get("inputFeedName") + " -instanceTime 2010-01-01T00:00Z"), 0);
+        Assert.assertEquals(executeWithURL("instance -dependency -type feed -doAs " + FalconTestUtil.TEST_USER_2
+                + " -name " + overlay.get("inputFeedName") + " -instanceTime 2010-01-01T00:00Z"),
0);
 
         Assert.assertEquals(executeWithURL("instance -status -type feed -name "
                 + overlay.get("outputFeedName")
@@ -358,8 +365,8 @@ public class FalconCLIIT {
 
         Assert.assertEquals(executeWithURL("instance -running -type process -name " + overlay.get("processName")),
0);
         // with doAs
-        Assert.assertEquals(executeWithURL("instance -running -type process -doAs testUser
-name "
-                + overlay.get("processName")), 0);
+        Assert.assertEquals(executeWithURL("instance -running -type process -doAs " + FalconTestUtil.TEST_USER_2
+                + " -name " + overlay.get("processName")), 0);
 
         Assert.assertEquals(executeWithURL("instance -running -type feed -lifecycle eviction
-name "
                 + overlay.get("outputFeedName") + " -start " + SchemaHelper.getDateFormat().format(new
Date())), 0);
@@ -371,8 +378,8 @@ public class FalconCLIIT {
                 + overlay.get("processName") + " -start " + START_INSTANCE), 0);
 
         //TEst instance status with doAs
-        Assert.assertEquals(executeWithURL("instance -status -type process -doAs testUser
-name "
-                + overlay.get("processName") + " -start " + START_INSTANCE), 0);
+        Assert.assertEquals(executeWithURL("instance -status -type process -doAs " + FalconTestUtil.TEST_USER_2
+                + " -name " + overlay.get("processName") + " -start " + START_INSTANCE),
0);
 
 
         Assert.assertEquals(executeWithURL("instance -status -type feed -lifecycle eviction,replication
-name "
@@ -386,8 +393,8 @@ public class FalconCLIIT {
                 + overlay.get("processName") + " -start " + START_INSTANCE), 0);
 
         // doAs option
-        Assert.assertEquals(executeWithURL("instance -params -type process -doAs testUser
-name "
-                + overlay.get("processName") + " -start " + START_INSTANCE), 0);
+        Assert.assertEquals(executeWithURL("instance -params -type process -doAs " + FalconTestUtil.TEST_USER_2
+                + " -name " + overlay.get("processName") + " -start " + START_INSTANCE),
0);
 
         // test filterBy, orderBy, offset, numResults
         String startTimeString = SchemaHelper.getDateFormat().format(new Date());
@@ -442,8 +449,9 @@ public class FalconCLIIT {
                 + " -orderBy startTime -sortOrder desc -offset 0 -numResults 1"), 0);
 
         //Test list with doAs
-        Assert.assertEquals(executeWithURL("instance -list -type feed -doAs testUser -name
"
-                + overlay.get("outputFeedName") + " -start " + SchemaHelper.getDateFormat().format(new
Date())), 0);
+        Assert.assertEquals(executeWithURL("instance -list -type feed -doAs " + FalconTestUtil.TEST_USER_2
+                + " -name " + overlay.get("outputFeedName") + " -start "
+                + SchemaHelper.getDateFormat().format(new Date())), 0);
 
         Assert.assertEquals(executeWithURL("instance -list -type feed -lifecycle eviction
-name "
                 + overlay.get("outputFeedName")
@@ -495,15 +503,15 @@ public class FalconCLIIT {
         Assert.assertEquals(executeWithURL("instance -running -type process -name " + overlay.get("processName")),
0);
 
         //with doAs
-        Assert.assertEquals(executeWithURL("instance -running -type process -doAs testUser
-name "
-                + overlay.get("processName")), 0);
+        Assert.assertEquals(executeWithURL("instance -running -type process -doAs " + FalconTestUtil.TEST_USER_2
+                + " -name " + overlay.get("processName")), 0);
 
         Assert.assertEquals(executeWithURL("instance -summary -type process -name "
                 + overlay.get("processName") + " -start " + START_INSTANCE), 0);
 
         //with doAs
-        Assert.assertEquals(executeWithURL("instance -summary -type process -doAs testUser
-name "
-                + overlay.get("processName") + " -start " + START_INSTANCE), 0);
+        Assert.assertEquals(executeWithURL("instance -summary -type process -doAs " + FalconTestUtil.TEST_USER_2
+                + " -name " + overlay.get("processName") + " -start " + START_INSTANCE),
0);
 
         Assert.assertEquals(executeWithURL("instance -summary -type feed -lifecycle eviction
-name "
                 + overlay.get("outputFeedName")
@@ -514,8 +522,8 @@ public class FalconCLIIT {
                 + " -start " + START_INSTANCE), 0);
 
         //with doAs
-        Assert.assertEquals(executeWithURL("instance -params -type process -doAs testUser
-name "
-                + overlay.get("processName") + " -start " + START_INSTANCE), 0);
+        Assert.assertEquals(executeWithURL("instance -params -type process -doAs " + FalconTestUtil.TEST_USER_2
+                + " -name " + overlay.get("processName") + " -start " + START_INSTANCE),
0);
     }
 
     public void testInstanceSuspendAndResume() throws Exception {
@@ -533,9 +541,8 @@ public class FalconCLIIT {
                 + overlay.get("inputFeedName")
                 + " -start " + START_INSTANCE + " -end " + START_INSTANCE), 0);
 
-        Assert.assertEquals(executeWithURL("instance -suspend -type process -doAs testUser
-name "
-                + overlay.get("processName")
-                + " -start " + START_INSTANCE + " -end " + START_INSTANCE), 0);
+        Assert.assertEquals(executeWithURL("instance -suspend -type process -doAs " + FalconTestUtil.TEST_USER_2
+                + " -name " + overlay.get("processName") + " -start " + START_INSTANCE +
" -end " + START_INSTANCE), 0);
 
         // No end date, should fail.
         Assert.assertEquals(executeWithURL("instance -suspend -type feed -lifecycle eviction
-name "
@@ -546,7 +553,7 @@ public class FalconCLIIT {
                 + overlay.get("processName")
                 + " -start " + START_INSTANCE + " -end " + START_INSTANCE), 0);
 
-        Assert.assertEquals(executeWithURL("instance -resume -type feed -doAs testUser -name
"
+        Assert.assertEquals(executeWithURL("instance -resume -type feed -doAs " + FalconTestUtil.TEST_USER_2
+ " -name "
                 + overlay.get("inputFeedName")
                 + " -start " + START_INSTANCE + " -end " + START_INSTANCE), 0);
 
@@ -565,7 +572,7 @@ public class FalconCLIIT {
 
         Assert.assertEquals(executeWithURL("entity -schedule -type process -name " + overlay.get("processName")),
0);
 
-        Assert.assertEquals(executeWithURL("entity -schedule -type feed -doAs testUser -name
"
+        Assert.assertEquals(executeWithURL("entity -schedule -type feed -doAs " + FalconTestUtil.TEST_USER_2
+ " -name "
                 + overlay.get("inputFeedName")), 0);
 
         Assert.assertEquals(executeWithURL("entity -schedule -type feed -name " + overlay.get("outputFeedName")),
0);
@@ -575,7 +582,7 @@ public class FalconCLIIT {
                 + overlay.get("processName")
                 + " -start " + START_INSTANCE + " -end " + START_INSTANCE), 0);
 
-        Assert.assertEquals(executeWithURL("instance -kill -type feed -doAs testUser -name
"
+        Assert.assertEquals(executeWithURL("instance -kill -type feed -doAs " + FalconTestUtil.TEST_USER_2
+ " -name "
                 + overlay.get("inputFeedName")
                 + " -start " + START_INSTANCE + " -end " + START_INSTANCE), 0);
 
@@ -589,7 +596,7 @@ public class FalconCLIIT {
                 + " -start " + START_INSTANCE + " -end " + START_INSTANCE
                 + " -file " + createTempJobPropertiesFile()), 0);
 
-        Assert.assertEquals(executeWithURL("instance -rerun -type feed -doAs testUser -name
"
+        Assert.assertEquals(executeWithURL("instance -rerun -type feed -doAs " + FalconTestUtil.TEST_USER_2
+ " -name "
                 + overlay.get("inputFeedName")
                 + " -start " + START_INSTANCE + " -end " + START_INSTANCE
                 + " -file " + createTempJobPropertiesFile()), 0);
@@ -622,7 +629,8 @@ public class FalconCLIIT {
         Assert.assertEquals(executeWithURL("entity -submit -type process -file " + filePath),
0);
 
         Assert.assertEquals(executeWithURL("metadata -lineage -pipeline testPipeline"), 0);
-        Assert.assertEquals(executeWithURL("metadata -lineage -doAs testUser -pipeline testPipeline"),
0);
+        Assert.assertEquals(executeWithURL("metadata -lineage -doAs " + FalconTestUtil.TEST_USER_2
+                + " -pipeline testPipeline"), 0);
     }
 
     @Test
@@ -696,8 +704,8 @@ public class FalconCLIIT {
         Assert.assertEquals(executeWithURL("instance -running -type process -name " + overlay.get("processName")),
0);
 
         // with doAs
-        Assert.assertEquals(executeWithURL("entity -list -type process -doAs testUser -fields
status "
-                + " -filterBy STATUS:SUBMITTED,TYPE:process -orderBy name "
+        Assert.assertEquals(executeWithURL("entity -list -type process -doAs " + FalconTestUtil.TEST_USER_2
+                + " -fields status -filterBy STATUS:SUBMITTED,TYPE:process -orderBy name
"
                 + " -sortOrder asc -offset 1 -numResults 1"), 0);
     }
 
@@ -722,7 +730,7 @@ public class FalconCLIIT {
 
         String metadataListCommand = FalconCLI.METADATA_CMD + " -" + FalconMetadataCLI.LIST_OPT
+ " -"
                 + FalconMetadataCLI.TYPE_OPT + " ";
-        String metadataListCommandWithDoAs = FalconCLI.METADATA_CMD + " -doAs testUser" +
" -"
+        String metadataListCommandWithDoAs = FalconCLI.METADATA_CMD + " -doAs " + FalconTestUtil.TEST_USER_2
+ " -"
                 + FalconMetadataCLI.LIST_OPT + " -"
                 + FalconMetadataCLI.TYPE_OPT + " ";
 
@@ -767,7 +775,7 @@ public class FalconCLIIT {
         String metadataRelationsCommand = FalconCLI.METADATA_CMD + " -" + FalconMetadataCLI.RELATIONS_OPT
+ " -"
                 + FalconMetadataCLI.TYPE_OPT + " ";
 
-        String metadataRelationsCommandWithDoAs = FalconCLI.METADATA_CMD + " -doAs testUser"
+        String metadataRelationsCommandWithDoAs = FalconCLI.METADATA_CMD + " -doAs " + FalconTestUtil.TEST_USER_2
                 + " -" + FalconMetadataCLI.RELATIONS_OPT + " -"
                 + FalconMetadataCLI.TYPE_OPT + " ";
 
@@ -866,19 +874,19 @@ public class FalconCLIIT {
 
     public void testGetVersion() throws Exception {
         Assert.assertEquals(new FalconCLI().run(("admin -version -url " + TestContext.BASE_URL).split("\\s")),
0);
-        Assert.assertEquals(new FalconCLI().run(("admin -doAs testUser -version -url "
+        Assert.assertEquals(new FalconCLI().run(("admin -doAs " + FalconTestUtil.TEST_USER_2
+ " -version -url "
                 + TestContext.BASE_URL).split("\\s")), 0);
     }
 
     public void testGetStatus() throws Exception {
         Assert.assertEquals(new FalconCLI().run(("admin -status -url " + TestContext.BASE_URL).split("\\s")),
0);
-        Assert.assertEquals(new FalconCLI().run(("admin -doAs testUser -status -url "
+        Assert.assertEquals(new FalconCLI().run(("admin -doAs " + FalconTestUtil.TEST_USER_2
+ " -status -url "
                 + TestContext.BASE_URL).split("\\s")), 0);
     }
 
     public void testGetThreadStackDump() throws Exception {
         Assert.assertEquals(new FalconCLI().run(("admin -stack -url " + TestContext.BASE_URL).split("\\s")),
0);
-        Assert.assertEquals(new FalconCLI().run(("admin -doAs testUser -stack -url "
+        Assert.assertEquals(new FalconCLI().run(("admin -doAs " + FalconTestUtil.TEST_USER_2
+ " -stack -url "
                 + TestContext.BASE_URL).split("\\s")), 0);
     }
 
@@ -902,8 +910,9 @@ public class FalconCLIIT {
                 + " -start "+ SchemaHelper.getDateFormat().format(new Date())), 0);
 
         // with doAs
-        Assert.assertEquals(executeWithURL("instance -logs -doAs testUser -type feed -lifecycle
eviction -name "
-                + overlay.get("outputFeedName") + " -start "+ SchemaHelper.getDateFormat().format(new
Date())), 0);
+        Assert.assertEquals(executeWithURL("instance -logs -doAs " + FalconTestUtil.TEST_USER_2
+ " -type feed "
+                + "-lifecycle eviction -name " + overlay.get("outputFeedName") + " -start
"
+                + SchemaHelper.getDateFormat().format(new Date())), 0);
 
         // test filterBy, orderBy, offset, numResults
         Assert.assertEquals(executeWithURL("instance -logs -type process -name "

http://git-wip-us.apache.org/repos/asf/falcon/blob/9a2acebf/webapp/src/test/java/org/apache/falcon/resource/EntityManagerJerseyIT.java
----------------------------------------------------------------------
diff --git a/webapp/src/test/java/org/apache/falcon/resource/EntityManagerJerseyIT.java b/webapp/src/test/java/org/apache/falcon/resource/EntityManagerJerseyIT.java
index 6d375c0..384c8a0 100644
--- a/webapp/src/test/java/org/apache/falcon/resource/EntityManagerJerseyIT.java
+++ b/webapp/src/test/java/org/apache/falcon/resource/EntityManagerJerseyIT.java
@@ -34,6 +34,7 @@ import org.apache.falcon.entity.v0.process.Property;
 import org.apache.falcon.entity.v0.process.Validity;
 import org.apache.falcon.util.BuildProperties;
 import org.apache.falcon.util.DeploymentProperties;
+import org.apache.falcon.util.FalconTestUtil;
 import org.apache.falcon.util.OozieTestUtils;
 import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.FileSystem;
@@ -648,7 +649,7 @@ public class EntityManagerJerseyIT {
         File tmpFile = TestContext.getTempFile();
         EntityType.PROCESS.getMarshaller().marshal(process, tmpFile);
         if (withDoAs) {
-            context.scheduleProcess(tmpFile.getAbsolutePath(), overlay, null, "testUser",
null);
+            context.scheduleProcess(tmpFile.getAbsolutePath(), overlay, null, FalconTestUtil.TEST_USER_2,
null);
         } else {
             context.scheduleProcess(tmpFile.getAbsolutePath(), overlay, null, "", "key1:value1");
         }
@@ -657,7 +658,7 @@ public class EntityManagerJerseyIT {
         WebResource resource = context.service.path("api/entities/delete/process/" + context.processName);
 
         if (withDoAs) {
-            resource = resource.queryParam(FalconCLI.DO_AS_OPT, "testUser");
+            resource = resource.queryParam(FalconCLI.DO_AS_OPT, FalconTestUtil.TEST_USER_2);
         }
 
         //Delete a scheduled process

http://git-wip-us.apache.org/repos/asf/falcon/blob/9a2acebf/webapp/src/test/java/org/apache/falcon/resource/MetadataResourceJerseyIT.java
----------------------------------------------------------------------
diff --git a/webapp/src/test/java/org/apache/falcon/resource/MetadataResourceJerseyIT.java
b/webapp/src/test/java/org/apache/falcon/resource/MetadataResourceJerseyIT.java
index 749dfa5..41cdbbf 100644
--- a/webapp/src/test/java/org/apache/falcon/resource/MetadataResourceJerseyIT.java
+++ b/webapp/src/test/java/org/apache/falcon/resource/MetadataResourceJerseyIT.java
@@ -22,6 +22,7 @@ import com.sun.jersey.api.client.ClientResponse;
 import org.apache.falcon.entity.v0.EntityType;
 import org.apache.falcon.resource.metadata.AbstractMetadataResource;
 import org.apache.falcon.util.DeploymentUtil;
+import org.apache.falcon.util.FalconTestUtil;
 import org.json.simple.JSONValue;
 import org.testng.Assert;
 import org.testng.annotations.AfterClass;
@@ -93,7 +94,7 @@ public class MetadataResourceJerseyIT {
         response = context.service
                 .path("api/metadata/discovery/process_entity/list")
                 .queryParam("cluster", "random")
-                .queryParam("doAs", "testUser")
+                .queryParam("doAs", FalconTestUtil.TEST_USER_2)
                 .header("Cookie", context.getAuthenticationToken())
                 .accept(MediaType.APPLICATION_JSON)
                 .get(ClientResponse.class);


Mime
View raw message