hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sra...@apache.org
Subject svn commit: r1357755 - in /hadoop/common/branches/branch-1-win: ./ src/hdfs/org/apache/hadoop/hdfs/ src/test/org/apache/hadoop/cli/ src/test/org/apache/hadoop/ipc/
Date Thu, 05 Jul 2012 17:33:35 GMT
Author: sradia
Date: Thu Jul  5 17:33:35 2012
New Revision: 1357755

URL: http://svn.apache.org/viewvc?rev=1357755&view=rev
Log:
HADOOP-8414 Address problems related to localhost resolving to 127.0.0.1 on Windows by Ivan
Mitic

Modified:
    hadoop/common/branches/branch-1-win/CHANGES.txt
    hadoop/common/branches/branch-1-win/src/hdfs/org/apache/hadoop/hdfs/DistributedFileSystem.java
    hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/cli/TestCLI.java
    hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/cli/testConf.xml
    hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/ipc/TestSaslRPC.java

Modified: hadoop/common/branches/branch-1-win/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1-win/CHANGES.txt?rev=1357755&r1=1357754&r2=1357755&view=diff
==============================================================================
--- hadoop/common/branches/branch-1-win/CHANGES.txt (original)
+++ hadoop/common/branches/branch-1-win/CHANGES.txt Thu Jul  5 17:33:35 2012
@@ -59,6 +59,9 @@ branch-hadoop-1-win - unreleased
     MAPREDUCE-4368. Fix TaskRunner to deal with java.library.path with a
     quoted path on Windows. (John Gordon via acmurthy) 
 
+    HADOOP-8414 Address problems related to localhost resolving to 127.0.0.1 on Windows
+    (Ivan Mitic via Sanjay Radia)
+
 Release 1.1.0 - unreleased
 
   NEW FEATURES

Modified: hadoop/common/branches/branch-1-win/src/hdfs/org/apache/hadoop/hdfs/DistributedFileSystem.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1-win/src/hdfs/org/apache/hadoop/hdfs/DistributedFileSystem.java?rev=1357755&r1=1357754&r2=1357755&view=diff
==============================================================================
--- hadoop/common/branches/branch-1-win/src/hdfs/org/apache/hadoop/hdfs/DistributedFileSystem.java
(original)
+++ hadoop/common/branches/branch-1-win/src/hdfs/org/apache/hadoop/hdfs/DistributedFileSystem.java
Thu Jul  5 17:33:35 2012
@@ -80,9 +80,10 @@ public class DistributedFileSystem exten
     super.initialize(uri, conf);
     setConf(conf);
 
