hadoop-yarn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vino...@apache.org
Subject svn commit: r1580096 - in /hadoop/common/branches/branch-2.4/hadoop-yarn-project: CHANGES.txt hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMFailover.java
Date Sat, 22 Mar 2014 00:26:00 GMT
Author: vinodkv
Date: Sat Mar 22 00:26:00 2014
New Revision: 1580096

URL: http://svn.apache.org/r1580096
Log:
YARN-1863. Fixed test failure in TestRMFailover after YARN-1859. Contributed by Xuan Gong.
svn merge --ignore-ancestry -c 1580094 ../../trunk/

Modified:
    hadoop/common/branches/branch-2.4/hadoop-yarn-project/CHANGES.txt
    hadoop/common/branches/branch-2.4/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMFailover.java

Modified: hadoop/common/branches/branch-2.4/hadoop-yarn-project/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2.4/hadoop-yarn-project/CHANGES.txt?rev=1580096&r1=1580095&r2=1580096&view=diff
==============================================================================
--- hadoop/common/branches/branch-2.4/hadoop-yarn-project/CHANGES.txt (original)
+++ hadoop/common/branches/branch-2.4/hadoop-yarn-project/CHANGES.txt Sat Mar 22 00:26:00
2014
@@ -493,6 +493,9 @@ Release 2.4.0 - UNRELEASED
     YARN-1849. Fixed NPE in ResourceTrackerService#registerNodeManager for UAM
     (Karthik Kambatla via jianhe )
 
+    YARN-1863. Fixed test failure in TestRMFailover after YARN-1859. (Xuan Gong
+    via vinodkv)
+
 Release 2.3.1 - UNRELEASED
 
   INCOMPATIBLE CHANGES

Modified: hadoop/common/branches/branch-2.4/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMFailover.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2.4/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMFailover.java?rev=1580096&r1=1580095&r2=1580096&view=diff
==============================================================================
--- hadoop/common/branches/branch-2.4/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMFailover.java
(original)
+++ hadoop/common/branches/branch-2.4/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMFailover.java
Sat Mar 22 00:26:00 2014
@@ -39,7 +39,6 @@ import org.apache.hadoop.yarn.api.record
 import org.apache.hadoop.yarn.client.api.YarnClient;
 import org.apache.hadoop.yarn.conf.HAUtil;
 import org.apache.hadoop.yarn.conf.YarnConfiguration;
-import org.apache.hadoop.yarn.exceptions.ApplicationNotFoundException;
 import org.apache.hadoop.yarn.exceptions.YarnException;
 import org.apache.hadoop.yarn.server.MiniYARNCluster;
 import org.apache.hadoop.yarn.server.resourcemanager.AdminService;
@@ -208,17 +207,19 @@ public class TestRMFailover extends Clie
       webAppProxyServer.start();
       Assert.assertEquals(STATE.STARTED, webAppProxyServer.getServiceState());
 
+      // send httpRequest with fakeApplicationId
+      // expect to get "Not Found" response and 404 response code
       URL wrongUrl = new URL("http://0.0.0.0:9099/proxy/" + fakeAppId);
       HttpURLConnection proxyConn = (HttpURLConnection) wrongUrl
           .openConnection();
 
       proxyConn.connect();
-      verifyExpectedException(proxyConn.getResponseMessage());
+      verifyResponse(proxyConn);
 
       explicitFailover();
       verifyConnections();
       proxyConn.connect();
-      verifyExpectedException(proxyConn.getResponseMessage());
+      verifyResponse(proxyConn);
     } finally {
       webAppProxyServer.stop();
     }
@@ -233,25 +234,26 @@ public class TestRMFailover extends Clie
     getAdminService(0).transitionToActive(req);
     assertFalse("RM never turned active", -1 == cluster.getActiveRMIndex());
     verifyConnections();
+
+    // send httpRequest with fakeApplicationId
+    // expect to get "Not Found" response and 404 response code
     URL wrongUrl = new URL("http://0.0.0.0:18088/proxy/" + fakeAppId);
     HttpURLConnection proxyConn = (HttpURLConnection) wrongUrl
         .openConnection();
 
     proxyConn.connect();
-    verifyExpectedException(proxyConn.getResponseMessage());
+    verifyResponse(proxyConn);
 
     explicitFailover();
     verifyConnections();
     proxyConn.connect();
-    verifyExpectedException(proxyConn.getResponseMessage());
+    verifyResponse(proxyConn);
   }
 
-  private void verifyExpectedException(String exceptionMessage){
-    assertTrue(exceptionMessage.contains(ApplicationNotFoundException.class
-        .getName()));
-    assertTrue(exceptionMessage
-        .contains("Application with id '" + fakeAppId + "' " +
-            "doesn't exist in RM."));
+  private void verifyResponse(HttpURLConnection response)
+      throws IOException {
+    assertEquals("Not Found", response.getResponseMessage());
+    assertEquals(404, response.getResponseCode());
   }
 
   @Test



Mime
View raw message