Skip to content

Commit

Permalink
Remove trailing whitespace in JUnit assertion messages
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Oct 6, 2024
1 parent 594c269 commit 430519e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
5 changes: 3 additions & 2 deletions src/changes/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,11 @@ The <action> type attribute can be add,update,fix,remove.
<body>
<release version="2.17.1" date="YYYY-MM-DD" description="Version 2.17.1: Java 8 is required.">
<!-- FIX -->
<action dev="ggregory" type="fix" due-to="Gary Gregory">Clean ups in unit tests.</action>
<!-- ADD -->
<!-- UPDATE -->
<action dev="ggregory" type="update" due-to="Gary Gregory">Bump org.apache.commons:commons-parent from 74 to 76 #670, #676.</action>
<action dev="ggregory" type="update" due-to="Gary Gregory">Bump commons.bytebuddy.version from 1.15.1 to 1.15.3 #672, #673.</action>
<action dev="ggregory" type="update" due-to="Gary Gregory">Bump org.apache.commons:commons-parent from 74 to 76 #670, #676.</action>
<action dev="ggregory" type="update" due-to="Gary Gregory">Bump commons.bytebuddy.version from 1.15.1 to 1.15.3 #672, #673.</action>
</release>
<release version="2.17.0" date="2024-09-15" description="Version 2.17.0: Java 8 is required.">
<!-- ADD -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,7 @@ public void testReadInt() throws IOException {

@Test
public void testReadLine() {
assertThrows(UnsupportedOperationException.class, () -> this.sdis.readLine(),
"readLine should be unsupported. ");
assertThrows(UnsupportedOperationException.class, () -> this.sdis.readLine(), "readLine should be unsupported.");
}

@Test
Expand All @@ -140,7 +139,7 @@ public void testReadUnsignedShort() throws IOException {

@Test
public void testReadUTF() {
assertThrows(UnsupportedOperationException.class, () -> this.sdis.readUTF(), "readUTF should be unsupported. ");
assertThrows(UnsupportedOperationException.class, () -> this.sdis.readUTF(), "readUTF should be unsupported.");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ private void testAlternateLockDir(final LockableFileWriter lfw1) {

// try to open a second writer
try (LockableFileWriter lfw2 = new LockableFileWriter(file, StandardCharsets.UTF_8, true, altLockDir.getAbsolutePath())) {
fail("Somehow able to open a locked file. ");
fail("Somehow able to open a locked file.");
} catch (final IOException ioe) {
final String msg = ioe.getMessage();
assertTrue(msg.startsWith("Can't write file, lock "), "Exception message does not start correctly. ");
assertTrue(msg.startsWith("Can't write file, lock "), "Exception message does not start correctly.");
assertTrue(file.exists());
assertTrue(altLockFile.exists());
}
Expand Down Expand Up @@ -163,20 +163,20 @@ public void testFileLocked() throws IOException {

// try to open a second writer
try (LockableFileWriter lfw2 = new LockableFileWriter(file)) {
fail("Somehow able to open a locked file. ");
fail("Somehow able to open a locked file.");
} catch (final IOException ioe) {
final String msg = ioe.getMessage();
assertTrue(msg.startsWith("Can't write file, lock "), "Exception message does not start correctly. ");
assertTrue(msg.startsWith("Can't write file, lock "), "Exception message does not start correctly.");
assertTrue(file.exists());
assertTrue(lockFile.exists());
}

// try to open a third writer
try (LockableFileWriter lfw3 = new LockableFileWriter(file)) {
fail("Somehow able to open a locked file. ");
fail("Somehow able to open a locked file.");
} catch (final IOException ioe) {
final String msg = ioe.getMessage();
assertTrue(msg.startsWith("Can't write file, lock "), "Exception message does not start correctly. ");
assertTrue(msg.startsWith("Can't write file, lock "), "Exception message does not start correctly.");
assertTrue(file.exists());
assertTrue(lockFile.exists());
}
Expand Down

0 comments on commit 430519e

Please sign in to comment.