Browse Source

HADOOP-9174. TestSecurityUtil fails with Open JDK 7. Contributed by Arpit Agarwal.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-1@1428102 13f79535-47bb-0310-9956-ffa450edef68
Suresh Srinivas 12 years ago
parent
commit
cfe7c3e199
2 changed files with 7 additions and 0 deletions
  1. 3 0
      CHANGES.txt
  2. 4 0
      src/test/org/apache/hadoop/security/TestSecurityUtil.java

+ 3 - 0
CHANGES.txt

@@ -373,6 +373,9 @@ Release 1.2.0 - unreleased
     node is excluded, the nodes in the same nodegroup should also be excluded.
     node is excluded, the nodes in the same nodegroup should also be excluded.
     (Meng Gong via szetszwo)
     (Meng Gong via szetszwo)
 
 
+    HADOOP-9174. TestSecurityUtil fails with Open JDK 7. (Arpit Agarwal via
+    suresh)
+
 Release 1.1.2 - Unreleased
 Release 1.1.2 - Unreleased
 
 
   INCOMPATIBLE CHANGES
   INCOMPATIBLE CHANGES

+ 4 - 0
src/test/org/apache/hadoop/security/TestSecurityUtil.java

@@ -112,6 +112,8 @@ public class TestSecurityUtil {
 
 
   @Test
   @Test
   public void testBuildDTServiceName() {
   public void testBuildDTServiceName() {
+    SecurityUtil.setTokenServiceUseIp(true);
+
     assertEquals("127.0.0.1:123",
     assertEquals("127.0.0.1:123",
         SecurityUtil.buildDTServiceName(URI.create("test://LocalHost"), 123)
         SecurityUtil.buildDTServiceName(URI.create("test://LocalHost"), 123)
     );
     );
@@ -128,6 +130,8 @@ public class TestSecurityUtil {
   
   
   @Test
   @Test
   public void testBuildTokenServiceSockAddr() {
   public void testBuildTokenServiceSockAddr() {
+    SecurityUtil.setTokenServiceUseIp(true);
+
     assertEquals("127.0.0.1:123",
     assertEquals("127.0.0.1:123",
         SecurityUtil.buildTokenService(new InetSocketAddress("LocalHost", 123)).toString()
         SecurityUtil.buildTokenService(new InetSocketAddress("LocalHost", 123)).toString()
     );
     );