hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kih...@apache.org
Subject hadoop git commit: YARN-5622. TestYarnCLI.testGetContainers fails due to mismatched date formats. Contributed by Eric Badger.
Date Fri, 23 Sep 2016 19:15:08 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 c872ecaab -> 9dec68c26


YARN-5622. TestYarnCLI.testGetContainers fails due to mismatched date formats. Contributed
by Eric Badger.

(cherry picked from commit 6e849cb658438c0561de485e01f3de7df47bf9ad)


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

Branch: refs/heads/branch-2
Commit: 9dec68c2693b2c3d42f9292b86b97755b7e0b6a8
Parents: c872eca
Author: Kihwal Lee <kihwal@apache.org>
Authored: Fri Sep 23 14:10:46 2016 -0500
Committer: Kihwal Lee <kihwal@apache.org>
Committed: Fri Sep 23 14:10:46 2016 -0500

----------------------------------------------------------------------
 .../org/apache/hadoop/yarn/client/cli/TestYarnCLI.java    | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/9dec68c2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/cli/TestYarnCLI.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/cli/TestYarnCLI.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/cli/TestYarnCLI.java
index 3fdea40..ef64365 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/cli/TestYarnCLI.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/cli/TestYarnCLI.java
@@ -35,8 +35,6 @@ import java.io.OutputStreamWriter;
 import java.io.PrintStream;
 import java.io.PrintWriter;
 import java.io.UnsupportedEncodingException;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.EnumSet;
@@ -81,6 +79,7 @@ import org.apache.hadoop.yarn.server.resourcemanager.scheduler.ResourceScheduler
 import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler;
 import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacitySchedulerConfiguration;
 import org.apache.hadoop.yarn.util.Records;
+import org.apache.hadoop.yarn.util.Times;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -300,7 +299,6 @@ public class TestYarnCLI {
     reports.add(container);
     reports.add(container1);
     reports.add(container2);
-    DateFormat dateFormat=new SimpleDateFormat("EEE MMM dd HH:mm:ss Z yyyy");
     when(client.getContainers(any(ApplicationAttemptId.class))).thenReturn(
         reports);
     sysOutStream.reset();
@@ -316,13 +314,13 @@ public class TestYarnCLI {
     pw.printf(ApplicationCLI.CONTAINER_PATTERN, "Container-Id", "Start Time",
         "Finish Time", "State", "Host", "Node Http Address", "LOG-URL");
     pw.printf(ApplicationCLI.CONTAINER_PATTERN, "container_1234_0005_01_000001",
-        dateFormat.format(new Date(time1)), dateFormat.format(new Date(time2)),
+        Times.format(time1), Times.format(time2),
         "COMPLETE", "host:1234", "http://host:2345", "logURL");
     pw.printf(ApplicationCLI.CONTAINER_PATTERN, "container_1234_0005_01_000002",
-        dateFormat.format(new Date(time1)), dateFormat.format(new Date(time2)),
+        Times.format(time1), Times.format(time2),
         "COMPLETE", "host:1234", "http://host:2345", "logURL");
     pw.printf(ApplicationCLI.CONTAINER_PATTERN, "container_1234_0005_01_000003",
-        dateFormat.format(new Date(time1)), "N/A", "RUNNING", "host:1234",
+        Times.format(time1), "N/A", "RUNNING", "host:1234",
         "http://host:2345", "");
     pw.close();
     String appReportStr = baos.toString("UTF-8");


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message