hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject hadoop git commit: MAPREDUCE-6333. TestEvents, TestAMWebServicesTasks, TestAppController are broken due to MAPREDUCE-6297. (Siqi Li via gera)
Date Sat, 25 Apr 2015 00:36:29 GMT
Repository: hadoop
Updated Branches:
  refs/heads/trunk 2f82ae042 -> 78c6b4624


MAPREDUCE-6333. TestEvents,TestAMWebServicesTasks,TestAppController are broken due to MAPREDUCE-6297.
(Siqi Li via gera)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/78c6b462
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/78c6b462
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/78c6b462

Branch: refs/heads/trunk
Commit: 78c6b462412bbadad4a1a13ed4c597927b0cf188
Parents: 2f82ae0
Author: Gera Shegalov <gera@apache.org>
Authored: Fri Apr 24 09:21:44 2015 -0700
Committer: Gera Shegalov <gera@apache.org>
Committed: Fri Apr 24 17:31:10 2015 -0700

----------------------------------------------------------------------
 hadoop-mapreduce-project/CHANGES.txt            |  3 ++
 .../hadoop/mapreduce/jobhistory/TestEvents.java | 29 ++++++++++----------
 .../v2/app/webapp/TestAMWebServicesTasks.java   | 27 ++++++++++++------
 .../v2/app/webapp/TestAppController.java        |  9 +++---
 4 files changed, 41 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/78c6b462/hadoop-mapreduce-project/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt
index 5b26910..397f94a 100644
--- a/hadoop-mapreduce-project/CHANGES.txt
+++ b/hadoop-mapreduce-project/CHANGES.txt
@@ -343,6 +343,9 @@ Release 2.8.0 - UNRELEASED
     MAPREDUCE-6330. Fix typo in Task Attempt API's URL in documentations.
     (Ryu Kobayashi via ozawa)
 
