Skip to content

Commit

Permalink
Update JUnit assertion messages to be clearer on use of symbolic links
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Nov 13, 2024
1 parent 8662f89 commit 79efcff
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void testDeleteDirWithASymbolicLinkDir2() throws Exception {
assertEquals(1, top.list().length);

// ensure that the contents of the symlink were NOT removed.
assertEquals(1, randomDirectory.list().length, "Contents of sym link should not have been removed");
assertEquals(1, randomDirectory.list().length, "Contents of symbolic link should not have been removed");
}

@Test
Expand Down Expand Up @@ -100,7 +100,7 @@ public void testDeleteDirWithASymlinkDir() throws Exception {
assertEquals(1, top.list().length);

// ensure that the contents of the symlink were NOT removed.
assertEquals(1, randomDirectory.list().length, "Contents of sym link should not have been removed");
assertEquals(1, randomDirectory.list().length, "Contents of symbolic link should not have been removed");
}

@Test
Expand Down Expand Up @@ -187,7 +187,7 @@ public void testDeleteParentSymbolicLink2() throws Exception {
assertEquals(2, top.list().length);

// ensure that the contents of the symlink were NOT removed.
assertEquals(1, randomDirectory.list().length, "Contents of sym link should not have been removed");
assertEquals(1, randomDirectory.list().length, "Contents of symbolic link should not have been removed");
}

@Test
Expand Down Expand Up @@ -220,7 +220,7 @@ public void testDeleteParentSymlink() throws Exception {
assertEquals(2, top.list().length);

// ensure that the contents of the symlink were NOT removed.
assertEquals(1, randomDirectory.list().length, "Contents of sym link should not have been removed");
assertEquals(1, randomDirectory.list().length, "Contents of symbolic link should not have been removed");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public void testCleanDirWithASymlinkDir() throws Exception {
assertEquals(0, realOuter.list().length);

// ensure that the contents of the symlink were NOT removed.
assertEquals(1, randomDirectory.list().length, "Contents of sym link should not have been removed");
assertEquals(1, randomDirectory.list().length, "Contents of symbolic link should not have been removed");
}

@Test
Expand Down Expand Up @@ -125,7 +125,7 @@ public void testCleanDirWithParentSymlinks() throws Exception {
assertEquals(0, realParent.list().length);

// ensure that the contents of the symlink were NOT removed.
assertEquals(1, randomDirectory.list().length, "Contents of sym link should not have been removed");
assertEquals(1, randomDirectory.list().length, "Contents of symbolic link should not have been removed");
}

@Test
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/org/apache/commons/io/FileUtilsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ private void createCircularSymbolicLink(final File file) throws IOException {
createCircularOsSymbolicLink(linkName, targetName);
}
// Sanity check:
assertTrue(Files.isSymbolicLink(linkPath), () -> "Expected a sym link here: " + linkName);
assertTrue(Files.isSymbolicLink(linkPath), () -> "Expected a symbolic link here: " + linkName);
}

private void createFilesForTestCopyDirectory(final File grandParentDir, final File parentDir, final File childDir) throws IOException {
Expand Down

0 comments on commit 79efcff

Please sign in to comment.