[ https://issues.apache.org/jira/browse/ZOOKEEPER-2656?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15796731#comment-15796731 ]
ASF GitHub Bot commented on ZOOKEEPER-2656: ------------------------------------------- Github user eribeiro commented on the issue: https://github.com/apache/zookeeper/pull/140 @hanm Oh, excuse me! There's a gotcha with ``File.equals()``. Shame on me for inducing your change to ``equals``. 😞 See here: http://stackoverflow.com/questions/8930859/java-file-equals And here: http://stackoverflow.com/questions/29368308/java-nio-how-is-path-issamefile-different-from-path-equals TL;DR: ``f1.getCanonicalPath().equals(f2.getCanonicalPath())`` is the right way to go. Or with **java 7** we can do ``Files.isSameFile(f1.toPath(), f2.toPath());`` > Fix ServerConfigTest#testValidArguments test case failures > ---------------------------------------------------------- > > Key: ZOOKEEPER-2656 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2656 > Project: ZooKeeper > Issue Type: Test > Reporter: Rakesh R > Assignee: Michael Han > Fix For: 3.4.10, 3.5.3, 3.6.0 > > > This jira to fix ServerConfigTest#testValidArguments test case failure. > Reference: > https://builds.apache.org/job/ZooKeeper-trunk/3207/testReport/org.apache.zookeeper/ServerConfigTest/testValidArguments/ > {code} > Error Message > expected: java.lang.String</data/dir> but was: java.io.File</data/dir> > Stacktrace > junit.framework.AssertionFailedError: expected: java.lang.String</data/dir> > but was: java.io.File</data/dir> > at > org.apache.zookeeper.ServerConfigTest.testValidArguments(ServerConfigTest.java:48) > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)