zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rake...@apache.org
Subject zookeeper git commit: ZOOKEEPER-2656: Fix ServerConfigTest#testValidArguments test case.
Date Fri, 06 Jan 2017 12:12:56 GMT
Repository: zookeeper
Updated Branches:
  refs/heads/master 0753f4cdc -> 1d38d30cf


ZOOKEEPER-2656: Fix ServerConfigTest#testValidArguments test case.

ServerConfig.getDataDir returns type String in branch-3.4 but return type File in branch-3.5
and master. So we need to deal with this difference accordingly in our test.

This PR is intended to be merged in master, branch-3.5, and branch-3.4.

rakeshadr PTAL

Author: Michael Han <hanm@apache.org>

Reviewers: Edward Ribeiro <edward.ribeiro@gmail.com>, Rakesh Radhakrishnan <rakeshr@apache.org>

Closes #140 from hanm/ZOOKEEPER-2565


Project: http://git-wip-us.apache.org/repos/asf/zookeeper/repo
Commit: http://git-wip-us.apache.org/repos/asf/zookeeper/commit/1d38d30c
Tree: http://git-wip-us.apache.org/repos/asf/zookeeper/tree/1d38d30c
Diff: http://git-wip-us.apache.org/repos/asf/zookeeper/diff/1d38d30c

Branch: refs/heads/master
Commit: 1d38d30cfd1aa47f22451f4df53ae2363ea20a82
Parents: 0753f4c
Author: Michael Han <hanm@apache.org>
Authored: Fri Jan 6 17:41:31 2017 +0530
Committer: Rakesh Radhakrishnan <rakeshr@apache.org>
Committed: Fri Jan 6 17:41:31 2017 +0530

----------------------------------------------------------------------
 .../org/apache/zookeeper/ServerConfigTest.java    | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zookeeper/blob/1d38d30c/src/java/test/org/apache/zookeeper/ServerConfigTest.java
----------------------------------------------------------------------
diff --git a/src/java/test/org/apache/zookeeper/ServerConfigTest.java b/src/java/test/org/apache/zookeeper/ServerConfigTest.java
index e2d0da8..27faa74 100644
--- a/src/java/test/org/apache/zookeeper/ServerConfigTest.java
+++ b/src/java/test/org/apache/zookeeper/ServerConfigTest.java
@@ -23,6 +23,8 @@ import org.junit.Before;
 import org.junit.Test;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 
 import java.io.File;
 
@@ -47,7 +49,7 @@ public class ServerConfigTest {
         serverConfig.parse(args);
 
         assertEquals(2181, serverConfig.getClientPortAddress().getPort());
-        assertEquals(new File("/data/dir"), serverConfig.getDataDir());
+        assertTrue(checkEquality("/data/dir", serverConfig.getDataDir()));
         assertEquals(60000, serverConfig.getTickTime());
         assertEquals(10000, serverConfig.getMaxClientCnxns());
     }
@@ -57,4 +59,16 @@ public class ServerConfigTest {
         String[] args = {"2181", "/data/dir", "60000", "10000", "9999"};
         serverConfig.parse(args);
     }
-}
+
+    boolean checkEquality(String a, String b) {
+        assertNotNull(a);
+        assertNotNull(b);
+        return a.equals(b);
+    }
+
+    boolean checkEquality(String a, File b) {
+        assertNotNull(a);
+        assertNotNull(b);
+        return new File(a).equals(b);
+    }
+}
\ No newline at end of file


Mime
View raw message