hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject [1/2] hadoop git commit: HADOOP-11535 TableMapping related tests failed due to 'successful' resolving of invalid test hostname
Date Fri, 06 Feb 2015 13:03:54 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 3d36d4737 -> d827f02bc
  refs/heads/trunk 644548f20 -> 1425e3d37


HADOOP-11535 TableMapping related tests failed due to 'successful' resolving of invalid test
hostname


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

Branch: refs/heads/branch-2
Commit: d827f02bcd65060e0d8819e2c9d05938a3da9032
Parents: 3d36d47
Author: Steve Loughran <stevel@apache.org>
Authored: Fri Feb 6 13:03:30 2015 +0000
Committer: Steve Loughran <stevel@apache.org>
Committed: Fri Feb 6 13:03:30 2015 +0000

----------------------------------------------------------------------
 hadoop-common-project/hadoop-common/CHANGES.txt |  3 ++
 .../org/apache/hadoop/net/TestTableMapping.java | 43 +++++++++++---------
 2 files changed, 26 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/d827f02b/hadoop-common-project/hadoop-common/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt
index 41efde0..925115d 100644
--- a/hadoop-common-project/hadoop-common/CHANGES.txt
+++ b/hadoop-common-project/hadoop-common/CHANGES.txt
@@ -497,6 +497,9 @@ Release 2.7.0 - UNRELEASED
     HADOOP-11526. Memory leak in Bzip2Compressor and Bzip2Decompressor.
     (Anu Engineer via cnauroth)
 
+    HADOOP-11535 TableMapping related tests failed due to 'successful'
+    resolving of invalid test hostname. (Kai Zheng via stevel)
+
 Release 2.6.1 - UNRELEASED
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/d827f02b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/net/TestTableMapping.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/net/TestTableMapping.java
b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/net/TestTableMapping.java
index 5281694..a93f9ea 100644
--- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/net/TestTableMapping.java
+++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/net/TestTableMapping.java
@@ -34,12 +34,15 @@ import org.junit.Before;
 import org.junit.Test;
 
 public class TestTableMapping {
+  private String hostName1 = "1.2.3.4";
+  private String hostName2 = "5.6.7.8";
+
   @Test
   public void testResolve() throws IOException {
     File mapFile = File.createTempFile(getClass().getSimpleName() +
         ".testResolve", ".txt");
-    Files.write("a.b.c /rack1\n" +
-                "1.2.3.4\t/rack2\n", mapFile, Charsets.UTF_8);
+    Files.write(hostName1 + " /rack1\n" +
+                hostName2 + "\t/rack2\n", mapFile, Charsets.UTF_8);
     mapFile.deleteOnExit();
     TableMapping mapping = new TableMapping();
 
@@ -48,8 +51,8 @@ public class TestTableMapping {
     mapping.setConf(conf);
 
     List<String> names = new ArrayList<String>();
-    names.add("a.b.c");
-    names.add("1.2.3.4");
+    names.add(hostName1);
+    names.add(hostName2);
 
     List<String> result = mapping.resolve(names);
     assertEquals(names.size(), result.size());
@@ -61,8 +64,8 @@ public class TestTableMapping {
   public void testTableCaching() throws IOException {
     File mapFile = File.createTempFile(getClass().getSimpleName() +
         ".testTableCaching", ".txt");
-    Files.write("a.b.c /rack1\n" +
-                "1.2.3.4\t/rack2\n", mapFile, Charsets.UTF_8);
+    Files.write(hostName1 + " /rack1\n" +
+        hostName2 + "\t/rack2\n", mapFile, Charsets.UTF_8);
     mapFile.deleteOnExit();
     TableMapping mapping = new TableMapping();
 
@@ -71,8 +74,8 @@ public class TestTableMapping {
     mapping.setConf(conf);
 
     List<String> names = new ArrayList<String>();
-    names.add("a.b.c");
-    names.add("1.2.3.4");
+    names.add(hostName1);
+    names.add(hostName2);
 
     List<String> result1 = mapping.resolve(names);
     assertEquals(names.size(), result1.size());
@@ -94,8 +97,8 @@ public class TestTableMapping {
     mapping.setConf(conf);
 
     List<String> names = new ArrayList<String>();
-    names.add("a.b.c");
-    names.add("1.2.3.4");
+    names.add(hostName1);
+    names.add(hostName2);
 
     List<String> result = mapping.resolve(names);
     assertEquals(names.size(), result.size());
@@ -112,8 +115,8 @@ public class TestTableMapping {
     mapping.setConf(conf);
 
     List<String> names = new ArrayList<String>();
-    names.add("a.b.c");
-    names.add("1.2.3.4");
+    names.add(hostName1);
+    names.add(hostName2);
 
     List<String> result = mapping.resolve(names);
     assertEquals(names.size(), result.size());
@@ -125,8 +128,8 @@ public class TestTableMapping {
   public void testClearingCachedMappings() throws IOException {
     File mapFile = File.createTempFile(getClass().getSimpleName() +
         ".testClearingCachedMappings", ".txt");
-    Files.write("a.b.c /rack1\n" +
-                "1.2.3.4\t/rack2\n", mapFile, Charsets.UTF_8);
+    Files.write(hostName1 + " /rack1\n" +
+                hostName2 + "\t/rack2\n", mapFile, Charsets.UTF_8);
     mapFile.deleteOnExit();
 
     TableMapping mapping = new TableMapping();
@@ -136,8 +139,8 @@ public class TestTableMapping {
     mapping.setConf(conf);
 
     List<String> names = new ArrayList<String>();
-    names.add("a.b.c");
-    names.add("1.2.3.4");
+    names.add(hostName1);
+    names.add(hostName2);
 
     List<String> result = mapping.resolve(names);
     assertEquals(names.size(), result.size());
@@ -149,8 +152,8 @@ public class TestTableMapping {
     mapping.reloadCachedMappings();
 
     names = new ArrayList<String>();
-    names.add("a.b.c");
-    names.add("1.2.3.4");
+    names.add(hostName1);
+    names.add(hostName2);
 
     result = mapping.resolve(names);
     assertEquals(names.size(), result.size());
@@ -172,8 +175,8 @@ public class TestTableMapping {
     mapping.setConf(conf);
 
     List<String> names = new ArrayList<String>();
-    names.add("a.b.c");
-    names.add("1.2.3.4");
+    names.add(hostName1);
+    names.add(hostName2);
 
     List<String> result = mapping.resolve(names);
     assertEquals(names.size(), result.size());


Mime
View raw message