+    MAPREDUCE-6333. TestEvents,TestAMWebServicesTasks,TestAppController are
+    broken due to MAPREDUCE-6297. (Siqi Li via gera)
+
 Release 2.7.1 - UNRELEASED
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/78c6b462/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/jobhistory/TestEvents.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/jobhistory/TestEvents.java
b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/jobhistory/TestEvents.java
index 00be4b8..bb9b56b 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/jobhistory/TestEvents.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/jobhistory/TestEvents.java
@@ -39,6 +39,7 @@ import org.junit.Test;
 
 public class TestEvents {
 
+  private static final String taskId = "task_1_2_r_3";
   /**
    * test a getters of TaskAttemptFinishedEvent and TaskAttemptFinished
    * 
@@ -131,7 +132,7 @@ public class TestEvents {
 
     e = reader.getNextEvent();
     assertTrue(e.getEventType().equals(EventType.REDUCE_ATTEMPT_KILLED));
-    assertEquals("task_1_2_r03_4",
+    assertEquals(taskId,
         ((TaskAttemptUnsuccessfulCompletion) e.getDatum()).taskid.toString());
 
     e = reader.getNextEvent();
@@ -141,42 +142,42 @@ public class TestEvents {
 
     e = reader.getNextEvent();
     assertTrue(e.getEventType().equals(EventType.REDUCE_ATTEMPT_STARTED));
-    assertEquals("task_1_2_r03_4",
+    assertEquals(taskId,
         ((TaskAttemptStarted) e.getDatum()).taskid.toString());
 
     e = reader.getNextEvent();
     assertTrue(e.getEventType().equals(EventType.REDUCE_ATTEMPT_FINISHED));
-    assertEquals("task_1_2_r03_4",
+    assertEquals(taskId,
         ((TaskAttemptFinished) e.getDatum()).taskid.toString());
 
     e = reader.getNextEvent();
     assertTrue(e.getEventType().equals(EventType.REDUCE_ATTEMPT_KILLED));
-    assertEquals("task_1_2_r03_4",
+    assertEquals(taskId,
         ((TaskAttemptUnsuccessfulCompletion) e.getDatum()).taskid.toString());
 
     e = reader.getNextEvent();
     assertTrue(e.getEventType().equals(EventType.REDUCE_ATTEMPT_KILLED));
-    assertEquals("task_1_2_r03_4",
+    assertEquals(taskId,
         ((TaskAttemptUnsuccessfulCompletion) e.getDatum()).taskid.toString());
 
     e = reader.getNextEvent();
     assertTrue(e.getEventType().equals(EventType.REDUCE_ATTEMPT_STARTED));
-    assertEquals("task_1_2_r03_4",
+    assertEquals(taskId,
         ((TaskAttemptStarted) e.getDatum()).taskid.toString());
 
     e = reader.getNextEvent();
     assertTrue(e.getEventType().equals(EventType.REDUCE_ATTEMPT_FINISHED));
-    assertEquals("task_1_2_r03_4",
+    assertEquals(taskId,
         ((TaskAttemptFinished) e.getDatum()).taskid.toString());
 
     e = reader.getNextEvent();
     assertTrue(e.getEventType().equals(EventType.REDUCE_ATTEMPT_KILLED));
-    assertEquals("task_1_2_r03_4",
+    assertEquals(taskId,
         ((TaskAttemptUnsuccessfulCompletion) e.getDatum()).taskid.toString());
 
     e = reader.getNextEvent();
     assertTrue(e.getEventType().equals(EventType.REDUCE_ATTEMPT_KILLED));
-    assertEquals("task_1_2_r03_4",
+    assertEquals(taskId,
         ((TaskAttemptUnsuccessfulCompletion) e.getDatum()).taskid.toString());
 
     reader.close();
@@ -234,7 +235,7 @@ public class TestEvents {
     datum.hostname = "hostname";
     datum.rackname = "rackname";
     datum.physMemKbytes = Arrays.asList(1000, 2000, 3000);
-    datum.taskid = "task_1_2_r03_4";
+    datum.taskid = taskId;
     datum.port = 1000;
     datum.taskType = "REDUCE";
     datum.status = "STATUS";
@@ -260,7 +261,7 @@ public class TestEvents {
     datum.hostname = "hostname";
     datum.rackname = "rackName";
     datum.state = "state";
-    datum.taskid = "task_1_2_r03_4";
+    datum.taskid = taskId;
     datum.taskStatus = "taskStatus";
     datum.taskType = "REDUCE";
     result.setDatum(datum);
@@ -278,7 +279,7 @@ public class TestEvents {
     datum.locality = "locality";
     datum.shufflePort = 10001;
     datum.startTime = 1;
-    datum.taskid = "task_1_2_r03_4";
+    datum.taskid = taskId;
     datum.taskType = "taskType";
     datum.trackerName = "trackerName";
     result.setDatum(datum);
@@ -308,7 +309,7 @@ public class TestEvents {
     datum.hostname = "hostname";
     datum.rackname = "rackname";
     datum.state = "state";
-    datum.taskid = "task_1_2_r03_4";
+    datum.taskid = taskId;
     datum.taskStatus = "taskStatus";
     datum.taskType = "REDUCE";
     result.setDatum(datum);
@@ -325,7 +326,7 @@ public class TestEvents {
     datum.locality = "locality";
     datum.shufflePort = 10001;
     datum.startTime = 1;
-    datum.taskid = "task_1_2_r03_4";
+    datum.taskid = taskId;
     datum.taskType = "taskType";
     datum.trackerName = "trackerName";
     result.setDatum(datum);

http://git-wip-us.apache.org/repos/asf/hadoop/blob/78c6b462/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/webapp/TestAMWebServicesTasks.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/webapp/TestAMWebServicesTasks.java
b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/webapp/TestAMWebServicesTasks.java
index 8bf1bb7..15ef5ac 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/webapp/TestAMWebServicesTasks.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/webapp/TestAMWebServicesTasks.java
@@ -31,6 +31,7 @@ import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 
 import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.mapreduce.TaskID;
 import org.apache.hadoop.mapreduce.v2.api.records.JobId;
 import org.apache.hadoop.mapreduce.v2.api.records.TaskId;
 import org.apache.hadoop.mapreduce.v2.api.records.TaskReport;
@@ -355,9 +356,11 @@ public class TestAMWebServicesTasks extends JerseyTest {
         String message = exception.getString("message");
         String type = exception.getString("exception");
         String classname = exception.getString("javaClassName");
-        WebServicesTestUtils.checkStringMatch("exception message",
+        WebServicesTestUtils.checkStringEqual("exception message",
             "java.lang.Exception: TaskId string : "
-                + "bogustaskid is not properly formed", message);
+                + "bogustaskid is not properly formed"
+                + "\nReason: java.util.regex.Matcher[pattern=" +
+                TaskID.TASK_ID_REGEX + " region=0,11 lastmatch=]", message);
         WebServicesTestUtils.checkStringMatch("exception type",
             "NotFoundException", type);
         WebServicesTestUtils.checkStringMatch("exception classname",
@@ -419,9 +422,11 @@ public class TestAMWebServicesTasks extends JerseyTest {
         String message = exception.getString("message");
         String type = exception.getString("exception");
         String classname = exception.getString("javaClassName");
-        WebServicesTestUtils.checkStringMatch("exception message",
-            "java.lang.Exception: Bad TaskType identifier. TaskId string : "
-                + "task_0_0000_d_000000 is not properly formed.", message);
+        WebServicesTestUtils.checkStringEqual("exception message",
+            "java.lang.Exception: TaskId string : "
+                + "task_0_0000_d_000000 is not properly formed"
+                + "\nReason: java.util.regex.Matcher[pattern=" +
+                TaskID.TASK_ID_REGEX + " region=0,20 lastmatch=]", message);
         WebServicesTestUtils.checkStringMatch("exception type",
             "NotFoundException", type);
         WebServicesTestUtils.checkStringMatch("exception classname",
@@ -451,9 +456,11 @@ public class TestAMWebServicesTasks extends JerseyTest {
         String message = exception.getString("message");
         String type = exception.getString("exception");
         String classname = exception.getString("javaClassName");
-        WebServicesTestUtils.checkStringMatch("exception message",
+        WebServicesTestUtils.checkStringEqual("exception message",
             "java.lang.Exception: TaskId string : "
-                + "task_0_m_000000 is not properly formed", message);
+                + "task_0_m_000000 is not properly formed"
+                + "\nReason: java.util.regex.Matcher[pattern=" +
+                TaskID.TASK_ID_REGEX + " region=0,15 lastmatch=]", message);
         WebServicesTestUtils.checkStringMatch("exception type",
             "NotFoundException", type);
         WebServicesTestUtils.checkStringMatch("exception classname",
@@ -483,9 +490,11 @@ public class TestAMWebServicesTasks extends JerseyTest {
         String message = exception.getString("message");
         String type = exception.getString("exception");
         String classname = exception.getString("javaClassName");
-        WebServicesTestUtils.checkStringMatch("exception message",
+        WebServicesTestUtils.checkStringEqual("exception message",
             "java.lang.Exception: TaskId string : "
-                + "task_0_0000_m is not properly formed", message);
+                + "task_0_0000_m is not properly formed"
+                + "\nReason: java.util.regex.Matcher[pattern=" +
+                TaskID.TASK_ID_REGEX + " region=0,13 lastmatch=]", message);
         WebServicesTestUtils.checkStringMatch("exception type",
             "NotFoundException", type);
         WebServicesTestUtils.checkStringMatch("exception classname",

http://git-wip-us.apache.org/repos/asf/hadoop/blob/78c6b462/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/webapp/TestAppController.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/webapp/TestAppController.java
b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/webapp/TestAppController.java
index c1bc9ef..92786e3 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/webapp/TestAppController.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/webapp/TestAppController.java
@@ -45,6 +45,7 @@ public class TestAppController {
   private AppControllerForTest appController;
   private RequestContext ctx;
   private Job job;
+  private static final String taskId = "task_01_01_m_01";
 
   @Before
   public void setUp() throws IOException {
@@ -70,7 +71,7 @@ public class TestAppController {
 
     appController = new AppControllerForTest(app, configuration, ctx);
     appController.getProperty().put(AMParams.JOB_ID, "job_01_01");
-    appController.getProperty().put(AMParams.TASK_ID, "task_01_01_m01_01");
+    appController.getProperty().put(AMParams.TASK_ID, taskId);
 
   }
 
@@ -205,7 +206,7 @@ public class TestAppController {
         "Access denied: User user does not have permission to view job job_01_01missing task
ID",
         appController.getData());
 
-    appController.getProperty().put(AMParams.TASK_ID, "task_01_01_m01_01");
+    appController.getProperty().put(AMParams.TASK_ID, taskId);
     appController.taskCounters();
     assertEquals(CountersPage.class, appController.getClazz());
   }
@@ -247,7 +248,7 @@ public class TestAppController {
   public void testTask() {
  
     appController.task();
-    assertEquals("Attempts for task_01_01_m01_01" ,
+    assertEquals("Attempts for " + taskId ,
         appController.getProperty().get("title"));
 
     assertEquals(TaskPage.class, appController.getClazz());
@@ -290,7 +291,7 @@ public class TestAppController {
         "Access denied: User user does not have permission to view job job_01_01",
         appController.getData());
 
-    appController.getProperty().put(AMParams.TASK_ID, "task_01_01_m01_01");
+    appController.getProperty().put(AMParams.TASK_ID, taskId);
     appController.attempts();
     assertEquals("Bad request: missing task-type.", appController.getProperty()
         .get("title"));


Mime
View raw message