-    String host = uri.getHost();
-    if (host == null) {
-      throw new IOException("Incomplete HDFS URI, no host: "+ uri);
+    // Check for authority as URI.getHost() returns null if host contains
+    // numbers. This URI is still valid and it should not be rejected.
+    if (uri.getAuthority() == null) {
+      throw new IOException("Incomplete HDFS URI, no authority: "+ uri);
     }
 
     InetSocketAddress namenode = NameNode.getAddress(uri.getAuthority());

Modified: hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/cli/TestCLI.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/cli/TestCLI.java?rev=1357755&r1=1357754&r2=1357755&view=diff
==============================================================================
--- hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/cli/TestCLI.java (original)
+++ hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/cli/TestCLI.java Thu Jul
 5 17:33:35 2012
@@ -89,7 +89,7 @@ public class TestCLI extends TestCase {
   /**
    * Read the test config file - testConfig.xml
    */
-  private void readTestConfigFile() {
+  private void readTestConfigFile(String namenode) {
     
     if (testsFromConfigFile == null) {
       boolean success = false;
@@ -98,6 +98,13 @@ public class TestCLI extends TestCase {
         SAXParser p = (SAXParserFactory.newInstance()).newSAXParser();
         p.parse(testConfigFile, new TestConfigFileParser());
         success = true;
+        // Expand the expected test results
+        for (CLITestData testData: testsFromConfigFile) {
+          for (ComparatorData cd: testData.getComparatorData()) {
+            cd.setExpectedOutput(cd.getExpectedOutput()
+                .replaceAll("NAMENODE", namenode));
+          }
+        }
       } catch (Exception e) {
         LOG.info("File: " + testConfigFile + " not found");
         success = false;
@@ -110,9 +117,6 @@ public class TestCLI extends TestCase {
    * Setup
    */
   public void setUp() throws Exception {
-    // Read the testConfig.xml file
-    readTestConfigFile();
-    
     // Start up the mini dfs cluster
     boolean success = false;
     conf = new Configuration();
@@ -138,6 +142,9 @@ public class TestCLI extends TestCase {
                            null, null, mrConf);
     jobtracker = mrCluster.createJobConf().get("mapred.job.tracker", "local");
 
+    // Read the testConfig.xml file
+    readTestConfigFile(namenode);
+
     success = true;
 
     assertTrue("Error setting up Mini DFS & MR clusters", success);

Modified: hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/cli/testConf.xml
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/cli/testConf.xml?rev=1357755&r1=1357754&r2=1357755&view=diff
==============================================================================
--- hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/cli/testConf.xml (original)
+++ hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/cli/testConf.xml Thu Jul
 5 17:33:35 2012
@@ -506,7 +506,7 @@
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^15( |\t)*hdfs://localhost[.a-z]*:[0-9]*/data15bytes</expected-output>
+          <expected-output>^15( |\t)*NAMENODE/data15bytes</expected-output>
         </comparator>
       </comparators>
     </test>
@@ -527,7 +527,7 @@
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^15( |\t)*hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/data15bytes</expected-output>
+          <expected-output>^15( |\t)*NAMENODE/user/[a-z]*/data15bytes</expected-output>
         </comparator>
       </comparators>
     </test>
@@ -551,19 +551,19 @@
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^15( |\t)*hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/data15bytes</expected-output>
+          <expected-output>^15( |\t)*NAMENODE/user/[a-z]*/data15bytes</expected-output>
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^30( |\t)*hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/data30bytes</expected-output>
+          <expected-output>^30( |\t)*NAMENODE/user/[a-z]*/data30bytes</expected-output>
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^60( |\t)*hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/data60bytes</expected-output>
+          <expected-output>^60( |\t)*NAMENODE/user/[a-z]*/data60bytes</expected-output>
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^120( |\t)*hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/data120bytes</expected-output>
+          <expected-output>^120( |\t)*NAMENODE/user/[a-z]*/data120bytes</expected-output>
         </comparator>
       </comparators>
     </test>
@@ -585,7 +585,7 @@
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^15( |\t)*hdfs://localhost[.a-z]*:[0-9]*/dir0/data15bytes</expected-output>
+          <expected-output>^15( |\t)*NAMENODE/dir0/data15bytes</expected-output>
         </comparator>
       </comparators>
     </test>
@@ -607,7 +607,7 @@
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^15( |\t)*hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/dir0/data15bytes</expected-output>
+          <expected-output>^15( |\t)*NAMENODE/user/[a-z]*/dir0/data15bytes</expected-output>
         </comparator>
       </comparators>
     </test>
@@ -632,19 +632,19 @@
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^15( |\t)*hdfs://localhost[.a-z]*:[0-9]*/dir0/data15bytes</expected-output>
+          <expected-output>^15( |\t)*NAMENODE/dir0/data15bytes</expected-output>
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^30( |\t)*hdfs://localhost[.a-z]*:[0-9]*/dir0/data30bytes</expected-output>
+          <expected-output>^30( |\t)*NAMENODE/dir0/data30bytes</expected-output>
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^60( |\t)*hdfs://localhost[.a-z]*:[0-9]*/dir0/data60bytes</expected-output>
+          <expected-output>^60( |\t)*NAMENODE/dir0/data60bytes</expected-output>
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^120( |\t)*hdfs://localhost[.a-z]*:[0-9]*/dir0/data120bytes</expected-output>
+          <expected-output>^120( |\t)*NAMENODE/dir0/data120bytes</expected-output>
         </comparator>
       </comparators>
     </test>
@@ -677,7 +677,7 @@
       <comparators>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^hdfs://localhost[.a-z]*:[0-9]*/dir0( |\t)*450</expected-output>
+          <expected-output>^NAMENODE/dir0( |\t)*450</expected-output>
         </comparator>
       </comparators>
     </test>
@@ -709,7 +709,7 @@
       <comparators>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/dir0( |\t)*450</expected-output>
+          <expected-output>^NAMENODE/user/[a-z]*/dir0( |\t)*450</expected-output>
         </comparator>
       </comparators>
     </test>
@@ -747,7 +747,7 @@
       <comparators>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^hdfs://localhost[.a-z]*:[0-9]*/dir0( |\t)*450</expected-output>
+          <expected-output>^NAMENODE/dir0( |\t)*450</expected-output>
         </comparator>
       </comparators>
     </test>
@@ -791,7 +791,7 @@
       <comparators>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^mv: Failed to rename hdfs://localhost[.a-z]*:[0-9]*/file1
to file2</expected-output>
+          <expected-output>^mv: Failed to rename NAMENODE/file1 to file2</expected-output>
         </comparator>
       </comparators>
     </test>
@@ -1301,7 +1301,7 @@
       <comparators>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^Deleted hdfs://localhost[.a-z]*:[0-9]*/dir0/file0</expected-output>
+          <expected-output>^Deleted NAMENODE/dir0/file0</expected-output>
         </comparator>
       </comparators>
     </test>
@@ -1318,7 +1318,7 @@
       <comparators>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^Deleted hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/file0</expected-output>
+          <expected-output>^Deleted NAMENODE/user/[a-z]*/file0</expected-output>
         </comparator>
       </comparators>
     </test>
@@ -1338,19 +1338,19 @@
       <comparators>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^Deleted hdfs://localhost[.a-z]*:[0-9]*/dir0/file0</expected-output>
+          <expected-output>^Deleted NAMENODE/dir0/file0</expected-output>
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^Deleted hdfs://localhost[.a-z]*:[0-9]*/dir0/file1</expected-output>
+          <expected-output>^Deleted NAMENODE/dir0/file1</expected-output>
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^Deleted hdfs://localhost[.a-z]*:[0-9]*/dir0/file2</expected-output>
+          <expected-output>^Deleted NAMENODE/dir0/file2</expected-output>
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^Deleted hdfs://localhost[.a-z]*:[0-9]*/dir0/file3</expected-output>
+          <expected-output>^Deleted NAMENODE/dir0/file3</expected-output>
         </comparator>
       </comparators>
     </test>
@@ -1370,19 +1370,19 @@
       <comparators>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^Deleted hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/file0</expected-output>
+          <expected-output>^Deleted NAMENODE/user/[a-z]*/file0</expected-output>
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^Deleted hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/file1</expected-output>
+          <expected-output>^Deleted NAMENODE/user/[a-z]*/file1</expected-output>
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^Deleted hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/file2</expected-output>
+          <expected-output>^Deleted NAMENODE/user/[a-z]*/file2</expected-output>
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^Deleted hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/file3</expected-output>
+          <expected-output>^Deleted NAMENODE/user/[a-z]*/file3</expected-output>
         </comparator>
       </comparators>
     </test>
@@ -1399,7 +1399,7 @@
       <comparators>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^rm: Cannot remove directory "hdfs://localhost[.a-z]*:[0-9]*/dir0",
use -rmr instead</expected-output>
+          <expected-output>^rm: Cannot remove directory "NAMENODE/dir0", use -rmr instead</expected-output>
         </comparator>
       </comparators>
     </test>
@@ -1466,7 +1466,7 @@
       <comparators>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^Deleted hdfs://localhost[.a-z]*:[0-9]*/dir0/file0</expected-output>
+          <expected-output>^Deleted NAMENODE/dir0/file0</expected-output>
         </comparator>
       </comparators>
     </test>
@@ -1483,7 +1483,7 @@
       <comparators>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^Deleted hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/file0</expected-output>
+          <expected-output>^Deleted NAMENODE/user/[a-z]*/file0</expected-output>
         </comparator>
       </comparators>
     </test>
@@ -1500,7 +1500,7 @@
       <comparators>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^Deleted hdfs://localhost[.a-z]*:[0-9]*/dir0</expected-output>
+          <expected-output>^Deleted NAMENODE/dir0</expected-output>
         </comparator>
       </comparators>
     </test>
@@ -1517,7 +1517,7 @@
       <comparators>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^Deleted hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/dir0</expected-output>
+          <expected-output>^Deleted NAMENODE/user/[a-z]*/dir0</expected-output>
         </comparator>
       </comparators>
     </test>
@@ -1537,19 +1537,19 @@
       <comparators>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^Deleted hdfs://localhost[.a-z]*:[0-9]*/dir0</expected-output>
+          <expected-output>^Deleted NAMENODE/dir0</expected-output>
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^Deleted hdfs://localhost[.a-z]*:[0-9]*/dir1</expected-output>
+          <expected-output>^Deleted NAMENODE/dir1</expected-output>
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^Deleted hdfs://localhost[.a-z]*:[0-9]*/dir2</expected-output>
+          <expected-output>^Deleted NAMENODE/dir2</expected-output>
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^Deleted hdfs://localhost[.a-z]*:[0-9]*/dir3</expected-output>
+          <expected-output>^Deleted NAMENODE/dir3</expected-output>
         </comparator>
       </comparators>
     </test>
@@ -1569,19 +1569,19 @@
       <comparators>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^Deleted hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/dir0</expected-output>
+          <expected-output>^Deleted NAMENODE/user/[a-z]*/dir0</expected-output>
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^Deleted hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/dir1</expected-output>
+          <expected-output>^Deleted NAMENODE/user/[a-z]*/dir1</expected-output>
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^Deleted hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/dir2</expected-output>
+          <expected-output>^Deleted NAMENODE/user/[a-z]*/dir2</expected-output>
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^Deleted hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/dir3</expected-output>
+          <expected-output>^Deleted NAMENODE/user/[a-z]*/dir3</expected-output>
         </comparator>
       </comparators>
     </test>
@@ -1638,7 +1638,7 @@
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^15( |\t)*hdfs://localhost.*:[0-9]*/data15bytes</expected-output>
+          <expected-output>^15( |\t)*NAMENODE/data15bytes</expected-output>
         </comparator>
       </comparators>
     </test>
@@ -1659,7 +1659,7 @@
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^15( |\t)*hdfs://localhost.*:[0-9]*/user/[a-z]*/data15bytes</expected-output>
+          <expected-output>^15( |\t)*NAMENODE/user/[a-z]*/data15bytes</expected-output>
         </comparator>
       </comparators>
     </test>
@@ -1676,19 +1676,19 @@
       <comparators>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^15( |\t)*hdfs://localhost.*:[0-9]*/dir0/dir1/data/data15bytes</expected-output>
+          <expected-output>^15( |\t)*NAMENODE/dir0/dir1/data/data15bytes</expected-output>
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^30( |\t)*hdfs://localhost.*:[0-9]*/dir0/dir1/data/data30bytes</expected-output>
+          <expected-output>^30( |\t)*NAMENODE/dir0/dir1/data/data30bytes</expected-output>
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^60( |\t)*hdfs://localhost.*:[0-9]*/dir0/dir1/data/data60bytes</expected-output>
+          <expected-output>^60( |\t)*NAMENODE/dir0/dir1/data/data60bytes</expected-output>
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^120( |\t)*hdfs://localhost.*:[0-9]*/dir0/dir1/data/data120bytes</expected-output>
+          <expected-output>^120( |\t)*NAMENODE/dir0/dir1/data/data120bytes</expected-output>
         </comparator>
       </comparators>
     </test>
@@ -1705,19 +1705,19 @@
       <comparators>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^15( |\t)*hdfs://localhost.*:[0-9]*/user/[a-z]*/dir0/dir1/data/data15bytes</expected-output>
+          <expected-output>^15( |\t)*NAMENODE/user/[a-z]*/dir0/dir1/data/data15bytes</expected-output>
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^30( |\t)*hdfs://localhost.*:[0-9]*/user/[a-z]*/dir0/dir1/data/data30bytes</expected-output>
+          <expected-output>^30( |\t)*NAMENODE/user/[a-z]*/dir0/dir1/data/data30bytes</expected-output>
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^60( |\t)*hdfs://localhost.*:[0-9]*/user/[a-z]*/dir0/dir1/data/data60bytes</expected-output>
+          <expected-output>^60( |\t)*NAMENODE/user/[a-z]*/dir0/dir1/data/data60bytes</expected-output>
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^120( |\t)*hdfs://localhost.*:[0-9]*/user/[a-z]*/dir0/dir1/data/data120bytes</expected-output>
+          <expected-output>^120( |\t)*NAMENODE/user/[a-z]*/dir0/dir1/data/data120bytes</expected-output>
         </comparator>
       </comparators>
     </test>
@@ -1739,11 +1739,11 @@
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^15( |\t)*hdfs://localhost[.a-z]*:[0-9]*/dir0/data15bytes</expected-output>
+          <expected-output>^15( |\t)*NAMENODE/dir0/data15bytes</expected-output>
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^30( |\t)*hdfs://localhost[.a-z]*:[0-9]*/dir0/data30bytes</expected-output>
+          <expected-output>^30( |\t)*NAMENODE/dir0/data30bytes</expected-output>
         </comparator>
       </comparators>
     </test>
@@ -1765,11 +1765,11 @@
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^15( |\t)*hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/dir0/data15bytes</expected-output>
+          <expected-output>^15( |\t)*NAMENODE/user/[a-z]*/dir0/data15bytes</expected-output>
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^30( |\t)*hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/dir0/data30bytes</expected-output>
+          <expected-output>^30( |\t)*NAMENODE/user/[a-z]*/dir0/data30bytes</expected-output>
         </comparator>
       </comparators>
     </test>
@@ -1894,7 +1894,7 @@
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^15( |\t)*hdfs://localhost.*:[0-9]*/data15bytes</expected-output>
+          <expected-output>^15( |\t)*NAMENODE/data15bytes</expected-output>
         </comparator>
       </comparators>
     </test>
@@ -1915,7 +1915,7 @@
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^15( |\t)*hdfs://localhost.*:[0-9]*/user/[a-z]*/data15bytes</expected-output>
+          <expected-output>^15( |\t)*NAMENODE/user/[a-z]*/data15bytes</expected-output>
         </comparator>
       </comparators>
     </test>
@@ -1932,19 +1932,19 @@
       <comparators>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^15( |\t)*hdfs://localhost.*:[0-9]*/dir0/dir1/data/data15bytes</expected-output>
+          <expected-output>^15( |\t)*NAMENODE/dir0/dir1/data/data15bytes</expected-output>
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^30( |\t)*hdfs://localhost.*:[0-9]*/dir0/dir1/data/data30bytes</expected-output>
+          <expected-output>^30( |\t)*NAMENODE/dir0/dir1/data/data30bytes</expected-output>
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^60( |\t)*hdfs://localhost.*:[0-9]*/dir0/dir1/data/data60bytes</expected-output>
+          <expected-output>^60( |\t)*NAMENODE/dir0/dir1/data/data60bytes</expected-output>
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^120( |\t)*hdfs://localhost.*:[0-9]*/dir0/dir1/data/data120bytes</expected-output>
+          <expected-output>^120( |\t)*NAMENODE/dir0/dir1/data/data120bytes</expected-output>
         </comparator>
       </comparators>
     </test>
@@ -1961,19 +1961,19 @@
       <comparators>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^15( |\t)*hdfs://localhost.*:[0-9]*/user/[a-z]*/dir0/dir1/data/data15bytes</expected-output>
+          <expected-output>^15( |\t)*NAMENODE/user/[a-z]*/dir0/dir1/data/data15bytes</expected-output>
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^30( |\t)*hdfs://localhost.*:[0-9]*/user/[a-z]*/dir0/dir1/data/data30bytes</expected-output>
+          <expected-output>^30( |\t)*NAMENODE/user/[a-z]*/dir0/dir1/data/data30bytes</expected-output>
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^60( |\t)*hdfs://localhost.*:[0-9]*/user/[a-z]*/dir0/dir1/data/data60bytes</expected-output>
+          <expected-output>^60( |\t)*NAMENODE/user/[a-z]*/dir0/dir1/data/data60bytes</expected-output>
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^120( |\t)*hdfs://localhost.*:[0-9]*/user/[a-z]*/dir0/dir1/data/data120bytes</expected-output>
+          <expected-output>^120( |\t)*NAMENODE/user/[a-z]*/dir0/dir1/data/data120bytes</expected-output>
         </comparator>
       </comparators>
     </test>
@@ -1995,11 +1995,11 @@
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^15( |\t)*hdfs://localhost[.a-z]*:[0-9]*/dir0/data15bytes</expected-output>
+          <expected-output>^15( |\t)*NAMENODE/dir0/data15bytes</expected-output>
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^30( |\t)*hdfs://localhost[.a-z]*:[0-9]*/dir0/data30bytes</expected-output>
+          <expected-output>^30( |\t)*NAMENODE/dir0/data30bytes</expected-output>
         </comparator>
       </comparators>
     </test>
@@ -2021,11 +2021,11 @@
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^15( |\t)*hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/dir0/data15bytes</expected-output>
+          <expected-output>^15( |\t)*NAMENODE/user/[a-z]*/dir0/data15bytes</expected-output>
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^30( |\t)*hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/dir0/data30bytes</expected-output>
+          <expected-output>^30( |\t)*NAMENODE/user/[a-z]*/dir0/data30bytes</expected-output>
         </comparator>
       </comparators>
     </test>
@@ -2402,7 +2402,7 @@
       <comparators>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^hdfs://localhost[.a-z]*:[0-9]*/dir0(|\t)*0</expected-output>
+          <expected-output>^NAMENODE/dir0(|\t)*0</expected-output>
         </comparator>
       </comparators>
     </test>
@@ -2419,7 +2419,7 @@
       <comparators>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/dir0(|\t)*0</expected-output>
+          <expected-output>^NAMENODE/user/[a-z]*/dir0(|\t)*0</expected-output>
         </comparator>
       </comparators>
     </test>
@@ -2439,19 +2439,19 @@
       <comparators>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^hdfs://localhost[.a-z]*:[0-9]*/dir0(|\t)*0</expected-output>
+          <expected-output>^NAMENODE/dir0(|\t)*0</expected-output>
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^hdfs://localhost[.a-z]*:[0-9]*/dir1(|\t)*0</expected-output>
+          <expected-output>^NAMENODE/dir1(|\t)*0</expected-output>
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^hdfs://localhost[.a-z]*:[0-9]*/dir2(|\t)*0</expected-output>
+          <expected-output>^NAMENODE/dir2(|\t)*0</expected-output>
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^hdfs://localhost[.a-z]*:[0-9]*/dir3(|\t)*0</expected-output>
+          <expected-output>^NAMENODE/dir3(|\t)*0</expected-output>
         </comparator>
       </comparators>
     </test>
@@ -2471,19 +2471,19 @@
       <comparators>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/dir0(|\t)*0</expected-output>
+          <expected-output>^NAMENODE/user/[a-z]*/dir0(|\t)*0</expected-output>
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/dir1(|\t)*0</expected-output>
+          <expected-output>^NAMENODE/user/[a-z]*/dir1(|\t)*0</expected-output>
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/dir2(|\t)*0</expected-output>
+          <expected-output>^NAMENODE/user/[a-z]*/dir2(|\t)*0</expected-output>
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/dir3(|\t)*0</expected-output>
+          <expected-output>^NAMENODE/user/[a-z]*/dir3(|\t)*0</expected-output>
         </comparator>
       </comparators>
     </test>
@@ -2535,7 +2535,7 @@
       <comparators>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^Replication 2 set: hdfs://localhost[.a-z]*:[0-9]*/dir0/file0</expected-output>
+          <expected-output>^Replication 2 set: NAMENODE/dir0/file0</expected-output>
         </comparator>
       </comparators>
     </test>
@@ -2552,7 +2552,7 @@
       <comparators>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^Replication 2 set: hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/file0</expected-output>
+          <expected-output>^Replication 2 set: NAMENODE/user/[a-z]*/file0</expected-output>
         </comparator>
       </comparators>
     </test>
@@ -2570,11 +2570,11 @@
       <comparators>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^Replication 2 set: hdfs://localhost[.a-z]*:[0-9]*/dir0/file0</expected-output>
+          <expected-output>^Replication 2 set: NAMENODE/dir0/file0</expected-output>
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^Replication 2 set: hdfs://localhost[.a-z]*:[0-9]*/dir0/file1</expected-output>
+          <expected-output>^Replication 2 set: NAMENODE/dir0/file1</expected-output>
         </comparator>
       </comparators>
     </test>
@@ -2592,11 +2592,11 @@
       <comparators>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^Replication 2 set: hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/dir0/file0</expected-output>
+          <expected-output>^Replication 2 set: NAMENODE/user/[a-z]*/dir0/file0</expected-output>
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^Replication 2 set: hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/dir0/file1</expected-output>
+          <expected-output>^Replication 2 set: NAMENODE/user/[a-z]*/dir0/file1</expected-output>
         </comparator>
       </comparators>
     </test>
@@ -2651,7 +2651,7 @@
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^0( |\t)*hdfs://localhost[.a-z]*:[0-9]*/user/file0</expected-output>
+          <expected-output>^0( |\t)*NAMENODE/user/file0</expected-output>
         </comparator>
       </comparators>
     </test>
@@ -2672,7 +2672,7 @@
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^0( |\t)*hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/file0</expected-output>
+          <expected-output>^0( |\t)*NAMENODE/user/[a-z]*/file0</expected-output>
         </comparator>
       </comparators>
     </test>
@@ -2693,9 +2693,9 @@
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^0( |\t)*hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/file0</expected-output>
-          <expected-output>^0( |\t)*hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/file1</expected-output>
-          <expected-output>^0( |\t)*hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/file2</expected-output>
+          <expected-output>^0( |\t)*NAMENODE/user/[a-z]*/file0</expected-output>
+          <expected-output>^0( |\t)*NAMENODE/user/[a-z]*/file1</expected-output>
+          <expected-output>^0( |\t)*NAMENODE/user/[a-z]*/file2</expected-output>
         </comparator>
       </comparators>
     </test>

Modified: hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/ipc/TestSaslRPC.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/ipc/TestSaslRPC.java?rev=1357755&r1=1357754&r2=1357755&view=diff
==============================================================================
--- hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/ipc/TestSaslRPC.java (original)
+++ hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/ipc/TestSaslRPC.java Thu
Jul  5 17:33:35 2012
@@ -52,6 +52,7 @@ import org.apache.hadoop.security.Securi
 import org.apache.hadoop.security.TestUserGroupInformation;
 import org.apache.hadoop.security.UserGroupInformation;
 import org.apache.hadoop.security.UserGroupInformation.AuthenticationMethod;
+import org.apache.hadoop.util.Shell;
 
 import org.apache.log4j.Level;
 import org.junit.BeforeClass;
@@ -59,7 +60,8 @@ import org.junit.Test;
 
 /** Unit tests for using Sasl over RPC. */
 public class TestSaslRPC {
-  private static final String ADDRESS = "localhost";
+  private static final String ADDRESS = Shell.WINDOWS ? "127.0.0.1"
+                                                      : "localhost";
 
   public static final Log LOG =
     LogFactory.getLog(TestSaslRPC.class);



Mime
View raw message