hadoop-zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ph...@apache.org
Subject svn commit: r938214 - in /hadoop/zookeeper/branches/branch-3.3: CHANGES.txt src/java/test/org/apache/zookeeper/server/ZooKeeperServerMainTest.java src/java/test/org/apache/zookeeper/server/quorum/QuorumPeerTestBase.java
Date Mon, 26 Apr 2010 20:01:15 GMT
Author: phunt
Date: Mon Apr 26 20:01:15 2010
New Revision: 938214

URL: http://svn.apache.org/viewvc?rev=938214&view=rev
Log:
ZOOKEEPER-734. QuorumPeerTestBase.java and ZooKeeperServerMainTest.java do not handle windows
path correctly

Modified:
    hadoop/zookeeper/branches/branch-3.3/CHANGES.txt
    hadoop/zookeeper/branches/branch-3.3/src/java/test/org/apache/zookeeper/server/ZooKeeperServerMainTest.java
    hadoop/zookeeper/branches/branch-3.3/src/java/test/org/apache/zookeeper/server/quorum/QuorumPeerTestBase.java

Modified: hadoop/zookeeper/branches/branch-3.3/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/branches/branch-3.3/CHANGES.txt?rev=938214&r1=938213&r2=938214&view=diff
==============================================================================
--- hadoop/zookeeper/branches/branch-3.3/CHANGES.txt (original)
+++ hadoop/zookeeper/branches/branch-3.3/CHANGES.txt Mon Apr 26 20:01:15 2010
@@ -21,6 +21,9 @@ BUGFIXES:
   ZOOKEEPER-738. zookeeper.jute.h fails to compile with -pedantic
   (Jozef Hatala via phunt)
 
+  ZOOKEEPER-734. QuorumPeerTestBase.java and ZooKeeperServerMainTest.java
+  do not handle windows path correctly (Vishal K via phunt)
+
 Release 3.3.0 - 2010-03-24
 
 Non-backward compatible changes:

Modified: hadoop/zookeeper/branches/branch-3.3/src/java/test/org/apache/zookeeper/server/ZooKeeperServerMainTest.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/branches/branch-3.3/src/java/test/org/apache/zookeeper/server/ZooKeeperServerMainTest.java?rev=938214&r1=938213&r2=938214&view=diff
==============================================================================
--- hadoop/zookeeper/branches/branch-3.3/src/java/test/org/apache/zookeeper/server/ZooKeeperServerMainTest.java
(original)
+++ hadoop/zookeeper/branches/branch-3.3/src/java/test/org/apache/zookeeper/server/ZooKeeperServerMainTest.java
Mon Apr 26 20:01:15 2010
@@ -61,8 +61,15 @@ public class ZooKeeperServerMainTest ext
             if (!dataDir.mkdir()) {
                 throw new IOException("unable to mkdir " + dataDir);
             }
-            fwriter.write("dataDir=" + dataDir.toString() + "\n");
-
+            
+            // Convert windows path to UNIX to avoid problems with "\"
+            String dir = dataDir.toString();
+            String osname = java.lang.System.getProperty("os.name");
+            if (osname.toLowerCase().contains("windows")) {
+                dir = dir.replace('\\', '/');
+            }
+            fwriter.write("dataDir=" + dir + "\n");
+            
             fwriter.write("clientPort=" + clientPort + "\n");
             fwriter.flush();
             fwriter.close();

Modified: hadoop/zookeeper/branches/branch-3.3/src/java/test/org/apache/zookeeper/server/quorum/QuorumPeerTestBase.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/branches/branch-3.3/src/java/test/org/apache/zookeeper/server/quorum/QuorumPeerTestBase.java?rev=938214&r1=938213&r2=938214&view=diff
==============================================================================
--- hadoop/zookeeper/branches/branch-3.3/src/java/test/org/apache/zookeeper/server/quorum/QuorumPeerTestBase.java
(original)
+++ hadoop/zookeeper/branches/branch-3.3/src/java/test/org/apache/zookeeper/server/quorum/QuorumPeerTestBase.java
Mon Apr 26 20:01:15 2010
@@ -73,8 +73,15 @@ public class QuorumPeerTestBase extends 
             if (!dataDir.mkdir()) {
                 throw new IOException("Unable to mkdir " + dataDir);
             }
-            fwriter.write("dataDir=" + dataDir.toString() + "\n");
 
+            // Convert windows path to UNIX to avoid problems with "\"
+            String dir = dataDir.toString();
+            String osname = java.lang.System.getProperty("os.name");
+            if (osname.toLowerCase().contains("windows")) {
+                dir = dir.replace('\\', '/');
+            }
+            fwriter.write("dataDir=" + dir + "\n");
+            
             fwriter.write("clientPort=" + clientPort + "\n");
             fwriter.write(quorumCfgSection + "\n");
             fwriter.flush();



Mime
View raw message