Skip to content

Commit b80e379

Browse files
Compare String instead of Path to fix test on macOS.
1 parent 63567fb commit b80e379

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

tests/objectbox-java-test/src/test/java/io/objectbox/BoxStoreBuilderTest.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,15 @@ public void directoryUnicodePath() throws IOException {
101101
store.close();
102102

103103
// Check only expected files and directories exist.
104-
Set<Path> expectedPaths = new HashSet<>();
105-
expectedPaths.add(parentTestDir.toPath());
106-
expectedPaths.add(testDir.toPath());
104+
// Note: can not compare Path objects, does not appear to work on macOS for unknown reason.
105+
Set<String> expectedPaths = new HashSet<>();
106+
expectedPaths.add(parentTestDir.toPath().toString());
107+
expectedPaths.add(testDir.toPath().toString());
107108
Path testDirPath = testDir.toPath();
108-
expectedPaths.add(testDirPath.resolve("data.mdb"));
109-
expectedPaths.add(testDirPath.resolve("lock.mdb"));
109+
expectedPaths.add(testDirPath.resolve("data.mdb").toString());
110+
expectedPaths.add(testDirPath.resolve("lock.mdb").toString());
110111
try (Stream<Path> files = Files.walk(parentTestDir.toPath())) {
111-
List<Path> unexpectedPaths = files.filter(path -> !expectedPaths.remove(path)).collect(Collectors.toList());
112+
List<Path> unexpectedPaths = files.filter(path -> !expectedPaths.remove(path.toString())).collect(Collectors.toList());
112113
if (!unexpectedPaths.isEmpty()) {
113114
fail("Found unexpected paths: " + unexpectedPaths);
114115
}

0 commit comments

Comments
 (0)