zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mic...@apache.org
Subject svn commit: r1582067 - /zookeeper/trunk/src/java/test/org/apache/zookeeper/server/ZooKeeperServerMainTest.java
Date Wed, 26 Mar 2014 21:25:14 GMT
Author: michim
Date: Wed Mar 26 21:25:14 2014
New Revision: 1582067

URL: http://svn.apache.org/r1582067
Log:
ZOOKEEPER-1878. Reset zookeeper.datadir.autocreate (Rakesh R via michim)

Modified:
    zookeeper/trunk/src/java/test/org/apache/zookeeper/server/ZooKeeperServerMainTest.java

Modified: zookeeper/trunk/src/java/test/org/apache/zookeeper/server/ZooKeeperServerMainTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/test/org/apache/zookeeper/server/ZooKeeperServerMainTest.java?rev=1582067&r1=1582066&r2=1582067&view=diff
==============================================================================
--- zookeeper/trunk/src/java/test/org/apache/zookeeper/server/ZooKeeperServerMainTest.java
(original)
+++ zookeeper/trunk/src/java/test/org/apache/zookeeper/server/ZooKeeperServerMainTest.java
Wed Mar 26 21:25:14 2014
@@ -177,16 +177,22 @@ public class ZooKeeperServerMainTest ext
     public void testWithoutAutoCreateDataLogDir() throws Exception {
         ClientBase.setupTestEnv();
         System.setProperty(FileTxnSnapLog.ZOOKEEPER_DATADIR_AUTOCREATE, "false");
-        final int CLIENT_PORT = PortAssignment.unique();
-
-        MainThread main = new MainThread(CLIENT_PORT, false, null);
-        String args[] = new String[1];
-        args[0] = main.confFile.toString();
-        main.start();
+        try {
+            final int CLIENT_PORT = PortAssignment.unique();
 
-        Assert.assertFalse("waiting for server being up", ClientBase
-                .waitForServerUp("127.0.0.1:" + CLIENT_PORT,
-                        CONNECTION_TIMEOUT / 2));
+            MainThread main = new MainThread(CLIENT_PORT, false, null);
+            String args[] = new String[1];
+            args[0] = main.confFile.toString();
+            main.start();
+
+            Assert.assertFalse("waiting for server being up", ClientBase
+                    .waitForServerUp("127.0.0.1:" + CLIENT_PORT,
+                            CONNECTION_TIMEOUT / 2));
+        } finally {
+            // resets "zookeeper.datadir.autocreate" flag
+            System.setProperty(FileTxnSnapLog.ZOOKEEPER_DATADIR_AUTOCREATE,
+                    FileTxnSnapLog.ZOOKEEPER_DATADIR_AUTOCREATE_DEFAULT);
+        }
     }
 
     /**



Mime
View raw message