zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rake...@apache.org
Subject svn commit: r1703503 - in /zookeeper/branches/branch-3.5: CHANGES.txt src/java/systest/org/apache/zookeeper/test/system/BaseSysTest.java src/java/systest/org/apache/zookeeper/test/system/SimpleClient.java
Date Thu, 17 Sep 2015 07:10:52 GMT
Author: rakeshr
Date: Thu Sep 17 07:10:51 2015
New Revision: 1703503

URL: http://svn.apache.org/r1703503
Log:
ZOOKEEPER-2245: SimpleSysTest test cases fails (Arshad Mohammad via rakeshr)

Modified:
    zookeeper/branches/branch-3.5/CHANGES.txt
    zookeeper/branches/branch-3.5/src/java/systest/org/apache/zookeeper/test/system/BaseSysTest.java
    zookeeper/branches/branch-3.5/src/java/systest/org/apache/zookeeper/test/system/SimpleClient.java

Modified: zookeeper/branches/branch-3.5/CHANGES.txt
URL: http://svn.apache.org/viewvc/zookeeper/branches/branch-3.5/CHANGES.txt?rev=1703503&r1=1703502&r2=1703503&view=diff
==============================================================================
--- zookeeper/branches/branch-3.5/CHANGES.txt (original)
+++ zookeeper/branches/branch-3.5/CHANGES.txt Thu Sep 17 07:10:51 2015
@@ -11,6 +11,8 @@ BUGFIXES:
   ZOOKEEPER-2269: NullPointerException in RemotePeerBean
   (Arshad Mohammad via rgs)
 
+  ZOOKEEPER-2245: SimpleSysTest test cases fails (Arshad Mohammad via rakeshr)
+
 IMPROVEMENTS:
 
   ZOOKEEPER-2270: Allow MBeanRegistry to be overridden for better unit tests

Modified: zookeeper/branches/branch-3.5/src/java/systest/org/apache/zookeeper/test/system/BaseSysTest.java
URL: http://svn.apache.org/viewvc/zookeeper/branches/branch-3.5/src/java/systest/org/apache/zookeeper/test/system/BaseSysTest.java?rev=1703503&r1=1703502&r2=1703503&view=diff
==============================================================================
--- zookeeper/branches/branch-3.5/src/java/systest/org/apache/zookeeper/test/system/BaseSysTest.java
(original)
+++ zookeeper/branches/branch-3.5/src/java/systest/org/apache/zookeeper/test/system/BaseSysTest.java
Thu Sep 17 07:10:51 2015
@@ -61,7 +61,9 @@ public class BaseSysTest {
     }
     @After
     public void tearDown() throws Exception {
-        im.close();
+        if (null != im) {
+            im.close();
+        }
     }
 
     int serverCount = defaultServerCount;
@@ -148,10 +150,17 @@ public class BaseSysTest {
         qps = new QuorumPeer[count];
         qpsDirs = new File[count];
         for(int i = 1; i <= count; i++) {
-            peers.put(Long.valueOf(i), new QuorumServer(i, new InetSocketAddress("127.0.0.1",
fakeBasePort + i)));
+            InetSocketAddress peerAddress = new InetSocketAddress("127.0.0.1",
+                    fakeBasePort + i);
+            InetSocketAddress electionAddr = new InetSocketAddress("127.0.0.1",
+                    serverCount + fakeBasePort + i);
+            peers.put(Long.valueOf(i), new QuorumServer(i, peerAddress,
+                    electionAddr));
         }
         StringBuilder sb = new StringBuilder();
         for(int i = 0; i < count; i++) {
+            //make that testData exists otherwise it fails on windows
+            testData.mkdirs();
             qpsDirs[i] = File.createTempFile("sysTest", ".tmp", testData);
             qpsDirs[i].delete();
             qpsDirs[i].mkdir();

Modified: zookeeper/branches/branch-3.5/src/java/systest/org/apache/zookeeper/test/system/SimpleClient.java
URL: http://svn.apache.org/viewvc/zookeeper/branches/branch-3.5/src/java/systest/org/apache/zookeeper/test/system/SimpleClient.java?rev=1703503&r1=1703502&r2=1703503&view=diff
==============================================================================
--- zookeeper/branches/branch-3.5/src/java/systest/org/apache/zookeeper/test/system/SimpleClient.java
(original)
+++ zookeeper/branches/branch-3.5/src/java/systest/org/apache/zookeeper/test/system/SimpleClient.java
Thu Sep 17 07:10:51 2015
@@ -51,7 +51,9 @@ public class SimpleClient implements Ins
         try {
             zk = new ZooKeeper(hostPort, 15000, this);
             zk.getData("/simpleCase", true, this, null);
-            r.report("Client " + index + " connecting to " + hostPort); 
+            if (null != r) {
+                r.report("Client " + index + " connecting to " + hostPort);
+            }
         } catch (Exception e) {
             e.printStackTrace();
         }



Mime
View raw message