This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-codec.git
The following commit(s) were added to refs/heads/master by this push:
new 780cc73a Test should use JUnit's fail() instead of throwing a
RuntimeExceptiom
780cc73a is described below
commit 780cc73a629b332f317f46b30b7ce2df9270daa6
Author: Gary Gregory <[email protected]>
AuthorDate: Fri Jun 23 09:28:35 2023 -0400
Test should use JUnit's fail() instead of throwing a RuntimeExceptiom
---
src/changes/changes.xml | 1 +
.../org/apache/commons/codec/digest/PureJavaCrc32Test.java | 12 ++++++------
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index f35f11c3..e77c7129 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -46,6 +46,7 @@ The <action> type attribute can be add,update,fix,remove.
<release version="1.16.1" date="20YY-MM-DD" description="Feature and fix
release.">
<!-- ADD -->
<!-- FIX -->
+ <action issue="CODEC-295" dev="ggregory" type="fix" due-to="Gary
Gregory">Test clean ups.</action>
<!-- UPDATE -->
</release>
<release version="1.16.0" date="2023-06-17" description="Feature and fix
release.">
diff --git
a/src/test/java/org/apache/commons/codec/digest/PureJavaCrc32Test.java
b/src/test/java/org/apache/commons/codec/digest/PureJavaCrc32Test.java
index d709b9b7..a27ce1a6 100644
--- a/src/test/java/org/apache/commons/codec/digest/PureJavaCrc32Test.java
+++ b/src/test/java/org/apache/commons/codec/digest/PureJavaCrc32Test.java
@@ -17,6 +17,7 @@
package org.apache.commons.codec.digest;
import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.fail;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
@@ -294,12 +295,11 @@ public class PureJavaCrc32Test {
//check result
if(c == zip) {
expected = result;
- } else if (expected == null) {
- throw new RuntimeException("The first class is " +
- c.getName() + " but not " + zip.getName());
- } else if (result.value != expected.value) {
- throw new RuntimeException(c + " has bugs!");
- }
+ } else if (expected == null) {
+ fail("The first class is " + c.getName() + " but not " +
zip.getName());
+ } else if (result.value != expected.value) {
+ fail(c + " has bugs!");
+ }
//compare result with previous
for(final BenchResult p : previous) {