You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by eb...@apache.org on 2024/11/18 12:53:27 UTC

(commons-validator) branch master updated (e1880452 -> cdc0125b)

This is an automated email from the ASF dual-hosted git repository.

ebourg pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-validator.git


    from e1880452 Merge pull request #286 from apache/dependabot/github_actions/github/codeql-action-3.27.4
     new d1e92298 Replace org.junit.Ignore with org.junit.jupiter.api.Disabled
     new 528a9e2e Replace org.junit.Before with org.junit.jupiter.api.BeforeEach
     new 4b2e3dc0 Replace org.junit.Assert with org.junit.jupiter.api.Assertions
     new eba5e863 Fixed a few typos
     new a4908590 Use Java-style array declarations
     new 690d6e0d Removed unused imports
     new 7eee2066 Simplify the test assertions
     new dfd4a9e4 Removed unnecessary lambdas in the tests
     new 55fde659 Use assertThrows() to test the expected exceptions
     new 0a5724e1 Use Integer.compare() to compare integers
     new cdc0125b Fixed Javadoc errors

The 11 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../java/org/apache/commons/validator/Arg.java     |  2 +-
 .../java/org/apache/commons/validator/Field.java   |  6 +--
 .../org/apache/commons/validator/UrlValidator.java |  4 +-
 .../apache/commons/validator/ValidatorAction.java  | 10 ++---
 .../org/apache/commons/validator/package-info.java |  2 +-
 .../routines/AbstractCalendarValidator.java        | 17 +-------
 .../commons/validator/routines/CodeValidator.java  |  4 +-
 .../validator/routines/CreditCardValidator.java    |  2 +-
 .../validator/routines/DomainValidator.java        |  4 +-
 .../commons/validator/routines/UrlValidator.java   |  2 +-
 .../routines/checkdigit/ABANumberCheckDigit.java   |  2 +-
 .../routines/checkdigit/CASNumberCheckDigit.java   |  2 +-
 .../routines/checkdigit/EAN13CheckDigit.java       |  2 +-
 .../routines/checkdigit/ECNumberCheckDigit.java    |  2 +-
 .../routines/checkdigit/ISBN10CheckDigit.java      |  2 +-
 .../routines/checkdigit/ModulusCheckDigit.java     |  2 +-
 .../routines/checkdigit/ModulusTenCheckDigit.java  | 26 +++++------
 .../routines/checkdigit/SedolCheckDigit.java       |  4 +-
 .../commons/validator/routines/package-info.java   | 12 ++---
 .../commons/validator/resources/validator_1_0.dtd  |  4 +-
 .../validator/resources/validator_1_0_1.dtd        |  4 +-
 .../commons/validator/resources/validator_1_1.dtd  |  4 +-
 .../validator/resources/validator_1_1_3.dtd        |  2 +-
 .../validator/resources/validator_1_2_0.dtd        |  4 +-
 .../validator/resources/validator_1_3_0.dtd        |  4 +-
 .../validator/resources/validator_1_4_0.dtd        |  4 +-
 src/site/xdoc/tasks.xml                            |  2 +-
 src/site/xdoc/validator_2_0_0_proposal.dtd         |  2 +-
 .../commons/validator/AbstractNumberTest.java      |  6 +--
 .../org/apache/commons/validator/DateTest.java     |  8 ++--
 .../org/apache/commons/validator/EmailTest.java    | 16 +++----
 .../apache/commons/validator/ExceptionTest.java    | 27 +++++-------
 .../apache/commons/validator/ExtensionTest.java    | 31 ++++++-------
 .../org/apache/commons/validator/FieldTest.java    |  8 ++--
 .../validator/GenericTypeValidatorTest.java        | 30 ++++++-------
 .../org/apache/commons/validator/LocaleTest.java   |  2 +-
 .../commons/validator/MultipleConfigFilesTest.java | 13 +++---
 .../org/apache/commons/validator/MultipleTest.java | 41 ++++++++---------
 .../apache/commons/validator/ParameterTest.java    |  4 +-
 .../apache/commons/validator/RequiredIfTest.java   | 37 ++++++++--------
 .../apache/commons/validator/RequiredNameTest.java | 45 +++++++++----------
 .../apache/commons/validator/RetrieveFormTest.java | 30 ++++++-------
 .../commons/validator/ValidatorResourcesTest.java  | 14 ++----
 .../commons/validator/ValidatorResultsTest.java    | 10 ++---
 .../apache/commons/validator/ValidatorTest.java    |  2 +-
 .../routines/AbstractNumberValidatorTest.java      | 16 +++----
 .../validator/routines/CalendarValidatorTest.java  | 36 ++++++++-------
 .../routines/CreditCardValidatorTest.java          |  9 +---
 .../validator/routines/DateValidatorTest.java      |  3 +-
 .../validator/routines/DomainValidatorTest.java    |  7 ++-
 .../validator/routines/EmailValidatorTest.java     |  1 -
 .../validator/routines/IBANValidatorTest.java      |  2 +-
 .../validator/routines/ISBNValidatorTest.java      | 44 ++++++-------------
 .../validator/routines/ISSNValidatorTest.java      | 31 ++++---------
 .../routines/InetAddressValidatorTest.java         |  4 +-
 .../validator/routines/PercentValidatorTest.java   |  2 +-
 .../validator/routines/RegexValidatorTest.java     | 51 ++++++----------------
 .../validator/routines/TimeValidatorTest.java      | 26 +++++------
 .../validator/routines/UrlValidatorTest.java       |  5 +--
 .../checkdigit/AbstractCheckDigitTest.java         | 27 ++++--------
 .../routines/checkdigit/CUSIPCheckDigitTest.java   |  4 +-
 .../routines/checkdigit/IBANCheckDigitTest.java    |  8 ++--
 .../routines/checkdigit/ISBNCheckDigitTest.java    | 34 ++++-----------
 .../routines/checkdigit/ISINCheckDigitTest.java    |  2 +-
 .../checkdigit/ModulusTenCUSIPCheckDigitTest.java  |  4 +-
 .../checkdigit/ModulusTenSedolCheckDigitTest.java  |  2 +-
 .../routines/checkdigit/SedolCheckDigitTest.java   |  2 +-
 .../apache/commons/validator/util/FlagsTest.java   |  4 +-
 .../commons/validator/RetrieveFormTest-config.xml  |  2 +-
 69 files changed, 336 insertions(+), 451 deletions(-)


(commons-validator) 04/11: Fixed a few typos

Posted by eb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ebourg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-validator.git

commit eba5e863b2aa2d58b2b356280892f3e52f5f509e
Author: Emmanuel Bourg <eb...@apache.org>
AuthorDate: Mon Nov 18 10:53:02 2024 +0100

    Fixed a few typos
---
 .../java/org/apache/commons/validator/Arg.java     |  2 +-
 .../java/org/apache/commons/validator/Field.java   |  6 ++---
 .../org/apache/commons/validator/UrlValidator.java |  4 +--
 .../apache/commons/validator/ValidatorAction.java  |  8 +++---
 .../org/apache/commons/validator/package-info.java |  2 +-
 .../commons/validator/routines/CodeValidator.java  |  4 +--
 .../validator/routines/DomainValidator.java        |  4 +--
 .../commons/validator/routines/UrlValidator.java   |  2 +-
 .../routines/checkdigit/ABANumberCheckDigit.java   |  2 +-
 .../routines/checkdigit/CASNumberCheckDigit.java   |  2 +-
 .../routines/checkdigit/EAN13CheckDigit.java       |  2 +-
 .../routines/checkdigit/ECNumberCheckDigit.java    |  2 +-
 .../routines/checkdigit/ISBN10CheckDigit.java      |  2 +-
 .../routines/checkdigit/ModulusCheckDigit.java     |  2 +-
 .../routines/checkdigit/ModulusTenCheckDigit.java  | 26 +++++++++----------
 .../routines/checkdigit/SedolCheckDigit.java       |  4 +--
 .../commons/validator/routines/package-info.java   |  8 +++---
 .../commons/validator/resources/validator_1_0.dtd  |  4 +--
 .../validator/resources/validator_1_0_1.dtd        |  4 +--
 .../commons/validator/resources/validator_1_1.dtd  |  4 +--
 .../validator/resources/validator_1_1_3.dtd        |  2 +-
 .../validator/resources/validator_1_2_0.dtd        |  4 +--
 .../validator/resources/validator_1_3_0.dtd        |  4 +--
 .../validator/resources/validator_1_4_0.dtd        |  4 +--
 src/site/xdoc/tasks.xml                            |  2 +-
 src/site/xdoc/validator_2_0_0_proposal.dtd         |  2 +-
 .../org/apache/commons/validator/DateTest.java     |  2 +-
 .../org/apache/commons/validator/EmailTest.java    |  4 +--
 .../apache/commons/validator/ExtensionTest.java    |  4 +--
 .../org/apache/commons/validator/FieldTest.java    |  8 +++---
 .../org/apache/commons/validator/LocaleTest.java   |  2 +-
 .../org/apache/commons/validator/MultipleTest.java |  2 +-
 .../apache/commons/validator/RetrieveFormTest.java | 30 +++++++++++-----------
 .../validator/routines/IBANValidatorTest.java      |  2 +-
 .../validator/routines/PercentValidatorTest.java   |  2 +-
 .../validator/routines/TimeValidatorTest.java      |  6 ++---
 .../checkdigit/AbstractCheckDigitTest.java         |  2 +-
 .../commons/validator/RetrieveFormTest-config.xml  |  2 +-
 38 files changed, 89 insertions(+), 89 deletions(-)

diff --git a/src/main/java/org/apache/commons/validator/Arg.java b/src/main/java/org/apache/commons/validator/Arg.java
index 138a62e9..f57945b0 100644
--- a/src/main/java/org/apache/commons/validator/Arg.java
+++ b/src/main/java/org/apache/commons/validator/Arg.java
@@ -57,7 +57,7 @@ public class Arg implements Cloneable, Serializable {
     protected String name;
 
     /**
-     * This argument's position in the message. Set postion=0 to
+     * This argument's position in the message. Set position=0 to
      * make a replacement in this string: "some msg {0}".
      * @since 1.1
      */
diff --git a/src/main/java/org/apache/commons/validator/Field.java b/src/main/java/org/apache/commons/validator/Field.java
index a6d1db2f..cf807a29 100644
--- a/src/main/java/org/apache/commons/validator/Field.java
+++ b/src/main/java/org/apache/commons/validator/Field.java
@@ -71,7 +71,7 @@ public class Field implements Cloneable, Serializable {
     protected static final String TOKEN_END = "}";
 
     /**
-     * A Vriable token.
+     * A Variable token.
      */
     protected static final String TOKEN_VAR = "var:";
 
@@ -236,7 +236,7 @@ public class Field implements Cloneable, Serializable {
 
         final int position = arg.getPosition();
 
-        // position has been explicity set
+        // position has been explicitly set
         if (position >= 0) {
             return;
         }
@@ -353,7 +353,7 @@ public class Field implements Cloneable, Serializable {
     /**
      * Gets an unmodifiable {@code List} of the dependencies in the same
      * order they were defined in parameter passed to the setDepends() method.
-     * @return A list of the Field's dependancies.
+     * @return A list of the Field's dependencies.
      */
     public List<String> getDependencyList() {
         return Collections.unmodifiableList(dependencyList);
diff --git a/src/main/java/org/apache/commons/validator/UrlValidator.java b/src/main/java/org/apache/commons/validator/UrlValidator.java
index 21784576..483c9bc4 100644
--- a/src/main/java/org/apache/commons/validator/UrlValidator.java
+++ b/src/main/java/org/apache/commons/validator/UrlValidator.java
@@ -28,7 +28,7 @@ import org.apache.commons.validator.util.Flags;
 
 /**
  * <p>Validates URLs.</p>
- * Behavour of validation is modified by passing in options:
+ * Behaviour of validation is modified by passing in options:
  * <ul>
  * <li>ALLOW_2_SLASHES - [FALSE]  Allows double '/' characters in the path
  * component.</li>
@@ -212,7 +212,7 @@ public class UrlValidator implements Serializable {
     }
 
     /**
-     * Behavour of validation is modified by passing in options:
+     * Behaviour of validation is modified by passing in options:
      * @param schemes The set of valid schemes.
      * @param options The options should be set using the public constants declared in
      * this class.  To set multiple options you simply add them together.  For example,
diff --git a/src/main/java/org/apache/commons/validator/ValidatorAction.java b/src/main/java/org/apache/commons/validator/ValidatorAction.java
index 1dcf6c7a..315499fd 100644
--- a/src/main/java/org/apache/commons/validator/ValidatorAction.java
+++ b/src/main/java/org/apache/commons/validator/ValidatorAction.java
@@ -94,7 +94,7 @@ public class ValidatorAction implements Serializable {
 
     /**
      * The other {@code ValidatorAction}s that this one depends on. If any errors occur in an action that this one depends on, this action will not be
-     * processsed.
+     * processed.
      */
     private String depends;
 
@@ -114,7 +114,7 @@ public class ValidatorAction implements Serializable {
     private String jsFunction;
 
     /**
-     * An optional field to containing a JavaScript representation of the Java method assocated with this action.
+     * An optional field to containing a JavaScript representation of the Java method associated with this action.
      */
     private String javascript;
 
@@ -254,7 +254,7 @@ public class ValidatorAction implements Serializable {
     /**
      * Returns the dependent validator names as an unmodifiable {@code List}.
      *
-     * @return List of the validator action's depedents.
+     * @return List of the validator action's dependents.
      */
     public List<String> getDependencyList() {
         return Collections.unmodifiableList(dependencyList);
@@ -445,7 +445,7 @@ public class ValidatorAction implements Serializable {
      * Load the JavaScript function specified by the given path. For this implementation, the {@code jsFunction} property should contain a fully qualified
      * package and script name, separated by periods, to be loaded from the class loader that created this instance.
      *
-     * TODO if the path begins with a '/' the path will be intepreted as absolute, and remain unchanged. If this fails then it will attempt to treat the path as
+     * TODO if the path begins with a '/' the path will be interpreted as absolute, and remain unchanged. If this fails then it will attempt to treat the path as
      * a file path. It is assumed the script ends with a '.js'.
      */
     protected synchronized void loadJavascriptFunction() {
diff --git a/src/main/java/org/apache/commons/validator/package-info.java b/src/main/java/org/apache/commons/validator/package-info.java
index 49fff7d2..3778d34e 100644
--- a/src/main/java/org/apache/commons/validator/package-info.java
+++ b/src/main/java/org/apache/commons/validator/package-info.java
@@ -82,7 +82,7 @@
  * <caption>Reserved Parameters</caption>
  * <tr>
  * <th>Class Name</th>
- * <th>Validator Contstant</th>
+ * <th>Validator Constant</th>
  * <th>Description</th>
  * </tr>
  * <tr>
diff --git a/src/main/java/org/apache/commons/validator/routines/CodeValidator.java b/src/main/java/org/apache/commons/validator/routines/CodeValidator.java
index adac0e35..d07beb90 100644
--- a/src/main/java/org/apache/commons/validator/routines/CodeValidator.java
+++ b/src/main/java/org/apache/commons/validator/routines/CodeValidator.java
@@ -100,7 +100,7 @@ public final class CodeValidator implements Serializable {
      *
      * @param regexValidator The format regular expression validator
      * @param length The length of the code
-     *  (sets the mimimum/maximum to the same value)
+     *  (sets the minimum/maximum to the same value)
      * @param checkdigit The check digit validation routine
      */
     public CodeValidator(final RegexValidator regexValidator, final int length, final CheckDigit checkdigit) {
@@ -143,7 +143,7 @@ public final class CodeValidator implements Serializable {
      *
      * @param regex The format regular expression.
      * @param length The length of the code
-     *  (sets the mimimum/maximum to the same)
+     *  (sets the minimum/maximum to the same)
      * @param checkdigit The check digit validation routine
      */
     public CodeValidator(final String regex, final int length, final CheckDigit checkdigit) {
diff --git a/src/main/java/org/apache/commons/validator/routines/DomainValidator.java b/src/main/java/org/apache/commons/validator/routines/DomainValidator.java
index a9b0d986..1bb7b8a1 100644
--- a/src/main/java/org/apache/commons/validator/routines/DomainValidator.java
+++ b/src/main/java/org/apache/commons/validator/routines/DomainValidator.java
@@ -70,11 +70,11 @@ public class DomainValidator implements Serializable {
      * @since 1.5.1 made public and added read-only array references
      */
     public enum ArrayType {
-        /** Update (or get a copy of) the GENERIC_TLDS_PLUS table containing additonal generic TLDs */
+        /** Update (or get a copy of) the GENERIC_TLDS_PLUS table containing additional generic TLDs */
         GENERIC_PLUS,
         /** Update (or get a copy of) the GENERIC_TLDS_MINUS table containing deleted generic TLDs */
         GENERIC_MINUS,
-        /** Update (or get a copy of) the COUNTRY_CODE_TLDS_PLUS table containing additonal country code TLDs */
+        /** Update (or get a copy of) the COUNTRY_CODE_TLDS_PLUS table containing additional country code TLDs */
         COUNTRY_CODE_PLUS,
         /** Update (or get a copy of) the COUNTRY_CODE_TLDS_MINUS table containing deleted country code TLDs */
         COUNTRY_CODE_MINUS,
diff --git a/src/main/java/org/apache/commons/validator/routines/UrlValidator.java b/src/main/java/org/apache/commons/validator/routines/UrlValidator.java
index c0f35f90..347bf663 100644
--- a/src/main/java/org/apache/commons/validator/routines/UrlValidator.java
+++ b/src/main/java/org/apache/commons/validator/routines/UrlValidator.java
@@ -410,7 +410,7 @@ public class UrlValidator implements Serializable {
      * If a RegexValidator was supplied and it matches, then the authority is regarded
      * as valid with no further checks, otherwise the method checks against the
      * AUTHORITY_PATTERN and the DomainValidator (ALLOW_LOCAL_URLS)
-     * @param authority Authority value to validate, alllows IDN
+     * @param authority Authority value to validate, allows IDN
      * @return true if authority (hostname and port) is valid.
      */
     protected boolean isValidAuthority(final String authority) {
diff --git a/src/main/java/org/apache/commons/validator/routines/checkdigit/ABANumberCheckDigit.java b/src/main/java/org/apache/commons/validator/routines/checkdigit/ABANumberCheckDigit.java
index 42853b09..18d5e1c9 100644
--- a/src/main/java/org/apache/commons/validator/routines/checkdigit/ABANumberCheckDigit.java
+++ b/src/main/java/org/apache/commons/validator/routines/checkdigit/ABANumberCheckDigit.java
@@ -71,7 +71,7 @@ public final class ABANumberCheckDigit extends ModulusCheckDigit {
      *
      * @param charValue The numeric value of the character.
      * @param leftPos The position of the character in the code, counting from left to right
-     * @param rightPos The positionof the character in the code, counting from right to left
+     * @param rightPos The position of the character in the code, counting from right to left
      * @return The weighted value of the character.
      */
     @Override
diff --git a/src/main/java/org/apache/commons/validator/routines/checkdigit/CASNumberCheckDigit.java b/src/main/java/org/apache/commons/validator/routines/checkdigit/CASNumberCheckDigit.java
index 6f0e68dc..a840b20a 100644
--- a/src/main/java/org/apache/commons/validator/routines/checkdigit/CASNumberCheckDigit.java
+++ b/src/main/java/org/apache/commons/validator/routines/checkdigit/CASNumberCheckDigit.java
@@ -129,7 +129,7 @@ public final class CASNumberCheckDigit extends ModulusCheckDigit {
      *
      * @param charValue The numeric value of the character.
      * @param leftPos The position of the character in the code, counting from left to right
-     * @param rightPos The positionof the character in the code, counting from right to left
+     * @param rightPos The position of the character in the code, counting from right to left
      * @return The weighted value of the character.
      */
     @Override
diff --git a/src/main/java/org/apache/commons/validator/routines/checkdigit/EAN13CheckDigit.java b/src/main/java/org/apache/commons/validator/routines/checkdigit/EAN13CheckDigit.java
index 8092a8d2..b55a60d8 100644
--- a/src/main/java/org/apache/commons/validator/routines/checkdigit/EAN13CheckDigit.java
+++ b/src/main/java/org/apache/commons/validator/routines/checkdigit/EAN13CheckDigit.java
@@ -65,7 +65,7 @@ public final class EAN13CheckDigit extends ModulusCheckDigit {
      *
      * @param charValue The numeric value of the character.
      * @param leftPos The position of the character in the code, counting from left to right
-     * @param rightPos The positionof the character in the code, counting from right to left
+     * @param rightPos The position of the character in the code, counting from right to left
      * @return The weighted value of the character.
      */
     @Override
diff --git a/src/main/java/org/apache/commons/validator/routines/checkdigit/ECNumberCheckDigit.java b/src/main/java/org/apache/commons/validator/routines/checkdigit/ECNumberCheckDigit.java
index 653e7bf5..0835c8e1 100644
--- a/src/main/java/org/apache/commons/validator/routines/checkdigit/ECNumberCheckDigit.java
+++ b/src/main/java/org/apache/commons/validator/routines/checkdigit/ECNumberCheckDigit.java
@@ -113,7 +113,7 @@ public final class ECNumberCheckDigit extends ModulusCheckDigit {
      *
      * @param charValue The numeric value of the character.
      * @param leftPos The position of the character in the code, counting from left to right
-     * @param rightPos The positionof the character in the code, counting from right to left
+     * @param rightPos The position of the character in the code, counting from right to left
      * @return The weighted value of the character.
      */
     @Override
diff --git a/src/main/java/org/apache/commons/validator/routines/checkdigit/ISBN10CheckDigit.java b/src/main/java/org/apache/commons/validator/routines/checkdigit/ISBN10CheckDigit.java
index 13cb95fc..b590e4ef 100644
--- a/src/main/java/org/apache/commons/validator/routines/checkdigit/ISBN10CheckDigit.java
+++ b/src/main/java/org/apache/commons/validator/routines/checkdigit/ISBN10CheckDigit.java
@@ -103,7 +103,7 @@ public final class ISBN10CheckDigit extends ModulusCheckDigit {
      *
      * @param charValue The numeric value of the character.
      * @param leftPos The position of the character in the code, counting from left to right
-     * @param rightPos The positionof the character in the code, counting from right to left
+     * @param rightPos The position of the character in the code, counting from right to left
      * @return The weighted value of the character.
      */
     @Override
diff --git a/src/main/java/org/apache/commons/validator/routines/checkdigit/ModulusCheckDigit.java b/src/main/java/org/apache/commons/validator/routines/checkdigit/ModulusCheckDigit.java
index 41339cea..f109694d 100644
--- a/src/main/java/org/apache/commons/validator/routines/checkdigit/ModulusCheckDigit.java
+++ b/src/main/java/org/apache/commons/validator/routines/checkdigit/ModulusCheckDigit.java
@@ -197,7 +197,7 @@ public abstract class ModulusCheckDigit extends AbstractCheckDigit implements Se
      *
      * @param charValue The numeric value of the character
      * @param leftPos The position of the character in the code, counting from left to right
-     * @param rightPos The positionof the character in the code, counting from right to left
+     * @param rightPos The position of the character in the code, counting from right to left
      * @return The weighted value of the character
      * @throws CheckDigitException if an error occurs calculating
      * the weighted value
diff --git a/src/main/java/org/apache/commons/validator/routines/checkdigit/ModulusTenCheckDigit.java b/src/main/java/org/apache/commons/validator/routines/checkdigit/ModulusTenCheckDigit.java
index 1632f030..414f45b2 100644
--- a/src/main/java/org/apache/commons/validator/routines/checkdigit/ModulusTenCheckDigit.java
+++ b/src/main/java/org/apache/commons/validator/routines/checkdigit/ModulusTenCheckDigit.java
@@ -34,7 +34,7 @@ import org.apache.commons.validator.routines.CodeValidator;
  * that method are invalid.</li>
  * <li>Calculating a <em>weighted value</em> by multiplying the character's
  * integer value by a <em>weighting factor</em>. The <em>weighting factor</em> is
- * selected from the configured {@code postitionWeight} array based on its
+ * selected from the configured {@code positionWeight} array based on its
  * position. The {@code postitionWeight} values are used either
  * left-to-right (when {@code useRightPos=false}) or right-to-left (when
  * {@code useRightPos=true}).</li>
@@ -118,7 +118,7 @@ public final class ModulusTenCheckDigit extends ModulusCheckDigit {
     /**
      * The weighted values to apply based on the character position
      */
-    private final int[] postitionWeight;
+    private final int[] positionWeight;
 
     /**
      * {@code true} if use positionWeights from right to left
@@ -134,24 +134,24 @@ public final class ModulusTenCheckDigit extends ModulusCheckDigit {
      * Constructs a modulus 10 Check Digit routine with the specified weighting
      * from left to right.
      *
-     * @param postitionWeight the weighted values to apply based on the
+     * @param positionWeight the weighted values to apply based on the
      *            character position
      */
-    public ModulusTenCheckDigit(final int[] postitionWeight) {
-        this(postitionWeight, false, false);
+    public ModulusTenCheckDigit(final int[] positionWeight) {
+        this(positionWeight, false, false);
     }
 
     /**
      * Constructs a modulus 10 Check Digit routine with the specified weighting,
      * indicating whether its from the left or right.
      *
-     * @param postitionWeight the weighted values to apply based on the
+     * @param positionWeight the weighted values to apply based on the
      *            character position
      * @param useRightPos {@code true} if use positionWeights from right to
      *            left
      */
-    public ModulusTenCheckDigit(final int[] postitionWeight, final boolean useRightPos) {
-        this(postitionWeight, useRightPos, false);
+    public ModulusTenCheckDigit(final int[] positionWeight, final boolean useRightPos) {
+        this(positionWeight, useRightPos, false);
     }
 
     /**
@@ -159,15 +159,15 @@ public final class ModulusTenCheckDigit extends ModulusCheckDigit {
      * indicating whether its from the left or right and whether the weighted
      * digits should be summed.
      *
-     * @param postitionWeight the weighted values to apply based on the
+     * @param positionWeight the weighted values to apply based on the
      *            character position
      * @param useRightPos {@code true} if use positionWeights from right to
      *            left
      * @param sumWeightedDigits {@code true} if sum the digits of the
      *            weighted value
      */
-    public ModulusTenCheckDigit(final int[] postitionWeight, final boolean useRightPos, final boolean sumWeightedDigits) {
-        this.postitionWeight = Arrays.copyOf(postitionWeight, postitionWeight.length);
+    public ModulusTenCheckDigit(final int[] positionWeight, final boolean useRightPos, final boolean sumWeightedDigits) {
+        this.positionWeight = Arrays.copyOf(positionWeight, positionWeight.length);
         this.useRightPos = useRightPos;
         this.sumWeightedDigits = sumWeightedDigits;
     }
@@ -223,7 +223,7 @@ public final class ModulusTenCheckDigit extends ModulusCheckDigit {
      */
     @Override
     public String toString() {
-        return getClass().getSimpleName() + "[postitionWeight=" + Arrays.toString(postitionWeight) + ", useRightPos="
+        return getClass().getSimpleName() + "[positionWeight=" + Arrays.toString(positionWeight) + ", useRightPos="
                 + useRightPos + ", sumWeightedDigits=" + sumWeightedDigits + "]";
     }
 
@@ -241,7 +241,7 @@ public final class ModulusTenCheckDigit extends ModulusCheckDigit {
     @Override
     protected int weightedValue(final int charValue, final int leftPos, final int rightPos) {
         final int pos = useRightPos ? rightPos : leftPos;
-        final int weight = postitionWeight[(pos - 1) % postitionWeight.length];
+        final int weight = positionWeight[(pos - 1) % positionWeight.length];
         int weightedValue = charValue * weight;
         if (sumWeightedDigits) {
             weightedValue = sumDigits(weightedValue);
diff --git a/src/main/java/org/apache/commons/validator/routines/checkdigit/SedolCheckDigit.java b/src/main/java/org/apache/commons/validator/routines/checkdigit/SedolCheckDigit.java
index 3ebc69cc..f6bd36a5 100644
--- a/src/main/java/org/apache/commons/validator/routines/checkdigit/SedolCheckDigit.java
+++ b/src/main/java/org/apache/commons/validator/routines/checkdigit/SedolCheckDigit.java
@@ -78,7 +78,7 @@ public final class SedolCheckDigit extends ModulusCheckDigit {
      *
      * @param character The character to convert
      * @param leftPos The position of the character in the code, counting from left to right
-     * @param rightPos The positionof the character in the code, counting from right to left
+     * @param rightPos The position of the character in the code, counting from right to left
      * @return The integer value of the character
      * @throws CheckDigitException if character is not alphanumeric
      */
@@ -99,7 +99,7 @@ public final class SedolCheckDigit extends ModulusCheckDigit {
      *
      * @param charValue The numeric value of the character.
      * @param leftPos The position of the character in the code, counting from left to right
-     * @param rightPos The positionof the character in the code, counting from right to left
+     * @param rightPos The position of the character in the code, counting from right to left
      * @return The weighted value of the character.
      */
     @Override
diff --git a/src/main/java/org/apache/commons/validator/routines/package-info.java b/src/main/java/org/apache/commons/validator/routines/package-info.java
index 6b6dea47..c5d4ff11 100644
--- a/src/main/java/org/apache/commons/validator/routines/package-info.java
+++ b/src/main/java/org/apache/commons/validator/routines/package-info.java
@@ -402,11 +402,11 @@
  * <h2>4.2 Regular Expression Validation</h2>
  * <p>
  * Regular expression validation can be done either by using the <em>static</em>
- * methods provied by <a href="RegexValidator.html">RegexValidator</a> or
+ * methods provided by <a href="RegexValidator.html">RegexValidator</a> or
  * by creating a new instance, which caches and re-uses compiled Patterns.
  * </p>
  * <ul>
- * <li><strong>Method Flavours</strong> - three <em>flavors</em> of validation metods are provided:</li>
+ * <li><strong>Method Flavours</strong> - three <em>flavors</em> of validation methods are provided:</li>
  * <li>
  * <ul>
  * <li>{@code isValid()} methods return true/false to indicate
@@ -481,7 +481,7 @@
  * <ul>
  * <li>{@code isValid(<em>code</em>)} - validates the check digit of a code,
  * returning {@code true} or {@code false}.</li>
- * <li>{@code calculate(<em>code</em>)} - calulates the check digit for a code
+ * <li>{@code calculate(<em>code</em>)} - calculates the check digit for a code
  * returning the check digit character.</li>
  * </ul>
  * <p>
@@ -527,7 +527,7 @@
  * boolean valid = ISBNCheckDigit.ISBN.isValid(code);
  * </pre>
  * <p>
- * The following examples show calulating the check digit of a code:
+ * The following examples show calculating the check digit of a code:
  * </p>
  * <pre>
  * // Luhn check digit validation
diff --git a/src/main/resources/org/apache/commons/validator/resources/validator_1_0.dtd b/src/main/resources/org/apache/commons/validator/resources/validator_1_0.dtd
index b8057516..0d2654e3 100644
--- a/src/main/resources/org/apache/commons/validator/resources/validator_1_0.dtd
+++ b/src/main/resources/org/apache/commons/validator/resources/validator_1_0.dtd
@@ -93,7 +93,7 @@
 
 <!--
      The "form" element defines a set of fields to be validated. The name
-     corresponds to the identifer the application assigns to the form. 
+     corresponds to the identifier the application assigns to the form. 
 -->
 <!ELEMENT form    (field+ )>
 <!ATTLIST form    name         CDATA #REQUIRED>
@@ -138,7 +138,7 @@
 <!--
      The "msg" element defines a custom message key to use when one of the
      validators for this field fails. Each validator has a default message
-     property that is used when a corresonding field msg is not specified.
+     property that is used when a corresponding field msg is not specified.
      Each validator applied to a field may have its own msg element.
      The msg element accepts up to three attributes.
 
diff --git a/src/main/resources/org/apache/commons/validator/resources/validator_1_0_1.dtd b/src/main/resources/org/apache/commons/validator/resources/validator_1_0_1.dtd
index ea1b39e8..23e152a6 100644
--- a/src/main/resources/org/apache/commons/validator/resources/validator_1_0_1.dtd
+++ b/src/main/resources/org/apache/commons/validator/resources/validator_1_0_1.dtd
@@ -92,7 +92,7 @@
 
 <!--
      The "form" element defines a set of fields to be validated. The name
-     corresponds to the identifer the application assigns to the form. 
+     corresponds to the identifier the application assigns to the form. 
 -->
 <!ELEMENT form    (field+ )>
 <!ATTLIST form    name         CDATA #REQUIRED>
@@ -137,7 +137,7 @@
 <!--
      The "msg" element defines a custom message key to use when one of the
      validators for this field fails. Each validator has a default message
-     property that is used when a corresonding field msg is not specified.
+     property that is used when a corresponding field msg is not specified.
      Each validator applied to a field may have its own msg element.
      The msg element accepts up to three attributes.
 
diff --git a/src/main/resources/org/apache/commons/validator/resources/validator_1_1.dtd b/src/main/resources/org/apache/commons/validator/resources/validator_1_1.dtd
index b015b381..2911af26 100644
--- a/src/main/resources/org/apache/commons/validator/resources/validator_1_1.dtd
+++ b/src/main/resources/org/apache/commons/validator/resources/validator_1_1.dtd
@@ -91,7 +91,7 @@
 
 <!--
      The "form" element defines a set of fields to be validated. The name
-     corresponds to the identifer the application assigns to the form. 
+     corresponds to the identifier the application assigns to the form. 
 -->
 <!ELEMENT form (field+)>
 <!ATTLIST form name CDATA #REQUIRED>
@@ -136,7 +136,7 @@
 <!--
      The "msg" element defines a custom message key to use when one of the
      validators for this field fails. Each validator has a default message
-     property that is used when a corresonding field msg is not specified.
+     property that is used when a corresponding field msg is not specified.
      Each validator applied to a field may have its own msg element.
      The msg element accepts these attributes.
 
diff --git a/src/main/resources/org/apache/commons/validator/resources/validator_1_1_3.dtd b/src/main/resources/org/apache/commons/validator/resources/validator_1_1_3.dtd
index f7306d55..37399b78 100644
--- a/src/main/resources/org/apache/commons/validator/resources/validator_1_1_3.dtd
+++ b/src/main/resources/org/apache/commons/validator/resources/validator_1_1_3.dtd
@@ -48,7 +48,7 @@
      The "validator" element defines what validator objects can be used with
      the fields referenced by the formset elements.
      elements:
-       validator         Defines a new validatior
+       validator         Defines a new validator
        javascript        The javascript source code for client side validation.
      attributes:
          name            The name of this validation
diff --git a/src/main/resources/org/apache/commons/validator/resources/validator_1_2_0.dtd b/src/main/resources/org/apache/commons/validator/resources/validator_1_2_0.dtd
index a74bd4ad..1f5379d1 100644
--- a/src/main/resources/org/apache/commons/validator/resources/validator_1_2_0.dtd
+++ b/src/main/resources/org/apache/commons/validator/resources/validator_1_2_0.dtd
@@ -48,7 +48,7 @@
      Defines what validator objects can be used with
      the fields referenced by the formset elements.
      elements:
-       validator         Defines a new validatior
+       validator         Defines a new validator
        javascript        The javascript source code for client side validation.
      attributes:
          name            The name of this validation
@@ -201,7 +201,7 @@
              N.B. Since 1.2.0 position is ignored for 'default' arguments
                   (i.e. those with no 'name' supplied) - it is calculated
                   automatically from the order the arguments are added in.
-                  For 'overriden' arguments (i.e. those with a 'name')
+                  For 'overridden' arguments (i.e. those with a 'name')
                   it is optional. If 'position' is not supplied it will
                   use the position of the 'default' argument it follows.
 -->
diff --git a/src/main/resources/org/apache/commons/validator/resources/validator_1_3_0.dtd b/src/main/resources/org/apache/commons/validator/resources/validator_1_3_0.dtd
index 4fdac867..03369fd3 100644
--- a/src/main/resources/org/apache/commons/validator/resources/validator_1_3_0.dtd
+++ b/src/main/resources/org/apache/commons/validator/resources/validator_1_3_0.dtd
@@ -48,7 +48,7 @@
      Defines what validator objects can be used with
      the fields referenced by the formset elements.
      elements:
-       validator         Defines a new validatior
+       validator         Defines a new validator
        javascript        The javascript source code for client side validation.
      attributes:
          name            The name of this validation
@@ -201,7 +201,7 @@
              N.B. Since 1.2.0 position is ignored for 'default' arguments
                   (i.e. those with no 'name' supplied) - it is calculated
                   automatically from the order the arguments are added in.
-                  For 'overriden' arguments (i.e. those with a 'name')
+                  For 'overridden' arguments (i.e. those with a 'name')
                   it is optional. If 'position' is not supplied it will
                   use the position of the 'default' argument it follows.
 -->
diff --git a/src/main/resources/org/apache/commons/validator/resources/validator_1_4_0.dtd b/src/main/resources/org/apache/commons/validator/resources/validator_1_4_0.dtd
index 94855e2c..1fc7afe4 100644
--- a/src/main/resources/org/apache/commons/validator/resources/validator_1_4_0.dtd
+++ b/src/main/resources/org/apache/commons/validator/resources/validator_1_4_0.dtd
@@ -48,7 +48,7 @@
      Defines what validator objects can be used with
      the fields referenced by the formset elements.
      elements:
-       validator         Defines a new validatior
+       validator         Defines a new validator
        javascript        The javascript source code for client side validation.
      attributes:
          name            The name of this validation
@@ -205,7 +205,7 @@
              N.B. Since 1.2.0 position is ignored for 'default' arguments
                   (i.e. those with no 'name' supplied) - it is calculated
                   automatically from the order the arguments are added in.
-                  For 'overriden' arguments (i.e. those with a 'name')
+                  For 'overridden' arguments (i.e. those with a 'name')
                   it is optional. If 'position' is not supplied it will
                   use the position of the 'default' argument it follows.
 -->
diff --git a/src/site/xdoc/tasks.xml b/src/site/xdoc/tasks.xml
index c3737121..b3740320 100644
--- a/src/site/xdoc/tasks.xml
+++ b/src/site/xdoc/tasks.xml
@@ -48,7 +48,7 @@
             ValidatorException is only thrown to indicate configuration and programmer errors
             yet is a checked exception.  ValidatorException should be converted to a RuntimeException to match its
             real purpose.  Furthermore, the exception handling for pluggable validations (ValidatorActions)
-            is not well defined or documented.  RuntimeExceptions thrown from ValidatorActions should be propogated
+            is not well defined or documented.  RuntimeExceptions thrown from ValidatorActions should be propagated
             out of the Validator framework as is because they indicate programmer error.  Checked exceptions thrown
             from a ValidatorAction should stop validation and be propogated out of the framework for handling as these 
             indicate an unrecoverable system failure.  Validation method implementation becomes easier because they
diff --git a/src/site/xdoc/validator_2_0_0_proposal.dtd b/src/site/xdoc/validator_2_0_0_proposal.dtd
index 866e8126..aa71d986 100644
--- a/src/site/xdoc/validator_2_0_0_proposal.dtd
+++ b/src/site/xdoc/validator_2_0_0_proposal.dtd
@@ -79,7 +79,7 @@ applies to.
      Defines what validator objects can be used with
      the objects referenced by the bean-set elements.
      elements:
-       validator         Defines a new validatior
+       validator         Defines a new validator
        script            The scripting source code for client side validation.
      attributes:
          id              The unique name of this validation
diff --git a/src/test/java/org/apache/commons/validator/DateTest.java b/src/test/java/org/apache/commons/validator/DateTest.java
index 892f9d60..c7db41d4 100644
--- a/src/test/java/org/apache/commons/validator/DateTest.java
+++ b/src/test/java/org/apache/commons/validator/DateTest.java
@@ -73,7 +73,7 @@ public class DateTest extends AbstractCommonTest {
     }
 
     /**
-     * Utlity class to run a test on a value.
+     * Utility class to run a test on a value.
      *
      * @param info   Value to run test on.
      * @param passed Whether or not the test is expected to pass.
diff --git a/src/test/java/org/apache/commons/validator/EmailTest.java b/src/test/java/org/apache/commons/validator/EmailTest.java
index b50dd57d..39a78230 100644
--- a/src/test/java/org/apache/commons/validator/EmailTest.java
+++ b/src/test/java/org/apache/commons/validator/EmailTest.java
@@ -262,7 +262,7 @@ public class EmailTest extends AbstractCommonTest {
     }
 
     /**
-     * Tests the e-mail validation with an RCS-noncompliant character in the address.
+     * Tests the e-mail validation with an RCS-non-compliant character in the address.
      */
     @Test
     public void testEmailWithBogusCharacter() throws ValidatorException {
@@ -382,7 +382,7 @@ public class EmailTest extends AbstractCommonTest {
     }
 
     /**
-     * Utlity class to run a test on a value.
+     * Utility class to run a test on a value.
      *
      * @param info   Value to run test on.
      * @param passed Whether or not the test is expected to pass.
diff --git a/src/test/java/org/apache/commons/validator/ExtensionTest.java b/src/test/java/org/apache/commons/validator/ExtensionTest.java
index 6c33a770..9259d98a 100644
--- a/src/test/java/org/apache/commons/validator/ExtensionTest.java
+++ b/src/test/java/org/apache/commons/validator/ExtensionTest.java
@@ -30,7 +30,7 @@ import org.junit.jupiter.api.Test;
 /**
  * <p>
  * Performs tests for extension in form definitions. Performs the same tests RequiredNameTest does but with an equivalent validation definition with extension
- * definitions (validator-extension.xml), plus an extra check on overriding rules and another one checking it mantains correct order when extending.
+ * definitions (validator-extension.xml), plus an extra check on overriding rules and another one checking it maintains correct order when extending.
  * </p>
  */
 public class ExtensionTest {
@@ -76,7 +76,7 @@ public class ExtensionTest {
     }
 
     /**
-     * Tests if the order is mantained when extending a form. Parent form fields should preceed self form fields, except if we override the rules.
+     * Tests if the order is maintained when extending a form. Parent form fields should preceed self form fields, except if we override the rules.
      */
     @Test
     public void testOrder() {
diff --git a/src/test/java/org/apache/commons/validator/FieldTest.java b/src/test/java/org/apache/commons/validator/FieldTest.java
index 68c0136e..b26bcf4b 100644
--- a/src/test/java/org/apache/commons/validator/FieldTest.java
+++ b/src/test/java/org/apache/commons/validator/FieldTest.java
@@ -164,7 +164,7 @@ public class FieldTest {
     }
 
     /**
-     * test Field with a 'default' argument overriden without positions specified.
+     * test Field with a 'default' argument overridden without positions specified.
      */
     @Test
     public void testOverridePositionImplied() {
@@ -194,7 +194,7 @@ public class FieldTest {
     }
 
     /**
-     * test Field with a 'default' argument overriden with some positions specified
+     * test Field with a 'default' argument overridden with some positions specified
      */
     @Test
     public void testOverrideSomePosition() {
@@ -229,7 +229,7 @@ public class FieldTest {
     }
 
     /**
-     * test Field with a 'default' argument overriden using 'position' property
+     * test Field with a 'default' argument overridden using 'position' property
      */
     @Test
     public void testOverrideUsingPositionA() {
@@ -253,7 +253,7 @@ public class FieldTest {
     }
 
     /**
-     * test Field with a 'default' argument overriden using 'position' property
+     * test Field with a 'default' argument overridden using 'position' property
      */
     @Test
     public void testOverrideUsingPositionB() {
diff --git a/src/test/java/org/apache/commons/validator/LocaleTest.java b/src/test/java/org/apache/commons/validator/LocaleTest.java
index 11ef9863..be58d860 100644
--- a/src/test/java/org/apache/commons/validator/LocaleTest.java
+++ b/src/test/java/org/apache/commons/validator/LocaleTest.java
@@ -134,7 +134,7 @@ public class LocaleTest extends AbstractCommonTest {
     }
 
     /**
-     * Utlity class to run a test on a value.
+     * Utility class to run a test on a value.
      *
      * @param name       param
      * @param loc        param
diff --git a/src/test/java/org/apache/commons/validator/MultipleTest.java b/src/test/java/org/apache/commons/validator/MultipleTest.java
index 96c2e8f7..dde5f237 100644
--- a/src/test/java/org/apache/commons/validator/MultipleTest.java
+++ b/src/test/java/org/apache/commons/validator/MultipleTest.java
@@ -199,7 +199,7 @@ public class MultipleTest extends AbstractCommonTest {
     }
 
     /**
-     * If middle name is there and a positve int, then the required and int dependent tests should pass, and the positive test should pass.
+     * If middle name is there and a positive int, then the required and int dependent tests should pass, and the positive test should pass.
      *
      * @throws ValidatorException
      */
diff --git a/src/test/java/org/apache/commons/validator/RetrieveFormTest.java b/src/test/java/org/apache/commons/validator/RetrieveFormTest.java
index 0d7c19c1..dbc91104 100644
--- a/src/test/java/org/apache/commons/validator/RetrieveFormTest.java
+++ b/src/test/java/org/apache/commons/validator/RetrieveFormTest.java
@@ -99,13 +99,13 @@ public class RetrieveFormTest {
         // *** France locale ***
         checkForm(Locale.FRANCE, formKey, "default");
 
-        // *** Candian (English) locale ***
+        // *** Canadian (English) locale ***
         checkForm(Locale.CANADA, formKey, "default");
 
-        // *** Candian French locale ***
+        // *** Canadian French locale ***
         checkForm(Locale.CANADA_FRENCH, formKey, "default");
 
-        // *** Candian French Variant locale ***
+        // *** Canadian French Variant locale ***
         checkForm(CANADA_FRENCH_XXX, formKey, "default");
 
     }
@@ -127,13 +127,13 @@ public class RetrieveFormTest {
         // *** France locale ***
         checkFormNotFound(Locale.FRANCE, formKey);
 
-        // *** Candian (English) locale ***
+        // *** Canadian (English) locale ***
         checkFormNotFound(Locale.CANADA, formKey);
 
-        // *** Candian French locale ***
+        // *** Canadian French locale ***
         checkFormNotFound(Locale.CANADA_FRENCH, formKey);
 
-        // *** Candian French Variant locale ***
+        // *** Canadian French Variant locale ***
         checkFormNotFound(CANADA_FRENCH_XXX, formKey);
 
     }
@@ -155,13 +155,13 @@ public class RetrieveFormTest {
         // *** France locale ***
         checkForm(Locale.FRANCE, formKey, "fr_FR");
 
-        // *** Candian (English) locale ***
+        // *** Canadian (English) locale ***
         checkForm(Locale.CANADA, formKey, "default");
 
-        // *** Candian French locale ***
+        // *** Canadian French locale ***
         checkForm(Locale.CANADA_FRENCH, formKey, "fr_CA");
 
-        // *** Candian French Variant locale ***
+        // *** Canadian French Variant locale ***
         checkForm(CANADA_FRENCH_XXX, formKey, "fr_CA");
 
     }
@@ -183,13 +183,13 @@ public class RetrieveFormTest {
         // *** France locale ***
         checkForm(Locale.FRANCE, formKey, "fr_FR");
 
-        // *** Candian (English) locale ***
+        // *** Canadian (English) locale ***
         checkForm(Locale.CANADA, formKey, "default");
 
-        // *** Candian French locale ***
+        // *** Canadian French locale ***
         checkForm(Locale.CANADA_FRENCH, formKey, "fr_CA");
 
-        // *** Candian French Variant locale ***
+        // *** Canadian French Variant locale ***
         checkForm(CANADA_FRENCH_XXX, formKey, "fr_CA_XXX");
 
     }
@@ -211,13 +211,13 @@ public class RetrieveFormTest {
         // *** France locale ***
         checkForm(Locale.FRANCE, formKey, "fr");
 
-        // *** Candian (English) locale ***
+        // *** Canadian (English) locale ***
         checkForm(Locale.CANADA, formKey, "default");
 
-        // *** Candian French locale ***
+        // *** Canadian French locale ***
         checkForm(Locale.CANADA_FRENCH, formKey, "fr");
 
-        // *** Candian French Variant locale ***
+        // *** Canadian French Variant locale ***
         checkForm(CANADA_FRENCH_XXX, formKey, "fr");
 
     }
diff --git a/src/test/java/org/apache/commons/validator/routines/IBANValidatorTest.java b/src/test/java/org/apache/commons/validator/routines/IBANValidatorTest.java
index 79124cba..c73d80f3 100644
--- a/src/test/java/org/apache/commons/validator/routines/IBANValidatorTest.java
+++ b/src/test/java/org/apache/commons/validator/routines/IBANValidatorTest.java
@@ -326,7 +326,7 @@ public class IBANValidatorTest {
     }
 
     @Test
-    public void testGetRegexValidatortPatterns() {
+    public void testGetRegexValidatorPatterns() {
         assertNotNull(VALIDATOR.getValidator("GB").getRegexValidator().getPatterns(), "GB");
     }
 
diff --git a/src/test/java/org/apache/commons/validator/routines/PercentValidatorTest.java b/src/test/java/org/apache/commons/validator/routines/PercentValidatorTest.java
index 75248811..dea752f5 100644
--- a/src/test/java/org/apache/commons/validator/routines/PercentValidatorTest.java
+++ b/src/test/java/org/apache/commons/validator/routines/PercentValidatorTest.java
@@ -93,7 +93,7 @@ public class PercentValidatorTest {
         final BigDecimal hundred = new BigDecimal("1.00");
 
         assertEquals(expected, validator.validate("12%"), "Default locale");
-        assertEquals(negative, validator.validate("-12%"), "Default negtve");
+        assertEquals(negative, validator.validate("-12%"), "Default negative");
 
         // Invalid UK
         assertEquals(expected, validator.validate("12%", Locale.UK), "UK locale");
diff --git a/src/test/java/org/apache/commons/validator/routines/TimeValidatorTest.java b/src/test/java/org/apache/commons/validator/routines/TimeValidatorTest.java
index 6360f542..72747901 100644
--- a/src/test/java/org/apache/commons/validator/routines/TimeValidatorTest.java
+++ b/src/test/java/org/apache/commons/validator/routines/TimeValidatorTest.java
@@ -151,9 +151,9 @@ public class TimeValidatorTest {
         final Calendar hourGreater = createTime(GMT, testTime + hour, 100); // +1 hour
         final Calendar hourLess = createTime(GMT, testTime - hour, 100); // -1 hour
 
-        assertEquals(-1, validator.compareTime(value, milliGreater), "mili LT"); // > milli
-        assertEquals(0, validator.compareTime(value, value), "mili EQ"); // same time
-        assertEquals(1, validator.compareTime(value, milliLess), "mili GT"); // < milli
+        assertEquals(-1, validator.compareTime(value, milliGreater), "milli LT"); // > milli
+        assertEquals(0, validator.compareTime(value, value), "milli EQ"); // same time
+        assertEquals(1, validator.compareTime(value, milliLess), "milli GT"); // < milli
 
         assertEquals(-1, validator.compareSeconds(value, secGreater), "secs LT"); // +1 sec
         assertEquals(0, validator.compareSeconds(value, milliGreater), "secs =1"); // > milli
diff --git a/src/test/java/org/apache/commons/validator/routines/checkdigit/AbstractCheckDigitTest.java b/src/test/java/org/apache/commons/validator/routines/checkdigit/AbstractCheckDigitTest.java
index 41ccf114..ae7fcf19 100644
--- a/src/test/java/org/apache/commons/validator/routines/checkdigit/AbstractCheckDigitTest.java
+++ b/src/test/java/org/apache/commons/validator/routines/checkdigit/AbstractCheckDigitTest.java
@@ -67,7 +67,7 @@ public abstract class AbstractCheckDigitTest {
      * These are currently passed to both CheckDigit.calculate(expects a string without checkdigit) which is expected to throw an exception However that only
      * applies if the string is syntactically incorrect; and CheckDigit.isValid(expects a string including checkdigit) which is expected to return false
      *
-     * See https://issues.apache.org/jira/browse/VALIDATOR-344 for some dicussion on this
+     * See https://issues.apache.org/jira/browse/VALIDATOR-344 for some discussion on this
      */
     protected String[] invalid = { "12345678A" };
 
diff --git a/src/test/resources/org/apache/commons/validator/RetrieveFormTest-config.xml b/src/test/resources/org/apache/commons/validator/RetrieveFormTest-config.xml
index ff931e52..36c73a83 100644
--- a/src/test/resources/org/apache/commons/validator/RetrieveFormTest-config.xml
+++ b/src/test/resources/org/apache/commons/validator/RetrieveFormTest-config.xml
@@ -141,7 +141,7 @@
       </form>
    </formset>
 
-   <!-- Candaian French Variant formset -->
+   <!-- Canadian French Variant formset -->
    <formset language="fr" country="CA" variant="XXX">
 
       <form name="testForm_language_country_variant">


Re: (commons-validator) 11/11: Fixed Javadoc errors

Posted by Emmanuel Bourg <eb...@apache.org>.
Le 18/11/2024 à 17:38, Gary Gregory a écrit :
> Please revert "{@link java.lang.String}". The java.lang package is
> automatically in scope, just like in Java sources.
> 
> I don't use Java 8 to build because it's EOL and doesn't generate the
> search box. FWIW, all release sites I've built recently were done with Java
> 17.

"{@link String}" triggers a warning in my IDE.

If the warning goes away with Java 17 then we'll remove it when the 
minimum JDK requirement for Commons Validator is upgraded.

Emmanuel Bourg


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: (commons-validator) 11/11: Fixed Javadoc errors

Posted by Gary Gregory <ga...@gmail.com>.
Please revert "{@link java.lang.String}". The java.lang package is
automatically in scope, just like in Java sources.

I don't use Java 8 to build because it's EOL and doesn't generate the
search box. FWIW, all release sites I've built recently were done with Java
17.

Gary

On Mon, Nov 18, 2024, 7:53 AM <eb...@apache.org> wrote:

> This is an automated email from the ASF dual-hosted git repository.
>
> ebourg pushed a commit to branch master
> in repository https://gitbox.apache.org/repos/asf/commons-validator.git
>
> commit cdc0125b8d7c9af0dcc557de853c2ff2a0a436ee
> Author: Emmanuel Bourg <eb...@apache.org>
> AuthorDate: Mon Nov 18 13:32:14 2024 +0100
>
>     Fixed Javadoc errors
> ---
>  src/main/java/org/apache/commons/validator/ValidatorAction.java       | 2
> +-
>  src/main/java/org/apache/commons/validator/routines/package-info.java | 4
> ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git
> a/src/main/java/org/apache/commons/validator/ValidatorAction.java
> b/src/main/java/org/apache/commons/validator/ValidatorAction.java
> index 315499fd..d08edb8b 100644
> --- a/src/main/java/org/apache/commons/validator/ValidatorAction.java
> +++ b/src/main/java/org/apache/commons/validator/ValidatorAction.java
> @@ -555,7 +555,7 @@ public class ValidatorAction implements Serializable {
>       * The search order is described in the documentation for {@link
> ClassLoader#getResource(String)}.
>       * </p>
>       *
> -     * @param name The resource name
> +     * @param javaScriptFileName The resource name
>       * @return An input stream for reading the resource, or {@code null}
> if the resource could not be found
>       */
>      private InputStream openInputStream(final String javaScriptFileName,
> final ClassLoader classLoader) {
> diff --git
> a/src/main/java/org/apache/commons/validator/routines/package-info.java
> b/src/main/java/org/apache/commons/validator/routines/package-info.java
> index c5d4ff11..a0d8239c 100644
> --- a/src/main/java/org/apache/commons/validator/routines/package-info.java
> +++ b/src/main/java/org/apache/commons/validator/routines/package-info.java
> @@ -411,10 +411,10 @@
>   * <ul>
>   * <li>{@code isValid()} methods return true/false to indicate
>   * whether validation was successful.</li>
> - * <li>{@code validate()} methods return a {@link String}
> + * <li>{@code validate()} methods return a {@link java.lang.String}
>   * value of the matched <em>groups</em> aggregated together or
>   * {@code null} if invalid.</li>
> - * <li>{@code match()} methods return a {@link String} array
> + * <li>{@code match()} methods return a {@link java.lang.String} array
>   * of the matched <em>groups</em> or {@code null} if invalid.</li>
>   * </ul>
>   * </li>
>
>

(commons-validator) 11/11: Fixed Javadoc errors

Posted by eb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ebourg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-validator.git

commit cdc0125b8d7c9af0dcc557de853c2ff2a0a436ee
Author: Emmanuel Bourg <eb...@apache.org>
AuthorDate: Mon Nov 18 13:32:14 2024 +0100

    Fixed Javadoc errors
---
 src/main/java/org/apache/commons/validator/ValidatorAction.java       | 2 +-
 src/main/java/org/apache/commons/validator/routines/package-info.java | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/apache/commons/validator/ValidatorAction.java b/src/main/java/org/apache/commons/validator/ValidatorAction.java
index 315499fd..d08edb8b 100644
--- a/src/main/java/org/apache/commons/validator/ValidatorAction.java
+++ b/src/main/java/org/apache/commons/validator/ValidatorAction.java
@@ -555,7 +555,7 @@ public class ValidatorAction implements Serializable {
      * The search order is described in the documentation for {@link ClassLoader#getResource(String)}.
      * </p>
      *
-     * @param name The resource name
+     * @param javaScriptFileName The resource name
      * @return An input stream for reading the resource, or {@code null} if the resource could not be found
      */
     private InputStream openInputStream(final String javaScriptFileName, final ClassLoader classLoader) {
diff --git a/src/main/java/org/apache/commons/validator/routines/package-info.java b/src/main/java/org/apache/commons/validator/routines/package-info.java
index c5d4ff11..a0d8239c 100644
--- a/src/main/java/org/apache/commons/validator/routines/package-info.java
+++ b/src/main/java/org/apache/commons/validator/routines/package-info.java
@@ -411,10 +411,10 @@
  * <ul>
  * <li>{@code isValid()} methods return true/false to indicate
  * whether validation was successful.</li>
- * <li>{@code validate()} methods return a {@link String}
+ * <li>{@code validate()} methods return a {@link java.lang.String}
  * value of the matched <em>groups</em> aggregated together or
  * {@code null} if invalid.</li>
- * <li>{@code match()} methods return a {@link String} array
+ * <li>{@code match()} methods return a {@link java.lang.String} array
  * of the matched <em>groups</em> or {@code null} if invalid.</li>
  * </ul>
  * </li>


(commons-validator) 07/11: Simplify the test assertions

Posted by eb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ebourg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-validator.git

commit 7eee2066ec329de7d6bd9fd1bc4e70b894190cc7
Author: Emmanuel Bourg <eb...@apache.org>
AuthorDate: Mon Nov 18 11:08:57 2024 +0100

    Simplify the test assertions
    
    - assertTrue(!expression) -> assertFalse(expression)
    - assertTrue(a.equals(b) -> assertEquals(a, b)
    - assertTrue(!a.equals(b) -> assertNotEquals(a, b)
    - assertTrue(a == b) -> assertSame(a, b)
    - assertTrue(a != b) -> assertNotSame(a, b)
    - assertTrue(a instanceof T) -> assertInstanceOf(T.class, a)
---
 .../apache/commons/validator/ExceptionTest.java    |  6 ++---
 .../apache/commons/validator/ExtensionTest.java    | 27 +++++++++++----------
 .../validator/GenericTypeValidatorTest.java        | 28 +++++++++++-----------
 .../commons/validator/MultipleConfigFilesTest.java | 13 +++++-----
 .../org/apache/commons/validator/MultipleTest.java | 25 +++++++++----------
 .../apache/commons/validator/RequiredIfTest.java   |  5 ++--
 .../apache/commons/validator/RequiredNameTest.java | 17 ++++++-------
 .../apache/commons/validator/ValidatorTest.java    |  2 +-
 .../validator/routines/CalendarValidatorTest.java  | 26 ++++++++++----------
 .../validator/routines/DateValidatorTest.java      |  3 ++-
 .../apache/commons/validator/util/FlagsTest.java   |  4 ++--
 11 files changed, 82 insertions(+), 74 deletions(-)

diff --git a/src/test/java/org/apache/commons/validator/ExceptionTest.java b/src/test/java/org/apache/commons/validator/ExceptionTest.java
index a7e8af04..e66789c2 100644
--- a/src/test/java/org/apache/commons/validator/ExceptionTest.java
+++ b/src/test/java/org/apache/commons/validator/ExceptionTest.java
@@ -16,7 +16,7 @@
  */
 package org.apache.commons.validator;
 
-import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.fail;
 
 import java.io.IOException;
@@ -76,7 +76,7 @@ public class ExceptionTest extends AbstractCommonTest {
         } catch (final ValidatorException expected) {
             fail("Checked exceptions are not wrapped in ValidatorException in Validator 1.x.");
         } catch (final Exception e) {
-            assertTrue("CHECKED-EXCEPTION".equals(e.getMessage()));
+            assertEquals("CHECKED-EXCEPTION", e.getMessage());
         }
 
         // This will be true in Validator 2.0
@@ -139,7 +139,7 @@ public class ExceptionTest extends AbstractCommonTest {
             validator.validate();
             fail("ValidatorException should occur here!");
         } catch (final ValidatorException expected) {
-            assertTrue("VALIDATOR-EXCEPTION".equals(expected.getMessage()));
+            assertEquals("VALIDATOR-EXCEPTION", expected.getMessage());
         }
     }
 }
diff --git a/src/test/java/org/apache/commons/validator/ExtensionTest.java b/src/test/java/org/apache/commons/validator/ExtensionTest.java
index 9259d98a..097592ef 100644
--- a/src/test/java/org/apache/commons/validator/ExtensionTest.java
+++ b/src/test/java/org/apache/commons/validator/ExtensionTest.java
@@ -17,6 +17,7 @@
 package org.apache.commons.validator;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
 import static org.junit.jupiter.api.Assertions.assertNull;
 import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -94,15 +95,15 @@ public class ExtensionTest {
         Field fieldFirstName = form.getFields().get(0);
         // get the second field
         Field fieldLastName = form.getFields().get(1);
-        assertTrue(fieldFirstName.getKey().equals("firstName"), "firstName in " + FORM_KEY + " should be the first in the list");
-        assertTrue(fieldLastName.getKey().equals("lastName"), "lastName in " + FORM_KEY + " should be the first in the list");
+        assertEquals("firstName", fieldFirstName.getKey(), "firstName in " + FORM_KEY + " should be the first in the list");
+        assertEquals("lastName", fieldLastName.getKey(), "lastName in " + FORM_KEY + " should be the first in the list");
 
 //     get the second field
         fieldLastName = form2.getFields().get(0);
         // get the first field
         fieldFirstName = form2.getFields().get(1);
-        assertTrue(fieldFirstName.getKey().equals("firstName"), "firstName in " + FORM_KEY2 + " should be the first in the list");
-        assertTrue(fieldLastName.getKey().equals("lastName"), "lastName in " + FORM_KEY2 + " should be the first in the list");
+        assertEquals("firstName", fieldFirstName.getKey(), "firstName in " + FORM_KEY2 + " should be the first in the list");
+        assertEquals("lastName", fieldLastName.getKey(), "lastName in " + FORM_KEY2 + " should be the first in the list");
 
     }
 
@@ -131,7 +132,7 @@ public class ExtensionTest {
         final ValidatorResult firstNameResult = results.getValidatorResult("firstName");
         final ValidatorResult lastNameResult = results.getValidatorResult("lastName");
         assertNotNull(firstNameResult, "First Name ValidatorResult should not be null.");
-        assertTrue(firstNameResult.field.getArg(0).getKey().equals(CHECK_MSG_KEY),
+        assertEquals(CHECK_MSG_KEY, firstNameResult.field.getArg(0).getKey(),
                 "First Name ValidatorResult for the '" + ACTION + "' action should have '" + CHECK_MSG_KEY + " as a key.");
 
         assertNull(lastNameResult, "Last Name ValidatorResult should be null.");
@@ -166,11 +167,11 @@ public class ExtensionTest {
 
         assertNotNull(firstNameResult, "First Name ValidatorResult should not be null.");
         assertTrue(firstNameResult.containsAction(ACTION), "First Name ValidatorResult should contain the '" + ACTION + "' action.");
-        assertTrue(!firstNameResult.isValid(ACTION), "First Name ValidatorResult for the '" + ACTION + "' action should have failed.");
+        assertFalse(firstNameResult.isValid(ACTION), "First Name ValidatorResult for the '" + ACTION + "' action should have failed.");
 
         assertNotNull(lastNameResult, "First Name ValidatorResult should not be null.");
         assertTrue(lastNameResult.containsAction(ACTION), "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
-        assertTrue(!lastNameResult.isValid(ACTION), "Last Name ValidatorResult for the '" + ACTION + "' action should have failed.");
+        assertFalse(lastNameResult.isValid(ACTION), "Last Name ValidatorResult for the '" + ACTION + "' action should have failed.");
     }
 
     /**
@@ -203,7 +204,7 @@ public class ExtensionTest {
 
         assertNotNull(lastNameResult, "First Name ValidatorResult should not be null.");
         assertTrue(lastNameResult.containsAction(ACTION), "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
-        assertTrue(!lastNameResult.isValid(ACTION), "Last Name ValidatorResult for the '" + ACTION + "' action should have failed.");
+        assertFalse(lastNameResult.isValid(ACTION), "Last Name ValidatorResult for the '" + ACTION + "' action should have failed.");
     }
 
     /**
@@ -232,11 +233,11 @@ public class ExtensionTest {
 
         assertNotNull(firstNameResult, "First Name ValidatorResult should not be null.");
         assertTrue(firstNameResult.containsAction(ACTION), "First Name ValidatorResult should contain the '" + ACTION + "' action.");
-        assertTrue(!firstNameResult.isValid(ACTION), "First Name ValidatorResult for the '" + ACTION + "' action should have failed.");
+        assertFalse(firstNameResult.isValid(ACTION), "First Name ValidatorResult for the '" + ACTION + "' action should have failed.");
 
         assertNotNull(lastNameResult, "First Name ValidatorResult should not be null.");
         assertTrue(lastNameResult.containsAction(ACTION), "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
-        assertTrue(!lastNameResult.isValid(ACTION), "Last Name ValidatorResult for the '" + ACTION + "' action should have failed.");
+        assertFalse(lastNameResult.isValid(ACTION), "Last Name ValidatorResult for the '" + ACTION + "' action should have failed.");
     }
 
     /**
@@ -265,7 +266,7 @@ public class ExtensionTest {
 
         assertNotNull(firstNameResult, "First Name ValidatorResult should not be null.");
         assertTrue(firstNameResult.containsAction(ACTION), "First Name ValidatorResult should contain the '" + ACTION + "' action.");
-        assertTrue(!firstNameResult.isValid(ACTION), "First Name ValidatorResult for the '" + ACTION + "' action should have failed.");
+        assertFalse(firstNameResult.isValid(ACTION), "First Name ValidatorResult for the '" + ACTION + "' action should have failed.");
 
         assertNotNull(lastNameResult, "First Name ValidatorResult should not be null.");
         assertTrue(lastNameResult.containsAction(ACTION), "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
@@ -299,11 +300,11 @@ public class ExtensionTest {
 
         assertNotNull(firstNameResult, "First Name ValidatorResult should not be null.");
         assertTrue(firstNameResult.containsAction(ACTION), "First Name ValidatorResult should contain the '" + ACTION + "' action.");
-        assertTrue(!firstNameResult.isValid(ACTION), "First Name ValidatorResult for the '" + ACTION + "' action should have failed.");
+        assertFalse(firstNameResult.isValid(ACTION), "First Name ValidatorResult for the '" + ACTION + "' action should have failed.");
 
         assertNotNull(lastNameResult, "First Name ValidatorResult should not be null.");
         assertTrue(lastNameResult.containsAction(ACTION), "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
-        assertTrue(!lastNameResult.isValid(ACTION), "Last Name ValidatorResult for the '" + ACTION + "' action should have failed.");
+        assertFalse(lastNameResult.isValid(ACTION), "Last Name ValidatorResult for the '" + ACTION + "' action should have failed.");
     }
 
     /**
diff --git a/src/test/java/org/apache/commons/validator/GenericTypeValidatorTest.java b/src/test/java/org/apache/commons/validator/GenericTypeValidatorTest.java
index be9990fa..104bfb4f 100644
--- a/src/test/java/org/apache/commons/validator/GenericTypeValidatorTest.java
+++ b/src/test/java/org/apache/commons/validator/GenericTypeValidatorTest.java
@@ -17,8 +17,8 @@
 package org.apache.commons.validator;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertInstanceOf;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
-import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.io.IOException;
 import java.util.Date;
@@ -69,13 +69,13 @@ public class GenericTypeValidatorTest extends AbstractCommonTest {
 
         final Map<String, ?> hResultValues = results.getResultValueMap();
 
-        assertTrue(hResultValues.get("byte") instanceof Byte, () -> "Expecting byte result to be an instance of Byte for locale: " + locale);
-        assertTrue(hResultValues.get("short") instanceof Short, () -> "Expecting short result to be an instance of Short for locale: " + locale);
-        assertTrue(hResultValues.get("integer") instanceof Integer, () -> "Expecting integer result to be an instance of Integer for locale: " + locale);
-        assertTrue(hResultValues.get("long") instanceof Long, () -> "Expecting long result to be an instance of Long for locale: " + locale);
-        assertTrue(hResultValues.get("float") instanceof Float, () -> "Expecting float result to be an instance of Float for locale: " + locale);
-        assertTrue(hResultValues.get("double") instanceof Double, () -> "Expecting double result to be an instance of Double for locale: " + locale);
-        assertTrue(hResultValues.get("date") instanceof Date, () -> "Expecting date result to be an instance of Date for locale: " + locale);
+        assertInstanceOf(Byte.class, hResultValues.get("byte"), () -> "Expecting byte result to be an instance of Byte for locale: " + locale);
+        assertInstanceOf(Short.class, hResultValues.get("short"), () -> "Expecting short result to be an instance of Short for locale: " + locale);
+        assertInstanceOf(Integer.class, hResultValues.get("integer"), () -> "Expecting integer result to be an instance of Integer for locale: " + locale);
+        assertInstanceOf(Long.class, hResultValues.get("long"), () -> "Expecting long result to be an instance of Long for locale: " + locale);
+        assertInstanceOf(Float.class, hResultValues.get("float"), () -> "Expecting float result to be an instance of Float for locale: " + locale);
+        assertInstanceOf(Double.class, hResultValues.get("double"), () -> "Expecting double result to be an instance of Double for locale: " + locale);
+        assertInstanceOf(Date.class, hResultValues.get("date"), () -> "Expecting date result to be an instance of Date for locale: " + locale);
 
         for (final String key : hResultValues.keySet()) {
             final Object value = hResultValues.get(key);
@@ -149,12 +149,12 @@ public class GenericTypeValidatorTest extends AbstractCommonTest {
 
         final Map<String, ?> hResultValues = results.getResultValueMap();
 
-        assertTrue(hResultValues.get("byte") instanceof Byte, "Expecting byte result to be an instance of Byte.");
-        assertTrue(hResultValues.get("short") instanceof Short, "Expecting short result to be an instance of Short.");
-        assertTrue(hResultValues.get("integer") instanceof Integer, "Expecting integer result to be an instance of Integer.");
-        assertTrue(hResultValues.get("long") instanceof Long, "Expecting long result to be an instance of Long.");
-        assertTrue(hResultValues.get("float") instanceof Float, "Expecting float result to be an instance of Float.");
-        assertTrue(hResultValues.get("double") instanceof Double, "Expecting double result to be an instance of Double.");
+        assertInstanceOf(Byte.class, hResultValues.get("byte"), "Expecting byte result to be an instance of Byte.");
+        assertInstanceOf(Short.class, hResultValues.get("short"), "Expecting short result to be an instance of Short.");
+        assertInstanceOf(Integer.class, hResultValues.get("integer"), "Expecting integer result to be an instance of Integer.");
+        assertInstanceOf(Long.class, hResultValues.get("long"), "Expecting long result to be an instance of Long.");
+        assertInstanceOf(Float.class, hResultValues.get("float"), "Expecting float result to be an instance of Float.");
+        assertInstanceOf(Double.class, hResultValues.get("double"), "Expecting double result to be an instance of Double.");
 
         for (final String key : hResultValues.keySet()) {
             final Object value = hResultValues.get(key);
diff --git a/src/test/java/org/apache/commons/validator/MultipleConfigFilesTest.java b/src/test/java/org/apache/commons/validator/MultipleConfigFilesTest.java
index 47217fb5..e14ce6d3 100644
--- a/src/test/java/org/apache/commons/validator/MultipleConfigFilesTest.java
+++ b/src/test/java/org/apache/commons/validator/MultipleConfigFilesTest.java
@@ -17,6 +17,7 @@
 package org.apache.commons.validator;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
@@ -91,12 +92,12 @@ public class MultipleConfigFilesTest {
 
         assertNotNull(firstNameResult);
         assertTrue(firstNameResult.containsAction(ACTION));
-        assertTrue(!firstNameResult.isValid(ACTION));
+        assertFalse(firstNameResult.isValid(ACTION));
 
         assertNotNull(lastNameResult);
         assertTrue(lastNameResult.containsAction(ACTION));
-        assertTrue(!lastNameResult.isValid(ACTION));
-        assertTrue(!lastNameResult.containsAction("int"));
+        assertFalse(lastNameResult.isValid(ACTION));
+        assertFalse(lastNameResult.containsAction("int"));
     }
 
     /**
@@ -173,11 +174,11 @@ public class MultipleConfigFilesTest {
 
         assertNotNull(firstNameResult);
         assertTrue(firstNameResult.containsAction(ACTION));
-        assertTrue(!firstNameResult.isValid(ACTION));
+        assertFalse(firstNameResult.isValid(ACTION));
 
         assertNotNull(lastNameResult);
         assertTrue(lastNameResult.containsAction("int"));
-        assertTrue(!lastNameResult.isValid("int"));
+        assertFalse(lastNameResult.isValid("int"));
     }
 
     /**
@@ -245,7 +246,7 @@ public class MultipleConfigFilesTest {
 
         assertNotNull(lastNameResult);
         assertTrue(lastNameResult.containsAction("int"));
-        assertTrue(!lastNameResult.isValid("int"));
+        assertFalse(lastNameResult.isValid("int"));
     }
 
 }
diff --git a/src/test/java/org/apache/commons/validator/MultipleTest.java b/src/test/java/org/apache/commons/validator/MultipleTest.java
index dde5f237..5e9cfa04 100644
--- a/src/test/java/org/apache/commons/validator/MultipleTest.java
+++ b/src/test/java/org/apache/commons/validator/MultipleTest.java
@@ -16,6 +16,7 @@
  */
 package org.apache.commons.validator;
 
+import static org.junit.jupiter.api.Assertions.assertFalse;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
@@ -83,12 +84,12 @@ public class MultipleTest extends AbstractCommonTest {
 
         assertNotNull(firstNameResult, "First Name ValidatorResult should not be null.");
         assertTrue(firstNameResult.containsAction(ACTION), () -> "First Name ValidatorResult should contain the '" + ACTION + "' action.");
-        assertTrue(!firstNameResult.isValid(ACTION), () -> "First Name ValidatorResult for the '" + ACTION + "' action should have failed.");
+        assertFalse(firstNameResult.isValid(ACTION), () -> "First Name ValidatorResult for the '" + ACTION + "' action should have failed.");
 
         assertNotNull(lastNameResult, "Last Name ValidatorResult should not be null.");
         assertTrue(lastNameResult.containsAction(ACTION), () -> "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
-        assertTrue(!lastNameResult.isValid(ACTION), () -> "Last Name ValidatorResult for the '" + ACTION + "' action should have failed.");
-        assertTrue(!lastNameResult.containsAction("int"), "Last Name ValidatorResults should not contain the 'int' action.");
+        assertFalse(lastNameResult.isValid(ACTION), () -> "Last Name ValidatorResult for the '" + ACTION + "' action should have failed.");
+        assertFalse(lastNameResult.containsAction("int"), "Last Name ValidatorResults should not contain the 'int' action.");
     }
 
     /**
@@ -118,11 +119,11 @@ public class MultipleTest extends AbstractCommonTest {
         assertNotNull(middleNameResult, "Middle Name ValidatorResult should not be null.");
 
         assertTrue(middleNameResult.containsAction("required"), "Middle Name ValidatorResult should contain the 'required' action.");
-        assertTrue(!middleNameResult.isValid("required"), "Middle Name ValidatorResult for the 'required' action should have failed");
+        assertFalse(middleNameResult.isValid("required"), "Middle Name ValidatorResult for the 'required' action should have failed");
 
-        assertTrue(!middleNameResult.containsAction("int"), "Middle Name ValidatorResult should not contain the 'int' action.");
+        assertFalse(middleNameResult.containsAction("int"), "Middle Name ValidatorResult should not contain the 'int' action.");
 
-        assertTrue(!middleNameResult.containsAction("positive"), "Middle Name ValidatorResult should not contain the 'positive' action.");
+        assertFalse(middleNameResult.containsAction("positive"), "Middle Name ValidatorResult should not contain the 'positive' action.");
     }
 
     /**
@@ -156,9 +157,9 @@ public class MultipleTest extends AbstractCommonTest {
         assertTrue(middleNameResult.isValid("required"), "Middle Name ValidatorResult for the 'required' action should have passed");
 
         assertTrue(middleNameResult.containsAction("int"), "Middle Name ValidatorResult should contain the 'int' action.");
-        assertTrue(!middleNameResult.isValid("int"), "Middle Name ValidatorResult for the 'int' action should have failed");
+        assertFalse(middleNameResult.isValid("int"), "Middle Name ValidatorResult for the 'int' action should have failed");
 
-        assertTrue(!middleNameResult.containsAction("positive"), "Middle Name ValidatorResult should not contain the 'positive' action.");
+        assertFalse(middleNameResult.containsAction("positive"), "Middle Name ValidatorResult should not contain the 'positive' action.");
     }
 
     /**
@@ -195,7 +196,7 @@ public class MultipleTest extends AbstractCommonTest {
         assertTrue(middleNameResult.isValid("int"), "Middle Name ValidatorResult for the 'int' action should have passed");
 
         assertTrue(middleNameResult.containsAction("positive"), "Middle Name ValidatorResult should contain the 'positive' action.");
-        assertTrue(!middleNameResult.isValid("positive"), "Middle Name ValidatorResult for the 'positive' action should have failed");
+        assertFalse(middleNameResult.isValid("positive"), "Middle Name ValidatorResult for the 'positive' action should have failed");
     }
 
     /**
@@ -262,11 +263,11 @@ public class MultipleTest extends AbstractCommonTest {
 
         assertNotNull(firstNameResult, "First Name ValidatorResult should not be null.");
         assertTrue(firstNameResult.containsAction(ACTION), () -> "First Name ValidatorResult should contain the '" + ACTION + "' action.");
-        assertTrue(!firstNameResult.isValid(ACTION), () -> "First Name ValidatorResult for the '" + ACTION + "' action should have failed.");
+        assertFalse(firstNameResult.isValid(ACTION), () -> "First Name ValidatorResult for the '" + ACTION + "' action should have failed.");
 
         assertNotNull(lastNameResult, "Last Name ValidatorResult should not be null.");
         assertTrue(lastNameResult.containsAction("int"), "Last Name ValidatorResult should contain the 'int' action.");
-        assertTrue(!lastNameResult.isValid("int"), "Last Name ValidatorResult for the 'int' action should have failed.");
+        assertFalse(lastNameResult.isValid("int"), "Last Name ValidatorResult for the 'int' action should have failed.");
     }
 
     /**
@@ -334,6 +335,6 @@ public class MultipleTest extends AbstractCommonTest {
 
         assertNotNull(lastNameResult, "Last Name ValidatorResult should not be null.");
         assertTrue(lastNameResult.containsAction("int"), "Last Name ValidatorResult should contain the 'int' action.");
-        assertTrue(!lastNameResult.isValid("int"), "Last Name ValidatorResult for the 'int' action should have failed.");
+        assertFalse(lastNameResult.isValid("int"), "Last Name ValidatorResult for the 'int' action should have failed.");
     }
 }
diff --git a/src/test/java/org/apache/commons/validator/RequiredIfTest.java b/src/test/java/org/apache/commons/validator/RequiredIfTest.java
index 243f6e90..699db985 100644
--- a/src/test/java/org/apache/commons/validator/RequiredIfTest.java
+++ b/src/test/java/org/apache/commons/validator/RequiredIfTest.java
@@ -16,6 +16,7 @@
  */
 package org.apache.commons.validator;
 
+import static org.junit.jupiter.api.Assertions.assertFalse;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
@@ -151,7 +152,7 @@ public class RequiredIfTest extends AbstractCommonTest {
 
         assertNotNull(firstNameResult, "First Name ValidatorResult should not be null.");
         assertTrue(firstNameResult.containsAction(ACTION), () -> "First Name ValidatorResult should contain the '" + ACTION + "' action.");
-        assertTrue(!firstNameResult.isValid(ACTION), () -> "First Name ValidatorResult for the '" + ACTION + "' action should have failed.");
+        assertFalse(firstNameResult.isValid(ACTION), () -> "First Name ValidatorResult for the '" + ACTION + "' action should have failed.");
 
         assertNotNull(lastNameResult, "Last Name ValidatorResult should not be null.");
         assertTrue(lastNameResult.containsAction(ACTION), () -> "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
@@ -224,7 +225,7 @@ public class RequiredIfTest extends AbstractCommonTest {
 
         assertNotNull(lastNameResult, "Last Name ValidatorResult should not be null.");
         assertTrue(lastNameResult.containsAction(ACTION), () -> "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
-        assertTrue(!lastNameResult.isValid(ACTION), () -> "Last Name ValidatorResult for the '" + ACTION + "' action should have failed.");
+        assertFalse(lastNameResult.isValid(ACTION), () -> "Last Name ValidatorResult for the '" + ACTION + "' action should have failed.");
     }
 
 }
diff --git a/src/test/java/org/apache/commons/validator/RequiredNameTest.java b/src/test/java/org/apache/commons/validator/RequiredNameTest.java
index 6235c639..6578e360 100644
--- a/src/test/java/org/apache/commons/validator/RequiredNameTest.java
+++ b/src/test/java/org/apache/commons/validator/RequiredNameTest.java
@@ -17,6 +17,7 @@
 package org.apache.commons.validator;
 
 import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertFalse;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.io.IOException;
@@ -83,11 +84,11 @@ public class RequiredNameTest extends AbstractCommonTest {
 
         assertNotNull(firstNameResult, "First Name ValidatorResult should not be null.");
         assertTrue(firstNameResult.containsAction(ACTION), () -> "First Name ValidatorResult should contain the '" + ACTION + "' action.");
-        assertTrue(!firstNameResult.isValid(ACTION), () -> "First Name ValidatorResult for the '" + ACTION + "' action should have failed.");
+        assertFalse(firstNameResult.isValid(ACTION), () -> "First Name ValidatorResult for the '" + ACTION + "' action should have failed.");
 
         assertNotNull(lastNameResult, "First Name ValidatorResult should not be null.");
         assertTrue(lastNameResult.containsAction(ACTION), "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
-        assertTrue(!lastNameResult.isValid(ACTION), "Last Name ValidatorResult for the '" + ACTION + "' action should have failed.");
+        assertFalse(lastNameResult.isValid(ACTION), "Last Name ValidatorResult for the '" + ACTION + "' action should have failed.");
     }
 
     /**
@@ -120,7 +121,7 @@ public class RequiredNameTest extends AbstractCommonTest {
 
         assertNotNull(lastNameResult, "First Name ValidatorResult should not be null.");
         assertTrue(lastNameResult.containsAction(ACTION), () -> "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
-        assertTrue(!lastNameResult.isValid(ACTION), () -> "Last Name ValidatorResult for the '" + ACTION + "' action should have failed.");
+        assertFalse(lastNameResult.isValid(ACTION), () -> "Last Name ValidatorResult for the '" + ACTION + "' action should have failed.");
     }
 
     /**
@@ -149,11 +150,11 @@ public class RequiredNameTest extends AbstractCommonTest {
 
         assertNotNull(firstNameResult, "First Name ValidatorResult should not be null.");
         assertTrue(firstNameResult.containsAction(ACTION), () -> "First Name ValidatorResult should contain the '" + ACTION + "' action.");
-        assertTrue(!firstNameResult.isValid(ACTION), () -> "First Name ValidatorResult for the '" + ACTION + "' action should have failed.");
+        assertFalse(firstNameResult.isValid(ACTION), () -> "First Name ValidatorResult for the '" + ACTION + "' action should have failed.");
 
         assertNotNull(lastNameResult, "First Name ValidatorResult should not be null.");
         assertTrue(lastNameResult.containsAction(ACTION), () -> "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
-        assertTrue(!lastNameResult.isValid(ACTION), () -> "Last Name ValidatorResult for the '" + ACTION + "' action should have failed.");
+        assertFalse(lastNameResult.isValid(ACTION), () -> "Last Name ValidatorResult for the '" + ACTION + "' action should have failed.");
     }
 
     /**
@@ -182,7 +183,7 @@ public class RequiredNameTest extends AbstractCommonTest {
 
         assertNotNull(firstNameResult, "First Name ValidatorResult should not be null.");
         assertTrue(firstNameResult.containsAction(ACTION), () -> "First Name ValidatorResult should contain the '" + ACTION + "' action.");
-        assertTrue(!firstNameResult.isValid(ACTION), () -> "First Name ValidatorResult for the '" + ACTION + "' action should have failed.");
+        assertFalse(firstNameResult.isValid(ACTION), () -> "First Name ValidatorResult for the '" + ACTION + "' action should have failed.");
 
         assertNotNull(lastNameResult, "First Name ValidatorResult should not be null.");
         assertTrue(lastNameResult.containsAction(ACTION), () -> "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
@@ -216,11 +217,11 @@ public class RequiredNameTest extends AbstractCommonTest {
 
         assertNotNull(firstNameResult, "First Name ValidatorResult should not be null.");
         assertTrue(firstNameResult.containsAction(ACTION), "First Name ValidatorResult should contain the '" + ACTION + "' action.");
-        assertTrue(!firstNameResult.isValid(ACTION), "First Name ValidatorResult for the '" + ACTION + "' action should have failed.");
+        assertFalse(firstNameResult.isValid(ACTION), "First Name ValidatorResult for the '" + ACTION + "' action should have failed.");
 
         assertNotNull(lastNameResult, "First Name ValidatorResult should not be null.");
         assertTrue(lastNameResult.containsAction(ACTION), () -> "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
-        assertTrue(!lastNameResult.isValid(ACTION), () -> "Last Name ValidatorResult for the '" + ACTION + "' action should have failed.");
+        assertFalse(lastNameResult.isValid(ACTION), () -> "Last Name ValidatorResult for the '" + ACTION + "' action should have failed.");
     }
 
     /**
diff --git a/src/test/java/org/apache/commons/validator/ValidatorTest.java b/src/test/java/org/apache/commons/validator/ValidatorTest.java
index fbc887c2..6f1b3f9b 100644
--- a/src/test/java/org/apache/commons/validator/ValidatorTest.java
+++ b/src/test/java/org/apache/commons/validator/ValidatorTest.java
@@ -278,7 +278,7 @@ public class ValidatorTest {
 
             assertTrue(result.containsAction(action), "ValidatorResult does not contain '" + action + "' validator result.");
 
-            assertTrue(!result.isValid(action), "Validation of the date formatting has passed when it should have failed.");
+            assertFalse(result.isValid(action), "Validation of the date formatting has passed when it should have failed.");
         } catch (final Exception e) {
             fail("An exception was thrown while calling Validator.validate()");
         }
diff --git a/src/test/java/org/apache/commons/validator/routines/CalendarValidatorTest.java b/src/test/java/org/apache/commons/validator/routines/CalendarValidatorTest.java
index e4ec0d32..08fa93b2 100644
--- a/src/test/java/org/apache/commons/validator/routines/CalendarValidatorTest.java
+++ b/src/test/java/org/apache/commons/validator/routines/CalendarValidatorTest.java
@@ -18,6 +18,8 @@ package org.apache.commons.validator.routines;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertNotSame;
 import static org.junit.jupiter.api.Assertions.assertNull;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.junit.jupiter.api.Assertions.fail;
@@ -64,36 +66,36 @@ public class CalendarValidatorTest extends AbstractCalendarValidatorTest {
         final Date dateCET = calCET.getTime();
 
         // Check the dates don't match
-        assertFalse(dateGMT.getTime() == dateCET.getTime(), "Check GMT != CET");
-        assertFalse(dateGMT.getTime() == dateEST.getTime(), "Check GMT != EST");
-        assertFalse(dateCET.getTime() == dateEST.getTime(), "Check CET != EST");
+        assertNotEquals(dateGMT.getTime(), dateCET.getTime(), "Check GMT != CET");
+        assertNotEquals(dateGMT.getTime(), dateEST.getTime(), "Check GMT != EST");
+        assertNotEquals(dateCET.getTime(), dateEST.getTime(), "Check CET != EST");
 
         // EST to GMT and back
         CalendarValidator.adjustToTimeZone(calEST, GMT);
         assertEquals(dateGMT, calEST.getTime(), "EST to GMT");
-        assertFalse(dateEST == calEST.getTime(), "Check EST = GMT");
+        assertNotSame(dateEST, calEST.getTime(), "Check EST = GMT");
         CalendarValidator.adjustToTimeZone(calEST, EST);
         assertEquals(dateEST, calEST.getTime(), "back to EST");
-        assertFalse(dateGMT == calEST.getTime(), "Check EST != GMT");
+        assertNotSame(dateGMT, calEST.getTime(), "Check EST != GMT");
 
         // CET to GMT and back
         CalendarValidator.adjustToTimeZone(calCET, GMT);
         assertEquals(dateGMT, calCET.getTime(), "CET to GMT");
-        assertFalse(dateCET == calCET.getTime(), "Check CET = GMT");
+        assertNotSame(dateCET, calCET.getTime(), "Check CET = GMT");
         CalendarValidator.adjustToTimeZone(calCET, EET);
         assertEquals(dateCET, calCET.getTime(), "back to CET");
-        assertFalse(dateGMT == calCET.getTime(), "Check CET != GMT");
+        assertNotSame(dateGMT, calCET.getTime(), "Check CET != GMT");
 
         // Adjust to TimeZone with Same rules
         final Calendar calUTC = createCalendar(UTC, DATE_2005_11_23, TIME_12_03_45);
         assertTrue(UTC.hasSameRules(GMT), "SAME: UTC = GMT");
         assertEquals(calUTC.getTime(), calGMT.getTime(), "SAME: Check time (A)");
-        assertFalse(GMT.equals(calUTC.getTimeZone()), "SAME: Check GMT(A)");
-        assertTrue(UTC.equals(calUTC.getTimeZone()), "SAME: Check UTC(A)");
+        assertNotEquals(GMT, calUTC.getTimeZone(), "SAME: Check GMT(A)");
+        assertEquals(UTC, calUTC.getTimeZone(), "SAME: Check UTC(A)");
         CalendarValidator.adjustToTimeZone(calUTC, GMT);
         assertEquals(calUTC.getTime(), calGMT.getTime(), "SAME: Check time (B)");
-        assertTrue(GMT.equals(calUTC.getTimeZone()), "SAME: Check GMT(B)");
-        assertFalse(UTC.equals(calUTC.getTimeZone()), "SAME: Check UTC(B)");
+        assertEquals(GMT, calUTC.getTimeZone(), "SAME: Check GMT(B)");
+        assertNotEquals(UTC, calUTC.getTimeZone(), "SAME: Check UTC(B)");
     }
 
     /**
@@ -134,7 +136,7 @@ public class CalendarValidatorTest extends AbstractCalendarValidatorTest {
         // Test Time Zone
         final TimeZone zone = TimeZone.getDefault().getRawOffset() == EET.getRawOffset() ? EST : EET;
         final Date expectedZone = createCalendar(zone, 20051231, 0).getTime();
-        assertFalse(expected.getTime() == expectedZone.getTime(), "default/EET same ");
+        assertNotEquals(expected.getTime(), expectedZone.getTime(), "default/EET same ");
 
         assertEquals(expectedZone, CalendarValidator.getInstance().validate(defaultVal, zone).getTime(), "validate(C) default");
         assertEquals(expectedZone, CalendarValidator.getInstance().validate(localeVal, locale, zone).getTime(), "validate(C) locale ");
diff --git a/src/test/java/org/apache/commons/validator/routines/DateValidatorTest.java b/src/test/java/org/apache/commons/validator/routines/DateValidatorTest.java
index 4e2fb41f..7befa1a3 100644
--- a/src/test/java/org/apache/commons/validator/routines/DateValidatorTest.java
+++ b/src/test/java/org/apache/commons/validator/routines/DateValidatorTest.java
@@ -18,6 +18,7 @@ package org.apache.commons.validator.routines;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
 import static org.junit.jupiter.api.Assertions.assertNull;
 import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -160,7 +161,7 @@ public class DateValidatorTest extends AbstractCalendarValidatorTest {
         // Test Time Zone
         final TimeZone zone = TimeZone.getDefault().getRawOffset() == EET.getRawOffset() ? EST : EET;
         final Date expectedZone = createCalendar(zone, 20051231, 0).getTime();
-        assertFalse(expected.getTime() == expectedZone.getTime(), "default/zone same " + zone);
+        assertNotEquals(expected.getTime(), expectedZone.getTime(), "default/zone same " + zone);
 
         assertEquals(expectedZone, DateValidator.getInstance().validate(defaultVal, zone), "validate(C) default");
         assertEquals(expectedZone, DateValidator.getInstance().validate(localeVal, locale, zone), "validate(C) locale ");
diff --git a/src/test/java/org/apache/commons/validator/util/FlagsTest.java b/src/test/java/org/apache/commons/validator/util/FlagsTest.java
index 317b5bf4..6f3139d4 100644
--- a/src/test/java/org/apache/commons/validator/util/FlagsTest.java
+++ b/src/test/java/org/apache/commons/validator/util/FlagsTest.java
@@ -89,10 +89,10 @@ public class FlagsTest {
         f.turnOn(LONG_FLAG);
         f.turnOn(INT_FLAG);
         assertTrue(f.isOn(LONG_FLAG));
-        assertTrue(!f.isOff(LONG_FLAG));
+        assertFalse(f.isOff(LONG_FLAG));
 
         assertTrue(f.isOn(INT_FLAG));
-        assertTrue(!f.isOff(INT_FLAG));
+        assertFalse(f.isOff(INT_FLAG));
 
         assertTrue(f.isOff(LONG_FLAG_2));
     }


(commons-validator) 05/11: Use Java-style array declarations

Posted by eb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ebourg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-validator.git

commit a49085909f887c50e378dd79387381c7e1ddde6e
Author: Emmanuel Bourg <eb...@apache.org>
AuthorDate: Mon Nov 18 10:54:25 2024 +0100

    Use Java-style array declarations
---
 .../org/apache/commons/validator/routines/CreditCardValidator.java  | 2 +-
 .../org/apache/commons/validator/routines/DomainValidatorTest.java  | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java b/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java
index 2f1f5475..ffa15556 100644
--- a/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java
+++ b/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java
@@ -92,7 +92,7 @@ public class CreditCardValidator implements Serializable {
         final String high; // e.g. 34 or 65
         final int minLen; // e.g. 16 or -1
         final int maxLen; // e.g. 19 or -1
-        final int lengths[]; // e.g. 16,18,19
+        final int[] lengths; // e.g. 16,18,19
 
         /**
          * Create a credit card range specifier for use in validation
diff --git a/src/test/java/org/apache/commons/validator/routines/DomainValidatorTest.java b/src/test/java/org/apache/commons/validator/routines/DomainValidatorTest.java
index 6a489344..c2f9747b 100644
--- a/src/test/java/org/apache/commons/validator/routines/DomainValidatorTest.java
+++ b/src/test/java/org/apache/commons/validator/routines/DomainValidatorTest.java
@@ -264,7 +264,7 @@ public class DomainValidatorTest {
     // Download and process local copy of https://data.iana.org/TLD/tlds-alpha-by-domain.txt
     // Check if the internal TLD table is up to date
     // Check if the internal TLD tables have any spurious entries
-    public static void main(final String a[]) throws Exception {
+    public static void main(final String[] a) throws Exception {
         // Check the arrays first as this affects later checks
         // Doing this here makes it easier when updating the lists
         boolean ok = true;
@@ -583,9 +583,9 @@ public class DomainValidatorTest {
 //      characters MUST be recognized as dots: U+002E (full stop), U+3002
 //      (ideographic full stop), U+FF0E (fullwidth full stop), U+FF61
 //      (halfwidth ideographic full stop).
-        final String otherDots[][] = { { "b\u3002", "b.", }, { "b\uFF0E", "b.", }, { "b\uFF61", "b.", }, { "\u3002", ".", }, { "\uFF0E", ".", },
+        final String[][] otherDots = { { "b\u3002", "b.", }, { "b\uFF0E", "b.", }, { "b\uFF61", "b.", }, { "\u3002", ".", }, { "\uFF0E", ".", },
                 { "\uFF61", ".", }, };
-        for (final String s[] : otherDots) {
+        for (final String[] s : otherDots) {
             assertEquals(s[1], DomainValidator.unicodeToASCII(s[0]));
         }
     }


(commons-validator) 10/11: Use Integer.compare() to compare integers

Posted by eb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ebourg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-validator.git

commit 0a5724e1fcb616d4012e3cd9b7bf915311241eed
Author: Emmanuel Bourg <eb...@apache.org>
AuthorDate: Mon Nov 18 13:30:47 2024 +0100

    Use Integer.compare() to compare integers
---
 .../validator/routines/AbstractCalendarValidator.java   | 17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)

diff --git a/src/main/java/org/apache/commons/validator/routines/AbstractCalendarValidator.java b/src/main/java/org/apache/commons/validator/routines/AbstractCalendarValidator.java
index 5552377c..a3e5264e 100644
--- a/src/main/java/org/apache/commons/validator/routines/AbstractCalendarValidator.java
+++ b/src/main/java/org/apache/commons/validator/routines/AbstractCalendarValidator.java
@@ -75,14 +75,7 @@ public abstract class AbstractCalendarValidator extends AbstractFormatValidator
      *         if it is less than the seconds or +1 if it is greater than the seconds.
      */
     private int calculateCompareResult(final Calendar value, final Calendar compare, final int field) {
-        final int difference = value.get(field) - compare.get(field);
-        if (difference < 0) {
-            return -1;
-        }
-        if (difference > 0) {
-            return 1;
-        }
-        return 0;
+        return Integer.compare(value.get(field), compare.get(field));
     }
 
     /**
@@ -177,13 +170,7 @@ public abstract class AbstractCalendarValidator extends AbstractFormatValidator
     protected int compareQuarters(final Calendar value, final Calendar compare, final int monthOfFirstQuarter) {
         final int valueQuarter = calculateQuarter(value, monthOfFirstQuarter);
         final int compareQuarter = calculateQuarter(compare, monthOfFirstQuarter);
-        if (valueQuarter < compareQuarter) {
-            return -1;
-        }
-        if (valueQuarter > compareQuarter) {
-            return 1;
-        }
-        return 0;
+        return Integer.compare(valueQuarter, compareQuarter);
     }
 
     /**


(commons-validator) 06/11: Removed unused imports

Posted by eb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ebourg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-validator.git

commit 690d6e0d1b72a5534c19bc44ae63b0a06d5d9392
Author: Emmanuel Bourg <eb...@apache.org>
AuthorDate: Mon Nov 18 10:55:09 2024 +0100

    Removed unused imports
---
 .../java/org/apache/commons/validator/routines/DomainValidatorTest.java  | 1 -
 .../java/org/apache/commons/validator/routines/EmailValidatorTest.java   | 1 -
 .../java/org/apache/commons/validator/routines/UrlValidatorTest.java     | 1 -
 3 files changed, 3 deletions(-)

diff --git a/src/test/java/org/apache/commons/validator/routines/DomainValidatorTest.java b/src/test/java/org/apache/commons/validator/routines/DomainValidatorTest.java
index c2f9747b..c1da81d9 100644
--- a/src/test/java/org/apache/commons/validator/routines/DomainValidatorTest.java
+++ b/src/test/java/org/apache/commons/validator/routines/DomainValidatorTest.java
@@ -46,7 +46,6 @@ import java.util.TreeMap;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
-import org.apache.commons.lang3.SystemProperties;
 import org.apache.commons.validator.routines.DomainValidator.ArrayType;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
diff --git a/src/test/java/org/apache/commons/validator/routines/EmailValidatorTest.java b/src/test/java/org/apache/commons/validator/routines/EmailValidatorTest.java
index a70d51e6..8cff426e 100644
--- a/src/test/java/org/apache/commons/validator/routines/EmailValidatorTest.java
+++ b/src/test/java/org/apache/commons/validator/routines/EmailValidatorTest.java
@@ -24,7 +24,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.commons.lang3.SystemProperties;
 import org.apache.commons.validator.ResultPair;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Disabled;
diff --git a/src/test/java/org/apache/commons/validator/routines/UrlValidatorTest.java b/src/test/java/org/apache/commons/validator/routines/UrlValidatorTest.java
index 2d8825c7..8ed80f49 100644
--- a/src/test/java/org/apache/commons/validator/routines/UrlValidatorTest.java
+++ b/src/test/java/org/apache/commons/validator/routines/UrlValidatorTest.java
@@ -26,7 +26,6 @@ import java.net.URISyntaxException;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.commons.lang3.SystemProperties;
 import org.apache.commons.validator.ResultPair;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;


(commons-validator) 09/11: Use assertThrows() to test the expected exceptions

Posted by eb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ebourg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-validator.git

commit 55fde6597217eabbbf38b5be5ad1724b5ed70b9a
Author: Emmanuel Bourg <eb...@apache.org>
AuthorDate: Mon Nov 18 13:25:20 2024 +0100

    Use assertThrows() to test the expected exceptions
---
 .../apache/commons/validator/ExceptionTest.java    | 17 +++-----
 .../commons/validator/ValidatorResourcesTest.java  | 14 ++----
 .../validator/routines/CalendarValidatorTest.java  | 10 ++---
 .../routines/CreditCardValidatorTest.java          |  9 +---
 .../validator/routines/ISBNValidatorTest.java      | 44 ++++++-------------
 .../validator/routines/ISSNValidatorTest.java      | 31 ++++---------
 .../validator/routines/RegexValidatorTest.java     | 51 ++++++----------------
 .../checkdigit/AbstractCheckDigitTest.java         | 25 +++--------
 .../routines/checkdigit/ISBNCheckDigitTest.java    | 34 ++++-----------
 9 files changed, 63 insertions(+), 172 deletions(-)

diff --git a/src/test/java/org/apache/commons/validator/ExceptionTest.java b/src/test/java/org/apache/commons/validator/ExceptionTest.java
index e66789c2..e3ac90f8 100644
--- a/src/test/java/org/apache/commons/validator/ExceptionTest.java
+++ b/src/test/java/org/apache/commons/validator/ExceptionTest.java
@@ -17,6 +17,7 @@
 package org.apache.commons.validator;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 import static org.junit.jupiter.api.Assertions.fail;
 
 import java.io.IOException;
@@ -80,12 +81,8 @@ public class ExceptionTest extends AbstractCommonTest {
         }
 
         // This will be true in Validator 2.0
-//        try {
-//            validator.validate();
-//            fail("ValidatorException should occur here!");
-//        } catch (ValidatorException expected) {
-//            assertTrue("CHECKED-EXCEPTION".equals(expected.getMessage()));
-//        }
+//        Exception expected = assertThrows(ValidatorException.class, validator::validate);
+//        assertTrue("CHECKED-EXCEPTION".equals(expected.getMessage()));
     }
 
     /**
@@ -135,11 +132,7 @@ public class ExceptionTest extends AbstractCommonTest {
         validator.setParameter(Validator.BEAN_PARAM, info);
 
         // Get results of the validation which can throw ValidatorException
-        try {
-            validator.validate();
-            fail("ValidatorException should occur here!");
-        } catch (final ValidatorException expected) {
-            assertEquals("VALIDATOR-EXCEPTION", expected.getMessage());
-        }
+        Exception expected = assertThrows(ValidatorException.class, validator::validate);
+        assertEquals("VALIDATOR-EXCEPTION", expected.getMessage());
     }
 }
diff --git a/src/test/java/org/apache/commons/validator/ValidatorResourcesTest.java b/src/test/java/org/apache/commons/validator/ValidatorResourcesTest.java
index e9421dc2..f308d73e 100644
--- a/src/test/java/org/apache/commons/validator/ValidatorResourcesTest.java
+++ b/src/test/java/org/apache/commons/validator/ValidatorResourcesTest.java
@@ -16,7 +16,7 @@
  */
 package org.apache.commons.validator;
 
-import static org.junit.jupiter.api.Assertions.fail;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 import java.io.InputStream;
 
@@ -31,16 +31,8 @@ public class ValidatorResourcesTest {
      * Test null Input Stream for Validator Resources.
      */
     @Test
-    public void testNullInputStream() throws Exception {
-
-        try {
-            new ValidatorResources((InputStream) null);
-            fail("Expected IllegalArgumentException");
-        } catch (final IllegalArgumentException e) {
-            // expected result
-            // System.out.println("Exception: " + e);
-        }
-
+    public void testNullInputStream() {
+        assertThrows(IllegalArgumentException.class, () -> new ValidatorResources((InputStream) null));
     }
 
 }
diff --git a/src/test/java/org/apache/commons/validator/routines/CalendarValidatorTest.java b/src/test/java/org/apache/commons/validator/routines/CalendarValidatorTest.java
index 08fa93b2..ebbcd25a 100644
--- a/src/test/java/org/apache/commons/validator/routines/CalendarValidatorTest.java
+++ b/src/test/java/org/apache/commons/validator/routines/CalendarValidatorTest.java
@@ -21,8 +21,8 @@ import static org.junit.jupiter.api.Assertions.assertFalse;
 import static org.junit.jupiter.api.Assertions.assertNotEquals;
 import static org.junit.jupiter.api.Assertions.assertNotSame;
 import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 import static org.junit.jupiter.api.Assertions.assertTrue;
-import static org.junit.jupiter.api.Assertions.fail;
 
 import java.text.DateFormat;
 import java.text.Format;
@@ -219,12 +219,8 @@ public class CalendarValidatorTest extends AbstractCalendarValidatorTest {
         assertEquals(1, calValidator.compareYears(value, cal20041231), "year GT"); // -1 year
 
         // invalid compare
-        try {
-            calValidator.compare(value, value, -1);
-            fail("Invalid Compare field - expected IllegalArgumentException to be thrown");
-        } catch (final IllegalArgumentException e) {
-            assertEquals(e.getMessage(), "Invalid field: -1", "check message");
-        }
+        Exception e = assertThrows(IllegalArgumentException.class, () -> calValidator.compare(value, value, -1), "Invalid Compare field");
+        assertEquals(e.getMessage(), "Invalid field: -1", "check message");
     }
 
     /**
diff --git a/src/test/java/org/apache/commons/validator/routines/CreditCardValidatorTest.java b/src/test/java/org/apache/commons/validator/routines/CreditCardValidatorTest.java
index 20cd45d4..69580605 100644
--- a/src/test/java/org/apache/commons/validator/routines/CreditCardValidatorTest.java
+++ b/src/test/java/org/apache/commons/validator/routines/CreditCardValidatorTest.java
@@ -19,8 +19,8 @@ package org.apache.commons.validator.routines;
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertFalse;
 import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 import static org.junit.jupiter.api.Assertions.assertTrue;
-import static org.junit.jupiter.api.Assertions.fail;
 
 import org.apache.commons.validator.routines.CreditCardValidator.CreditCardRange;
 import org.apache.commons.validator.routines.checkdigit.LuhnCheckDigit;
@@ -155,12 +155,7 @@ public class CreditCardValidatorTest {
         assertFalse(ccv.isValid(ERROR_MASTERCARD));
         assertFalse(ccv.isValid(ERROR_DISCOVER));
 
-        try {
-            new CreditCardValidator((CodeValidator[]) null);
-            fail("Expected IllegalArgumentException");
-        } catch (final IllegalArgumentException iae) {
-            // expected result
-        }
+        assertThrows(IllegalArgumentException.class, () -> new CreditCardValidator((CodeValidator[]) null));
     }
 
     /**
diff --git a/src/test/java/org/apache/commons/validator/routines/ISBNValidatorTest.java b/src/test/java/org/apache/commons/validator/routines/ISBNValidatorTest.java
index 0a662252..35512f03 100644
--- a/src/test/java/org/apache/commons/validator/routines/ISBNValidatorTest.java
+++ b/src/test/java/org/apache/commons/validator/routines/ISBNValidatorTest.java
@@ -19,8 +19,8 @@ package org.apache.commons.validator.routines;
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertFalse;
 import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 import static org.junit.jupiter.api.Assertions.assertTrue;
-import static org.junit.jupiter.api.Assertions.fail;
 
 import java.util.regex.Pattern;
 
@@ -86,36 +86,18 @@ public class ISBNValidatorTest {
      */
     @Test
     public void testConversionErrors() {
-        final ISBNValidator validator = ISBNValidator.getInstance();
-        String input = null;
-        try {
-            input = "123456789 ";
-            validator.convertToISBN13(input);
-            fail("Expected IllegalArgumentException for '" + input + "'");
-        } catch (final IllegalArgumentException e) {
-            // expected result
-        }
-        try {
-            input = "12345678901";
-            validator.convertToISBN13(input);
-            fail("Expected IllegalArgumentException for '" + input + "'");
-        } catch (final IllegalArgumentException e) {
-            // expected result
-        }
-        try {
-            input = "";
-            validator.convertToISBN13(input);
-            fail("Expected IllegalArgumentException for '" + input + "'");
-        } catch (final IllegalArgumentException e) {
-            // expected result
-        }
-        try {
-            input = "X234567890";
-            validator.convertToISBN13(input);
-            fail("Expected IllegalArgumentException for '" + input + "'");
-        } catch (final IllegalArgumentException e) {
-            // expected result
-        }
+        ISBNValidator validator = ISBNValidator.getInstance();
+        String input1 = "123456789 ";
+        assertThrows(IllegalArgumentException.class, () -> validator.convertToISBN13(input1), "Expected IllegalArgumentException for '" + input1 + "'");
+
+        String input2 = "12345678901";
+        assertThrows(IllegalArgumentException.class, () -> validator.convertToISBN13(input2), "Expected IllegalArgumentException for '" + input2 + "'");
+
+        String input3 = "";
+        assertThrows(IllegalArgumentException.class, () -> validator.convertToISBN13(input3), "Expected IllegalArgumentException for '" + input3 + "'");
+
+        String input4 = "X234567890";
+        assertThrows(IllegalArgumentException.class, () -> validator.convertToISBN13(input4), "Expected IllegalArgumentException for '" + input4 + "'");
     }
 
     /**
diff --git a/src/test/java/org/apache/commons/validator/routines/ISSNValidatorTest.java b/src/test/java/org/apache/commons/validator/routines/ISSNValidatorTest.java
index f539dcd9..6d09f5d6 100644
--- a/src/test/java/org/apache/commons/validator/routines/ISSNValidatorTest.java
+++ b/src/test/java/org/apache/commons/validator/routines/ISSNValidatorTest.java
@@ -22,7 +22,6 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
 import static org.junit.jupiter.api.Assertions.assertNull;
 import static org.junit.jupiter.api.Assertions.assertThrows;
 import static org.junit.jupiter.api.Assertions.assertTrue;
-import static org.junit.jupiter.api.Assertions.fail;
 
 import java.util.Random;
 
@@ -58,28 +57,14 @@ public class ISSNValidatorTest {
      */
     @Test
     public void testConversionErrors() {
-        String input = null;
-        try {
-            input = "9780072129519";
-            VALIDATOR.extractFromEAN13(input);
-            fail("Expected IllegalArgumentException for '" + input + "'");
-        } catch (final IllegalArgumentException e) {
-            // expected result
-        }
-        try {
-            input = "9791090636071";
-            VALIDATOR.extractFromEAN13(input);
-            fail("Expected IllegalArgumentException for '" + input + "'");
-        } catch (final IllegalArgumentException e) {
-            // expected result
-        }
-        try {
-            input = "03178471";
-            VALIDATOR.extractFromEAN13(input);
-            fail("Expected IllegalArgumentException for '" + input + "'");
-        } catch (final IllegalArgumentException e) {
-            // expected result
-        }
+        String input1 = "9780072129519";
+        assertThrows(IllegalArgumentException.class, () -> VALIDATOR.extractFromEAN13(input1), "Expected IllegalArgumentException for '" + input1 + "'");
+
+        String input2 = "9791090636071";
+        assertThrows(IllegalArgumentException.class, () -> VALIDATOR.extractFromEAN13(input2), "Expected IllegalArgumentException for '" + input2 + "'");
+
+        String input3 = "03178471";
+        assertThrows(IllegalArgumentException.class, () -> VALIDATOR.extractFromEAN13(input3), "Expected IllegalArgumentException for '" + input3 + "'");
     }
 
     /**
diff --git a/src/test/java/org/apache/commons/validator/routines/RegexValidatorTest.java b/src/test/java/org/apache/commons/validator/routines/RegexValidatorTest.java
index 810829ff..8ab10f22 100644
--- a/src/test/java/org/apache/commons/validator/routines/RegexValidatorTest.java
+++ b/src/test/java/org/apache/commons/validator/routines/RegexValidatorTest.java
@@ -20,6 +20,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertFalse;
 import static org.junit.jupiter.api.Assertions.assertNotSame;
 import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.junit.jupiter.api.Assertions.fail;
 
@@ -104,54 +105,28 @@ public class RegexValidatorTest {
     public void testMissingRegex() {
 
         // Single Regular Expression - null
-        try {
-            new RegexValidator((String) null);
-            fail("Single Null - expected IllegalArgumentException");
-        } catch (final IllegalArgumentException e) {
-            assertEquals("Regular expression[0] is missing", e.getMessage(), "Single Null");
-        }
+        Exception e = assertThrows(IllegalArgumentException.class, () -> new RegexValidator((String) null), "Single Null");
+        assertEquals("Regular expression[0] is missing", e.getMessage(), "Single Null");
 
         // Single Regular Expression - Zero Length
-        try {
-            new RegexValidator("");
-            fail("Single Zero Length - expected IllegalArgumentException");
-        } catch (final IllegalArgumentException e) {
-            assertEquals("Regular expression[0] is missing", e.getMessage(), "Single Zero Length");
-        }
+        e = assertThrows(IllegalArgumentException.class, () -> new RegexValidator(""), "Single Zero Length");
+        assertEquals("Regular expression[0] is missing", e.getMessage(), "Single Zero Length");
 
         // Multiple Regular Expression - Null array
-        try {
-            new RegexValidator((String[]) null);
-            fail("Null Array - expected IllegalArgumentException");
-        } catch (final IllegalArgumentException e) {
-            assertEquals("Regular expressions are missing", e.getMessage(), "Null Array");
-        }
+        e = assertThrows(IllegalArgumentException.class, () -> new RegexValidator((String[]) null), "Null Array");
+        assertEquals("Regular expressions are missing", e.getMessage(), "Null Array");
 
         // Multiple Regular Expression - Zero Length array
-        try {
-            new RegexValidator();
-            fail("Zero Length Array - expected IllegalArgumentException");
-        } catch (final IllegalArgumentException e) {
-            assertEquals("Regular expressions are missing", e.getMessage(), "Zero Length Array");
-        }
+        e = assertThrows(IllegalArgumentException.class, () -> new RegexValidator(), "Zero Length Array");
+        assertEquals("Regular expressions are missing", e.getMessage(), "Zero Length Array");
 
         // Multiple Regular Expression - Array has Null
-        String[] expressions = { "ABC", null };
-        try {
-            new RegexValidator(expressions);
-            fail("Array has Null - expected IllegalArgumentException");
-        } catch (final IllegalArgumentException e) {
-            assertEquals("Regular expression[1] is missing", e.getMessage(), "Array has Null");
-        }
+        e = assertThrows(IllegalArgumentException.class, () -> new RegexValidator(new String[]{"ABC", null}), "Array has Null");
+        assertEquals("Regular expression[1] is missing", e.getMessage(), "Array has Null");
 
         // Multiple Regular Expression - Array has Zero Length
-        expressions = new String[] { "", "ABC" };
-        try {
-            new RegexValidator(expressions);
-            fail("Array has Zero Length - expected IllegalArgumentException");
-        } catch (final IllegalArgumentException e) {
-            assertEquals("Regular expression[0] is missing", e.getMessage(), "Array has Zero Length");
-        }
+        e = assertThrows(IllegalArgumentException.class, () -> new RegexValidator(new String[]{"", "ABC"}), "Array has Zero Length");
+        assertEquals("Regular expression[0] is missing", e.getMessage(), "Array has Zero Length");
     }
 
     /**
diff --git a/src/test/java/org/apache/commons/validator/routines/checkdigit/AbstractCheckDigitTest.java b/src/test/java/org/apache/commons/validator/routines/checkdigit/AbstractCheckDigitTest.java
index ae7fcf19..85de68af 100644
--- a/src/test/java/org/apache/commons/validator/routines/checkdigit/AbstractCheckDigitTest.java
+++ b/src/test/java/org/apache/commons/validator/routines/checkdigit/AbstractCheckDigitTest.java
@@ -19,6 +19,7 @@ package org.apache.commons.validator.routines.checkdigit;
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertFalse;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.junit.jupiter.api.Assertions.fail;
 import static org.junit.jupiter.api.Assumptions.assumeTrue;
@@ -263,20 +264,12 @@ public abstract class AbstractCheckDigitTest {
         assertFalse(routine.isValid("9"), "isValid() Length 1");
 
         // calculate() null
-        try {
-            routine.calculate(null);
-            fail("calculate() Null - expected exception");
-        } catch (final Exception e) {
-            assertEquals(missingMessage, e.getMessage(), "calculate() Null");
-        }
+        Exception e = assertThrows(Exception.class, () -> routine.calculate(null), "calculate() Null");
+        assertEquals(missingMessage, e.getMessage(), "calculate() Null");
 
         // calculate() zero length
-        try {
-            routine.calculate("");
-            fail("calculate() Zero Length - expected exception");
-        } catch (final Exception e) {
-            assertEquals(missingMessage, e.getMessage(), "calculate() Zero Length");
-        }
+        e = assertThrows(Exception.class, () -> routine.calculate(""), "calculate() Zero Length");
+        assertEquals(missingMessage, e.getMessage(), "calculate() Zero Length");
     }
 
     /**
@@ -311,12 +304,8 @@ public abstract class AbstractCheckDigitTest {
     @Test
     public void testZeroSum() {
         assertFalse(routine.isValid(zeroSum), "isValid() Zero Sum");
-        try {
-            routine.calculate(zeroSum);
-            fail("Zero Sum - expected exception");
-        } catch (final Exception e) {
-            assertEquals("Invalid code, sum is zero", e.getMessage(), "isValid() Zero Sum");
-        }
+        Exception e = assertThrows(Exception.class, () -> routine.calculate(zeroSum), "Zero Sum");
+        assertEquals("Invalid code, sum is zero", e.getMessage(), "isValid() Zero Sum");
     }
 
 }
diff --git a/src/test/java/org/apache/commons/validator/routines/checkdigit/ISBNCheckDigitTest.java b/src/test/java/org/apache/commons/validator/routines/checkdigit/ISBNCheckDigitTest.java
index 8d8760c2..de954703 100644
--- a/src/test/java/org/apache/commons/validator/routines/checkdigit/ISBNCheckDigitTest.java
+++ b/src/test/java/org/apache/commons/validator/routines/checkdigit/ISBNCheckDigitTest.java
@@ -18,7 +18,7 @@ package org.apache.commons.validator.routines.checkdigit;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertFalse;
-import static org.junit.jupiter.api.Assertions.fail;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
@@ -51,33 +51,17 @@ public class ISBNCheckDigitTest extends AbstractCheckDigitTest {
         assertFalse(routine.isValid("123456789012"), "isValid() Lth 12");
         assertFalse(routine.isValid("12345678901234"), "isValid() Lth 14");
 
-        try {
-            routine.calculate("12345678");
-            fail("calculate() Lth 8 - expected exception");
-        } catch (final Exception e) {
-            assertEquals(e.getMessage(), "Invalid ISBN Length = 8", "calculate() Lth 8");
-        }
+        Exception e = assertThrows(CheckDigitException.class, () -> routine.calculate("12345678"), "calculate() Lth 8");
+        assertEquals(e.getMessage(), "Invalid ISBN Length = 8", "calculate() Lth 8");
 
-        try {
-            routine.calculate("1234567890");
-            fail("calculate() Lth 10 - expected exception");
-        } catch (final Exception e) {
-            assertEquals("Invalid ISBN Length = 10", e.getMessage(), "calculate() Lth 10");
-        }
+        e = assertThrows(CheckDigitException.class, () -> routine.calculate("1234567890"), "calculate() Lth 10");
+        assertEquals("Invalid ISBN Length = 10", e.getMessage(), "calculate() Lth 10");
 
-        try {
-            routine.calculate("12345678901");
-            fail("calculate() Lth 11 - expected exception");
-        } catch (final Exception e) {
-            assertEquals("Invalid ISBN Length = 11", e.getMessage(), "calculate() Lth 11");
-        }
+        e = assertThrows(CheckDigitException.class, () -> routine.calculate("12345678901"), "calculate() Lth 11");
+        assertEquals("Invalid ISBN Length = 11", e.getMessage(), "calculate() Lth 11");
 
-        try {
-            routine.calculate("1234567890123");
-            fail("calculate() Lth 13 - expected exception");
-        } catch (final Exception e) {
-            assertEquals("Invalid ISBN Length = 13", e.getMessage(), "calculate() Lth 13");
-        }
+        e = assertThrows(CheckDigitException.class, () -> routine.calculate("1234567890123"), "calculate() Lth 13");
+        assertEquals("Invalid ISBN Length = 13", e.getMessage(), "calculate() Lth 13");
     }
 
 }


(commons-validator) 01/11: Replace org.junit.Ignore with org.junit.jupiter.api.Disabled

Posted by eb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ebourg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-validator.git

commit d1e92298432ecb97171006d6b44d64bbca790d8f
Author: Emmanuel Bourg <eb...@apache.org>
AuthorDate: Mon Nov 18 10:23:44 2024 +0100

    Replace org.junit.Ignore with org.junit.jupiter.api.Disabled
---
 src/test/java/org/apache/commons/validator/EmailTest.java     | 6 +++---
 src/test/java/org/apache/commons/validator/ExceptionTest.java | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/test/java/org/apache/commons/validator/EmailTest.java b/src/test/java/org/apache/commons/validator/EmailTest.java
index f584f68f..b50dd57d 100644
--- a/src/test/java/org/apache/commons/validator/EmailTest.java
+++ b/src/test/java/org/apache/commons/validator/EmailTest.java
@@ -22,8 +22,8 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.io.IOException;
 
-import org.junit.Ignore;
 import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Disabled;
 import org.junit.jupiter.api.Test;
 import org.xml.sax.SAXException;
 
@@ -161,7 +161,7 @@ public class EmailTest extends AbstractCommonTest {
      *
      *                            FIXME This test fails so disable it with a leading _ for 1.1.4 release. The real solution is to fix the email parsing.
      */
-    @Ignore
+    @Disabled
     public void testEmailFromPerl() throws ValidatorException {
         final ValueBean info = new ValueBean();
         for (final ResultPair element : testEmailFromPerl) {
@@ -190,7 +190,7 @@ public class EmailTest extends AbstractCommonTest {
      *
      * @throws ValidatorException
      */
-    @Ignore
+    @Disabled
     public void testEmailUserName() throws ValidatorException {
         final ValueBean info = new ValueBean();
         info.setValue("joe1blow@apache.org");
diff --git a/src/test/java/org/apache/commons/validator/ExceptionTest.java b/src/test/java/org/apache/commons/validator/ExceptionTest.java
index 9dccdb3b..a7e8af04 100644
--- a/src/test/java/org/apache/commons/validator/ExceptionTest.java
+++ b/src/test/java/org/apache/commons/validator/ExceptionTest.java
@@ -21,8 +21,8 @@ import static org.junit.jupiter.api.Assertions.fail;
 
 import java.io.IOException;
 
-import org.junit.Ignore;
 import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Disabled;
 import org.junit.jupiter.api.Test;
 import org.xml.sax.SAXException;
 
@@ -55,7 +55,7 @@ public class ExceptionTest extends AbstractCommonTest {
      * N.B. This test has been removed (renamed) as it currently serves no purpose. If/When exception handling is changed in Validator 2.0 it can be
      * reconsidered then.
      */
-    @Ignore
+    @Disabled
     public void testCheckedException() {
         // Create bean to run test on.
         final ValueBean info = new ValueBean();
@@ -94,7 +94,7 @@ public class ExceptionTest extends AbstractCommonTest {
      * N.B. This test has been removed (renamed) as it currently serves no purpose. If/When exception handling is changed in Validator 2.0 it can be
      * reconsidered then.
      */
-    @Ignore
+    @Disabled
     public void testRuntimeException() throws ValidatorException {
         // Create bean to run test on.
         final ValueBean info = new ValueBean();


(commons-validator) 02/11: Replace org.junit.Before with org.junit.jupiter.api.BeforeEach

Posted by eb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ebourg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-validator.git

commit 528a9e2ebba5653787cc2bac5c4b6a7da4516c4f
Author: Emmanuel Bourg <eb...@apache.org>
AuthorDate: Mon Nov 18 10:24:24 2024 +0100

    Replace org.junit.Before with org.junit.jupiter.api.BeforeEach
---
 .../java/org/apache/commons/validator/routines/UrlValidatorTest.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/test/java/org/apache/commons/validator/routines/UrlValidatorTest.java b/src/test/java/org/apache/commons/validator/routines/UrlValidatorTest.java
index 3fb605ae..2d8825c7 100644
--- a/src/test/java/org/apache/commons/validator/routines/UrlValidatorTest.java
+++ b/src/test/java/org/apache/commons/validator/routines/UrlValidatorTest.java
@@ -28,7 +28,7 @@ import java.util.List;
 
 import org.apache.commons.lang3.SystemProperties;
 import org.apache.commons.validator.ResultPair;
-import org.junit.Before;
+import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 
 /**
@@ -143,7 +143,7 @@ public class UrlValidatorTest {
             new ResultPair("g0-to+.", true), new ResultPair("not_valid", false), // underscore not allowed
             new ResultPair("HtTp", true), new ResultPair("telnet", false) };
 
-    @Before
+    @BeforeEach
     public void setUp() {
         for (int index = 0; index < testPartsIndex.length - 1; index++) {
             testPartsIndex[index] = 0;


Re: (commons-validator) 08/11: Removed unnecessary lambdas in the tests

Posted by Emmanuel Bourg <eb...@apache.org>.
Le 19/11/2024 à 19:12, Emmanuel Bourg a écrit :

> I ran "mvn clean" and "mvn package" 20 times, ignoring the first 10 runs 
> to warm up the system caches, and noted the total build time reported by 
> Maven. The build machine is a 6 years old laptop (Core i6 7500U, 32GB 
> RAM) on Windows 10, using Java 8:
> 
> At commit 7eee2066, before the lambda change, I get:
> Average: 38,788s ±601ms
> 
> 
> At commit dfd4a9e4, on the commit removing the lambdas, I get:
> Average: 38,132s ±660ms (1.7% improvement)
> 
> 
> At commit cdc0125b, after all my changes, I get:
> Average: 37,820s ±745 (2,5% improvement)
> 
> 
> I didn't expect such a noticeable difference but it looks like the build 
> time actually improved.


I ran another set of tests on a faster machine. Here is the setup:
- Xeon E-2274G 4C/8T @ 4GHz, 64GB RAM
- Debian Sid
- OpenJDK 8 and 21
- Maven 3.8.8
- 100 runs per test
- "mvn compile test" only, no "package" goal
- "mvn clean" between runs, not measured
- animal-sniffer, jacoco and buildnumber plugins disabled
- first build at commit 7eee2066 before the change
- second build at commit dfd4a9e4 (lambda removal) + 8047556 
(String.format() removal)

Here are the results:

              OpenJDK 8                OpenJDK 21

Before       8.030s ±345ms (±4.30%)   8.089s ±217ms (±2.68%)

After        7.940s ±320ms (±4.03%)   8.016s ±183ms (±2.28%)

Difference   -90ms (-1.12%)           -73ms (-0.91%)


So here again, it's slightly faster without lambdas.

Emmanuel Bourg


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: (commons-validator) 08/11: Removed unnecessary lambdas in the tests

Posted by Emmanuel Bourg <eb...@apache.org>.
Le 19/11/2024 à 18:10, Emmanuel Bourg a écrit :

> If you can prove your claim by demonstrating that this readability 
> improvement degrades the build time of Commons Validator by more than 
> 0.01% I'll happily revert it.

Since I was asked privately in undiplomatic terms to do it myself, I'm 
sharing my results.

I ran "mvn clean" and "mvn package" 20 times, ignoring the first 10 runs 
to warm up the system caches, and noted the total build time reported by 
Maven. The build machine is a 6 years old laptop (Core i6 7500U, 32GB 
RAM) on Windows 10, using Java 8:

At commit 7eee2066, before the lambda change, I get:

38,329
39,184
38,875
37,826
38,887
39,952
38,313
38,434
39,277
38,802

Average: 38,788s ±601ms


At commit dfd4a9e4, on the commit removing the lambdas, I get:

37,182
38,614
37,486
38,777
38,242
37,486
38,464
37,436
38,825
38,805

Average: 38,132s ±660ms (1.7% improvement)


At commit cdc0125b, after all my changes, I get:

37,627
38,015
38,236
37,043
38,691
36,404
38,377
37,396
38,751
37,663

Average: 37,820s ±745 (2,5% improvement)


I didn't expect such a noticeable difference but it looks like the build 
time actually improved.

Talking about build time, there are some plugins executed in the 
compile/test phases (rat, buildnumber, animal-sniffer) that could be 
moved to the package or install phases, or to the release profile to 
save some time when developing.

Emmanuel Bourg



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: (commons-validator) 08/11: Removed unnecessary lambdas in the tests

Posted by Emmanuel Bourg <eb...@apache.org>.
Le 18/11/2024 à 17:11, Gary Gregory a écrit :
> -1 you are undoing the port to JUnit 5. This commit is a classic JUnit
> mistake imo, please stop, these JUnit APIs exist for a reason: The lambdas
> avoid construction of failure message strings, which, as a pattern, add
> processing, can have side effects, and always creates more garbage. This is
> bad since in general toString() methods can do anything. String.format() is
> a great way to create nice messages in a compact way but is not free.

(reposting since the reply was mistakenly sent to Gary instead of the 
mailing list)

The JUnit 5 documentation [1] states:

"When using a Supplier<String> (e.g., a lambda expression), the message 
is evaluated lazily. This can provide a performance benefit, especially 
if message construction is complex or time-consuming, as it is only 
evaluated when the assertion fails."

Simple string concatenations are neither complex nor time-consuming. 
It's nowhere mentioned that the direct value construct is deprecated or 
discouraged.

If you can prove your claim by demonstrating that this readability 
improvement degrades the build time of Commons Validator by more than 
0.01% I'll happily revert it.

Emmanuel Bourg

[1] https://junit.org/junit5/docs/snapshot/user-guide/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: (commons-validator) 08/11: Removed unnecessary lambdas in the tests

Posted by Gary Gregory <ga...@gmail.com>.
Please, definitely not assert-j or hamcrest. I'd rather stay with the
current mess.

I've actually spent time replacing assert-j with JUnit calls because Java
is verbose enough without this type of code. JUnit has the right balance
and approach IMO. I've seen code using assertj that is silly when all you
need is assertEquals().

Junit-pioneer OTOH is a fantastic library. Actually useful.

Gary

On Tue, Nov 19, 2024, 4:27 PM Piotr P. Karwasz <pi...@mailing.copernik.eu>
wrote:

> Hi Gary,
>
> On 18.11.2024 17:11, Gary Gregory wrote:
> > -1 you are undoing the port to JUnit 5. This commit is a classic JUnit
> > mistake imo, please stop, these JUnit APIs exist for a reason: The
> lambdas
> > avoid construction of failure message strings, which, as a pattern, add
> > processing, can have side effects, and always creates more garbage. This
> is
> > bad since in general toString() methods can do anything. String.format()
> is
> > a great way to create nice messages in a compact way but is not free.
> >
> > Gary
> >
> > On Mon, Nov 18, 2024, 7:53 AM <eb...@apache.org> wrote:
> >
> >> -        assertNotNull(result, () -> action + " value ValidatorResult
> >> should not be null.");
> >> -        assertTrue(result.containsAction(action), () -> action + "
> value
> >> ValidatorResult should contain the '" + action + "' action.");
> >> +        assertNotNull(result, action + " value ValidatorResult should
> not
> >> be null.");
> >> +        assertTrue(result.containsAction(action), action + " value
> >> ValidatorResult should contain the '" + action + "' action.");
> >>           assertTrue(passed ? result.isValid(action) :
> >> !result.isValid(action),
> >
> As a compromise we could switch to AssertJ, which has parameterized
> descriptions and more readable:
>
>      assertThat(result).as("ValidatorResult for %s", action).isNotNull();
>
> Piotr
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

Re: (commons-validator) 08/11: Removed unnecessary lambdas in the tests

Posted by Emmanuel Bourg <eb...@apache.org>.
Le 19/11/2024 à 22:26, Piotr P. Karwasz a écrit :

> As a compromise we could switch to AssertJ, which has parameterized 
> descriptions and more readable:
> 
>      assertThat(result).as("ValidatorResult for %s", action).isNotNull();
> 

Nice fluent syntax, but let's not waste more time on this futile debate. 
I don't care that much about the syntax of the assertions, I was just 
clearing some IDE warnings when I removed the lambdas. I don't mind if 
Gary reverts the commit if he feels better that way, this has zero 
impact on the users anyway.

Emmanuel Bourg


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: (commons-validator) 08/11: Removed unnecessary lambdas in the tests

Posted by "Piotr P. Karwasz" <pi...@mailing.copernik.eu>.
Hi Gary,

On 18.11.2024 17:11, Gary Gregory wrote:
> -1 you are undoing the port to JUnit 5. This commit is a classic JUnit
> mistake imo, please stop, these JUnit APIs exist for a reason: The lambdas
> avoid construction of failure message strings, which, as a pattern, add
> processing, can have side effects, and always creates more garbage. This is
> bad since in general toString() methods can do anything. String.format() is
> a great way to create nice messages in a compact way but is not free.
>
> Gary
>
> On Mon, Nov 18, 2024, 7:53 AM <eb...@apache.org> wrote:
>
>> -        assertNotNull(result, () -> action + " value ValidatorResult
>> should not be null.");
>> -        assertTrue(result.containsAction(action), () -> action + " value
>> ValidatorResult should contain the '" + action + "' action.");
>> +        assertNotNull(result, action + " value ValidatorResult should not
>> be null.");
>> +        assertTrue(result.containsAction(action), action + " value
>> ValidatorResult should contain the '" + action + "' action.");
>>           assertTrue(passed ? result.isValid(action) :
>> !result.isValid(action),
>
As a compromise we could switch to AssertJ, which has parameterized 
descriptions and more readable:

     assertThat(result).as("ValidatorResult for %s", action).isNotNull();

Piotr



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: (commons-validator) 08/11: Removed unnecessary lambdas in the tests

Posted by Gary Gregory <ga...@gmail.com>.
On Mon, Nov 18, 2024, 11:16 AM Mike Drob <md...@mdrob.com> wrote:

> In practical terms, what is the time cost?


I am thinking in terms of the cumulative costs of running build after build
on CI systems on many Java versions and sometimes many OSs. What also
matters is showing best practices on JUnit 5 to contractors and
maintainers. This isn't it IMO. YMMV on readability. I prefer to see that a
contributor cares about details and thinks of the big picture than quick
hacks to satisfy personal preferences.

Gary

I imagined the lambda APIs

> existing to avoid heavy processing, like printing out the state of a
> database or other large complex graph. StringBuilder doesn't seem like a
> huge issue and the readability is nice. Have we spent more time writing
> these emails than would be saved over the lifetime of every developer who
> ever runs the tests?
>



> On Mon, Nov 18, 2024 at 10:12 AM Gary Gregory <ga...@gmail.com>
> wrote:
>
> > -1 you are undoing the port to JUnit 5. This commit is a classic JUnit
> > mistake imo, please stop, these JUnit APIs exist for a reason: The
> lambdas
> > avoid construction of failure message strings, which, as a pattern, add
> > processing, can have side effects, and always creates more garbage. This
> is
> > bad since in general toString() methods can do anything. String.format()
> is
> > a great way to create nice messages in a compact way but is not free.
> >
> > Gary
> >
> > On Mon, Nov 18, 2024, 7:53 AM <eb...@apache.org> wrote:
> >
> > > This is an automated email from the ASF dual-hosted git repository.
> > >
> > > ebourg pushed a commit to branch master
> > > in repository
> https://gitbox.apache.org/repos/asf/commons-validator.git
> > >
> > > commit dfd4a9e426ea6d0901af757ce333d2577772b2b1
> > > Author: Emmanuel Bourg <eb...@apache.org>
> > > AuthorDate: Mon Nov 18 11:22:35 2024 +0100
> > >
> > >     Removed unnecessary lambdas in the tests
> > > ---
> > >  .../commons/validator/AbstractNumberTest.java      |  6 ++--
> > >  .../org/apache/commons/validator/DateTest.java     |  6 ++--
> > >  .../org/apache/commons/validator/EmailTest.java    |  6 ++--
> > >  .../validator/GenericTypeValidatorTest.java        | 16 ++++-----
> > >  .../org/apache/commons/validator/MultipleTest.java | 20 +++++------
> > >  .../apache/commons/validator/ParameterTest.java    |  4 +--
> > >  .../apache/commons/validator/RequiredIfTest.java   | 36
> > > +++++++++----------
> > >  .../apache/commons/validator/RequiredNameTest.java | 40
> > > +++++++++++-----------
> > >  .../commons/validator/ValidatorResultsTest.java    | 10 +++---
> > >  .../routines/AbstractNumberValidatorTest.java      | 16 ++++-----
> > >  .../routines/InetAddressValidatorTest.java         |  4 +--
> > >  .../validator/routines/TimeValidatorTest.java      | 20 +++++------
> > >  .../routines/checkdigit/CUSIPCheckDigitTest.java   |  4 +--
> > >  .../routines/checkdigit/ISINCheckDigitTest.java    |  2 +-
> > >  .../checkdigit/ModulusTenCUSIPCheckDigitTest.java  |  4 +--
> > >  .../checkdigit/ModulusTenSedolCheckDigitTest.java  |  2 +-
> > >  .../routines/checkdigit/SedolCheckDigitTest.java   |  2 +-
> > >  17 files changed, 99 insertions(+), 99 deletions(-)
> > >
> > > diff --git
> > > a/src/test/java/org/apache/commons/validator/AbstractNumberTest.java
> > > b/src/test/java/org/apache/commons/validator/AbstractNumberTest.java
> > > index b245c536..6652428e 100644
> > > ---
> a/src/test/java/org/apache/commons/validator/AbstractNumberTest.java
> > > +++
> b/src/test/java/org/apache/commons/validator/AbstractNumberTest.java
> > > @@ -100,10 +100,10 @@ public abstract class AbstractNumberTest extends
> > > AbstractCommonTest {
> > >
> > >          final ValidatorResult result =
> > > results.getValidatorResult("value");
> > >
> > > -        assertNotNull(result, () -> action + " value ValidatorResult
> > > should not be null.");
> > > -        assertTrue(result.containsAction(action), () -> action + "
> value
> > > ValidatorResult should contain the '" + action + "' action.");
> > > +        assertNotNull(result, action + " value ValidatorResult should
> > not
> > > be null.");
> > > +        assertTrue(result.containsAction(action), action + " value
> > > ValidatorResult should contain the '" + action + "' action.");
> > >          assertTrue(passed ? result.isValid(action) :
> > > !result.isValid(action),
> > > -                () -> action + " value ValidatorResult for the '" +
> > > action + "' action should have " + (passed ? "passed" : "failed") +
> ".");
> > > +                action + " value ValidatorResult for the '" + action +
> > "'
> > > action should have " + (passed ? "passed" : "failed") + ".");
> > >      }
> > >
> > >  }
> > > diff --git a/src/test/java/org/apache/commons/validator/DateTest.java
> > > b/src/test/java/org/apache/commons/validator/DateTest.java
> > > index c7db41d4..a42d6b4c 100644
> > > --- a/src/test/java/org/apache/commons/validator/DateTest.java
> > > +++ b/src/test/java/org/apache/commons/validator/DateTest.java
> > > @@ -98,10 +98,10 @@ public class DateTest extends AbstractCommonTest {
> > >
> > >          final ValidatorResult result =
> > > results.getValidatorResult("value");
> > >
> > > -        assertNotNull(result, () -> ACTION + " value ValidatorResult
> > > should not be null.");
> > > -        assertTrue(result.containsAction(ACTION), () -> ACTION + "
> value
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > +        assertNotNull(result, ACTION + " value ValidatorResult should
> > not
> > > be null.");
> > > +        assertTrue(result.containsAction(ACTION), ACTION + " value
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > >          assertTrue(passed ? result.isValid(ACTION) :
> > > !result.isValid(ACTION),
> > > -                () -> ACTION + " value ValidatorResult for the '" +
> > > ACTION + "' action should have " + (passed ? "passed" : "failed") +
> ".");
> > > +                ACTION + " value ValidatorResult for the '" + ACTION +
> > "'
> > > action should have " + (passed ? "passed" : "failed") + ".");
> > >      }
> > >
> > >  }
> > > diff --git a/src/test/java/org/apache/commons/validator/EmailTest.java
> > > b/src/test/java/org/apache/commons/validator/EmailTest.java
> > > index 39a78230..92ae84ce 100644
> > > --- a/src/test/java/org/apache/commons/validator/EmailTest.java
> > > +++ b/src/test/java/org/apache/commons/validator/EmailTest.java
> > > @@ -406,9 +406,9 @@ public class EmailTest extends AbstractCommonTest {
> > >
> > >          final ValidatorResult result =
> > > results.getValidatorResult("value");
> > >
> > > -        assertNotNull(result, () -> ACTION + " value ValidatorResult
> > > should not be null.");
> > > -        assertTrue(result.containsAction(ACTION), () -> "Value " +
> > > info.getValue() + " ValidatorResult should contain the '" + ACTION + "'
> > > action.");
> > > +        assertNotNull(result, ACTION + " value ValidatorResult should
> > not
> > > be null.");
> > > +        assertTrue(result.containsAction(ACTION), "Value " +
> > > info.getValue() + " ValidatorResult should contain the '" + ACTION + "'
> > > action.");
> > >          assertTrue(passed ? result.isValid(ACTION) :
> > > !result.isValid(ACTION),
> > > -                () -> "Value " + info.getValue() + "ValidatorResult
> for
> > > the '" + ACTION + "' action should have " + (passed ? "passed" :
> > "failed")
> > > + ".");
> > > +                "Value " + info.getValue() + "ValidatorResult for the
> '"
> > > + ACTION + "' action should have " + (passed ? "passed" : "failed") +
> > ".");
> > >      }
> > >  }
> > > diff --git
> > >
> >
> a/src/test/java/org/apache/commons/validator/GenericTypeValidatorTest.java
> > >
> >
> b/src/test/java/org/apache/commons/validator/GenericTypeValidatorTest.java
> > > index 104bfb4f..dd70d65f 100644
> > > ---
> > >
> >
> a/src/test/java/org/apache/commons/validator/GenericTypeValidatorTest.java
> > > +++
> > >
> >
> b/src/test/java/org/apache/commons/validator/GenericTypeValidatorTest.java
> > > @@ -69,18 +69,18 @@ public class GenericTypeValidatorTest extends
> > > AbstractCommonTest {
> > >
> > >          final Map<String, ?> hResultValues =
> > results.getResultValueMap();
> > >
> > > -        assertInstanceOf(Byte.class, hResultValues.get("byte"), () ->
> > > "Expecting byte result to be an instance of Byte for locale: " +
> locale);
> > > -        assertInstanceOf(Short.class, hResultValues.get("short"), ()
> ->
> > > "Expecting short result to be an instance of Short for locale: " +
> > locale);
> > > -        assertInstanceOf(Integer.class, hResultValues.get("integer"),
> ()
> > > -> "Expecting integer result to be an instance of Integer for locale:
> " +
> > > locale);
> > > -        assertInstanceOf(Long.class, hResultValues.get("long"), () ->
> > > "Expecting long result to be an instance of Long for locale: " +
> locale);
> > > -        assertInstanceOf(Float.class, hResultValues.get("float"), ()
> ->
> > > "Expecting float result to be an instance of Float for locale: " +
> > locale);
> > > -        assertInstanceOf(Double.class, hResultValues.get("double"), ()
> > ->
> > > "Expecting double result to be an instance of Double for locale: " +
> > > locale);
> > > -        assertInstanceOf(Date.class, hResultValues.get("date"), () ->
> > > "Expecting date result to be an instance of Date for locale: " +
> locale);
> > > +        assertInstanceOf(Byte.class, hResultValues.get("byte"),
> > > "Expecting byte result to be an instance of Byte for locale: " +
> locale);
> > > +        assertInstanceOf(Short.class, hResultValues.get("short"),
> > > "Expecting short result to be an instance of Short for locale: " +
> > locale);
> > > +        assertInstanceOf(Integer.class, hResultValues.get("integer"),
> > > "Expecting integer result to be an instance of Integer for locale: " +
> > > locale);
> > > +        assertInstanceOf(Long.class, hResultValues.get("long"),
> > > "Expecting long result to be an instance of Long for locale: " +
> locale);
> > > +        assertInstanceOf(Float.class, hResultValues.get("float"),
> > > "Expecting float result to be an instance of Float for locale: " +
> > locale);
> > > +        assertInstanceOf(Double.class, hResultValues.get("double"),
> > > "Expecting double result to be an instance of Double for locale: " +
> > > locale);
> > > +        assertInstanceOf(Date.class, hResultValues.get("date"),
> > > "Expecting date result to be an instance of Date for locale: " +
> locale);
> > >
> > >          for (final String key : hResultValues.keySet()) {
> > >              final Object value = hResultValues.get(key);
> > >
> > > -            assertNotNull(value, () -> "value
> > > ValidatorResults.getResultValueMap() should not be null for locale: " +
> > > locale);
> > > +            assertNotNull(value, "value
> > > ValidatorResults.getResultValueMap() should not be null for locale: " +
> > > locale);
> > >          }
> > >          return hResultValues;
> > >      }
> > > diff --git
> a/src/test/java/org/apache/commons/validator/MultipleTest.java
> > > b/src/test/java/org/apache/commons/validator/MultipleTest.java
> > > index 5e9cfa04..e20cedea 100644
> > > --- a/src/test/java/org/apache/commons/validator/MultipleTest.java
> > > +++ b/src/test/java/org/apache/commons/validator/MultipleTest.java
> > > @@ -83,12 +83,12 @@ public class MultipleTest extends
> AbstractCommonTest
> > {
> > >          final ValidatorResult lastNameResult =
> > > results.getValidatorResult("lastName");
> > >
> > >          assertNotNull(firstNameResult, "First Name ValidatorResult
> > should
> > > not be null.");
> > > -        assertTrue(firstNameResult.containsAction(ACTION), () ->
> "First
> > > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > > -        assertFalse(firstNameResult.isValid(ACTION), () -> "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > > +        assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > +        assertFalse(firstNameResult.isValid(ACTION), "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > >
> > >          assertNotNull(lastNameResult, "Last Name ValidatorResult
> should
> > > not be null.");
> > > -        assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> > > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > > -        assertFalse(lastNameResult.isValid(ACTION), () -> "Last Name
> > > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > > +        assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > +        assertFalse(lastNameResult.isValid(ACTION), "Last Name
> > > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > >          assertFalse(lastNameResult.containsAction("int"), "Last Name
> > > ValidatorResults should not contain the 'int' action.");
> > >      }
> > >
> > > @@ -262,8 +262,8 @@ public class MultipleTest extends
> AbstractCommonTest
> > {
> > >          final ValidatorResult lastNameResult =
> > > results.getValidatorResult("lastName");
> > >
> > >          assertNotNull(firstNameResult, "First Name ValidatorResult
> > should
> > > not be null.");
> > > -        assertTrue(firstNameResult.containsAction(ACTION), () ->
> "First
> > > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > > -        assertFalse(firstNameResult.isValid(ACTION), () -> "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > > +        assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > +        assertFalse(firstNameResult.isValid(ACTION), "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > >
> > >          assertNotNull(lastNameResult, "Last Name ValidatorResult
> should
> > > not be null.");
> > >          assertTrue(lastNameResult.containsAction("int"), "Last Name
> > > ValidatorResult should contain the 'int' action.");
> > > @@ -296,8 +296,8 @@ public class MultipleTest extends
> AbstractCommonTest
> > {
> > >          final ValidatorResult lastNameResult =
> > > results.getValidatorResult("lastName");
> > >
> > >          assertNotNull(firstNameResult, "First Name ValidatorResult
> > should
> > > not be null.");
> > > -        assertTrue(firstNameResult.containsAction(ACTION), () ->
> "First
> > > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > > -        assertTrue(firstNameResult.isValid(ACTION), () -> "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > > +        assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > +        assertTrue(firstNameResult.isValid(ACTION), "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > >
> > >          assertNotNull(lastNameResult, "Last Name ValidatorResult
> should
> > > not be null.");
> > >          assertTrue(lastNameResult.containsAction("int"), "Last Name
> > > ValidatorResult should contain the 'int' action.");
> > > @@ -330,8 +330,8 @@ public class MultipleTest extends
> AbstractCommonTest
> > {
> > >          final ValidatorResult lastNameResult =
> > > results.getValidatorResult("lastName");
> > >
> > >          assertNotNull(firstNameResult, "First Name ValidatorResult
> > should
> > > not be null.");
> > > -        assertTrue(firstNameResult.containsAction(ACTION), () ->
> "First
> > > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > > -        assertTrue(firstNameResult.isValid(ACTION), () -> "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > > +        assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > +        assertTrue(firstNameResult.isValid(ACTION), "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > >
> > >          assertNotNull(lastNameResult, "Last Name ValidatorResult
> should
> > > not be null.");
> > >          assertTrue(lastNameResult.containsAction("int"), "Last Name
> > > ValidatorResult should contain the 'int' action.");
> > > diff --git
> > a/src/test/java/org/apache/commons/validator/ParameterTest.java
> > > b/src/test/java/org/apache/commons/validator/ParameterTest.java
> > > index 629c06e7..c254d160 100644
> > > --- a/src/test/java/org/apache/commons/validator/ParameterTest.java
> > > +++ b/src/test/java/org/apache/commons/validator/ParameterTest.java
> > > @@ -43,8 +43,8 @@ public class ParameterTest extends
> AbstractCommonTest {
> > >
> > >      private void assertParameterValue(final Validator validator, final
> > > String name, final Class<?> type) {
> > >          final Object value = validator.getParameterValue(name);
> > > -        assertNotNull(value, () -> "Expected '" + type.getName() + "'
> > but
> > > was null");
> > > -        assertTrue(type.isInstance(value), () -> "Expected '" +
> > > type.getName() + "' but was '" + value.getClass().getName() + "'");
> > > +        assertNotNull(value, "Expected '" + type.getName() + "' but
> was
> > > null");
> > > +        assertTrue(type.isInstance(value), "Expected '" +
> type.getName()
> > > + "' but was '" + value.getClass().getName() + "'");
> > >      }
> > >
> > >      /**
> > > diff --git
> > > a/src/test/java/org/apache/commons/validator/RequiredIfTest.java
> > > b/src/test/java/org/apache/commons/validator/RequiredIfTest.java
> > > index 699db985..95324a37 100644
> > > --- a/src/test/java/org/apache/commons/validator/RequiredIfTest.java
> > > +++ b/src/test/java/org/apache/commons/validator/RequiredIfTest.java
> > > @@ -83,12 +83,12 @@ public class RequiredIfTest extends
> > AbstractCommonTest
> > > {
> > >          final ValidatorResult lastNameResult =
> > > results.getValidatorResult("lastName");
> > >
> > >          assertNotNull(firstNameResult, "First Name ValidatorResult
> > should
> > > not be null.");
> > > -        assertTrue(firstNameResult.containsAction(ACTION), () ->
> "First
> > > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > > -        assertTrue(firstNameResult.isValid(ACTION), () -> "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > > +        assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > +        assertTrue(firstNameResult.isValid(ACTION), "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > >
> > >          assertNotNull(lastNameResult, "Last Name ValidatorResult
> should
> > > not be null.");
> > > -        assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> > > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > > -        assertTrue(lastNameResult.isValid(ACTION), () -> "Last Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > > +        assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > +        assertTrue(lastNameResult.isValid(ACTION), "Last Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > >      }
> > >
> > >      /**
> > > @@ -117,12 +117,12 @@ public class RequiredIfTest extends
> > > AbstractCommonTest {
> > >          final ValidatorResult lastNameResult =
> > > results.getValidatorResult("lastName");
> > >
> > >          assertNotNull(firstNameResult, "First Name ValidatorResult
> > should
> > > not be null.");
> > > -        assertTrue(firstNameResult.containsAction(ACTION), () ->
> "First
> > > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > > -        assertTrue(firstNameResult.isValid(ACTION), () -> "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > > +        assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > +        assertTrue(firstNameResult.isValid(ACTION), "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > >
> > >          assertNotNull(lastNameResult, "Last Name ValidatorResult
> should
> > > not be null.");
> > > -        assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> > > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > > -        assertTrue(lastNameResult.isValid(ACTION), () -> "Last Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > > +        assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > +        assertTrue(lastNameResult.isValid(ACTION), "Last Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > >      }
> > >
> > >      /**
> > > @@ -151,12 +151,12 @@ public class RequiredIfTest extends
> > > AbstractCommonTest {
> > >          final ValidatorResult lastNameResult =
> > > results.getValidatorResult("lastName");
> > >
> > >          assertNotNull(firstNameResult, "First Name ValidatorResult
> > should
> > > not be null.");
> > > -        assertTrue(firstNameResult.containsAction(ACTION), () ->
> "First
> > > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > > -        assertFalse(firstNameResult.isValid(ACTION), () -> "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > > +        assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > +        assertFalse(firstNameResult.isValid(ACTION), "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > >
> > >          assertNotNull(lastNameResult, "Last Name ValidatorResult
> should
> > > not be null.");
> > > -        assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> > > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > > -        assertTrue(lastNameResult.isValid(ACTION), () -> "Last Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > > +        assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > +        assertTrue(lastNameResult.isValid(ACTION), "Last Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > >      }
> > >
> > >      /**
> > > @@ -189,8 +189,8 @@ public class RequiredIfTest extends
> > AbstractCommonTest
> > > {
> > >          assertTrue(firstNameResult.isValid(ACTION), "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > >
> > >          assertNotNull(lastNameResult, "Last Name ValidatorResult
> should
> > > not be null.");
> > > -        assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> > > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > > -        assertTrue(lastNameResult.isValid(ACTION), () -> "Last Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > > +        assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > +        assertTrue(lastNameResult.isValid(ACTION), "Last Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > >
> > >      }
> > >
> > > @@ -220,12 +220,12 @@ public class RequiredIfTest extends
> > > AbstractCommonTest {
> > >          final ValidatorResult lastNameResult =
> > > results.getValidatorResult("lastName");
> > >
> > >          assertNotNull(firstNameResult, "First Name ValidatorResult
> > should
> > > not be null.");
> > > -        assertTrue(firstNameResult.containsAction(ACTION), () ->
> "First
> > > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > > -        assertTrue(firstNameResult.isValid(ACTION), () -> "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > > +        assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > +        assertTrue(firstNameResult.isValid(ACTION), "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > >
> > >          assertNotNull(lastNameResult, "Last Name ValidatorResult
> should
> > > not be null.");
> > > -        assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> > > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > > -        assertFalse(lastNameResult.isValid(ACTION), () -> "Last Name
> > > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > > +        assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > +        assertFalse(lastNameResult.isValid(ACTION), "Last Name
> > > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > >      }
> > >
> > >  }
> > > diff --git
> > > a/src/test/java/org/apache/commons/validator/RequiredNameTest.java
> > > b/src/test/java/org/apache/commons/validator/RequiredNameTest.java
> > > index 6578e360..05689158 100644
> > > --- a/src/test/java/org/apache/commons/validator/RequiredNameTest.java
> > > +++ b/src/test/java/org/apache/commons/validator/RequiredNameTest.java
> > > @@ -83,8 +83,8 @@ public class RequiredNameTest extends
> > AbstractCommonTest
> > > {
> > >          final ValidatorResult lastNameResult =
> > > results.getValidatorResult("lastName");
> > >
> > >          assertNotNull(firstNameResult, "First Name ValidatorResult
> > should
> > > not be null.");
> > > -        assertTrue(firstNameResult.containsAction(ACTION), () ->
> "First
> > > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > > -        assertFalse(firstNameResult.isValid(ACTION), () -> "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > > +        assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > +        assertFalse(firstNameResult.isValid(ACTION), "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > >
> > >          assertNotNull(lastNameResult, "First Name ValidatorResult
> should
> > > not be null.");
> > >          assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > @@ -116,12 +116,12 @@ public class RequiredNameTest extends
> > > AbstractCommonTest {
> > >          final ValidatorResult lastNameResult =
> > > results.getValidatorResult("lastName");
> > >
> > >          assertNotNull(firstNameResult, "First Name ValidatorResult
> > should
> > > not be null.");
> > > -        assertTrue(firstNameResult.containsAction(ACTION), () ->
> "First
> > > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > > -        assertTrue(firstNameResult.isValid(ACTION), () -> "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > > +        assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > +        assertTrue(firstNameResult.isValid(ACTION), "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > >
> > >          assertNotNull(lastNameResult, "First Name ValidatorResult
> should
> > > not be null.");
> > > -        assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> > > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > > -        assertFalse(lastNameResult.isValid(ACTION), () -> "Last Name
> > > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > > +        assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > +        assertFalse(lastNameResult.isValid(ACTION), "Last Name
> > > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > >      }
> > >
> > >      /**
> > > @@ -149,12 +149,12 @@ public class RequiredNameTest extends
> > > AbstractCommonTest {
> > >          final ValidatorResult lastNameResult =
> > > results.getValidatorResult("lastName");
> > >
> > >          assertNotNull(firstNameResult, "First Name ValidatorResult
> > should
> > > not be null.");
> > > -        assertTrue(firstNameResult.containsAction(ACTION), () ->
> "First
> > > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > > -        assertFalse(firstNameResult.isValid(ACTION), () -> "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > > +        assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > +        assertFalse(firstNameResult.isValid(ACTION), "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > >
> > >          assertNotNull(lastNameResult, "First Name ValidatorResult
> should
> > > not be null.");
> > > -        assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> > > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > > -        assertFalse(lastNameResult.isValid(ACTION), () -> "Last Name
> > > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > > +        assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > +        assertFalse(lastNameResult.isValid(ACTION), "Last Name
> > > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > >      }
> > >
> > >      /**
> > > @@ -182,12 +182,12 @@ public class RequiredNameTest extends
> > > AbstractCommonTest {
> > >          final ValidatorResult lastNameResult =
> > > results.getValidatorResult("lastName");
> > >
> > >          assertNotNull(firstNameResult, "First Name ValidatorResult
> > should
> > > not be null.");
> > > -        assertTrue(firstNameResult.containsAction(ACTION), () ->
> "First
> > > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > > -        assertFalse(firstNameResult.isValid(ACTION), () -> "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > > +        assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > +        assertFalse(firstNameResult.isValid(ACTION), "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > >
> > >          assertNotNull(lastNameResult, "First Name ValidatorResult
> should
> > > not be null.");
> > > -        assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> > > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > > -        assertTrue(lastNameResult.isValid(ACTION), () -> "Last Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > > +        assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > +        assertTrue(lastNameResult.isValid(ACTION), "Last Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > >
> > >      }
> > >
> > > @@ -220,8 +220,8 @@ public class RequiredNameTest extends
> > > AbstractCommonTest {
> > >          assertFalse(firstNameResult.isValid(ACTION), "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > >
> > >          assertNotNull(lastNameResult, "First Name ValidatorResult
> should
> > > not be null.");
> > > -        assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> > > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > > -        assertFalse(lastNameResult.isValid(ACTION), () -> "Last Name
> > > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > > +        assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > +        assertFalse(lastNameResult.isValid(ACTION), "Last Name
> > > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > >      }
> > >
> > >      /**
> > > @@ -250,12 +250,12 @@ public class RequiredNameTest extends
> > > AbstractCommonTest {
> > >          final ValidatorResult lastNameResult =
> > > results.getValidatorResult("lastName");
> > >
> > >          assertNotNull(firstNameResult, "First Name ValidatorResult
> > should
> > > not be null.");
> > > -        assertTrue(firstNameResult.containsAction(ACTION), () ->
> "First
> > > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > > -        assertTrue(firstNameResult.isValid(ACTION), () -> "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > > +        assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > +        assertTrue(firstNameResult.isValid(ACTION), "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > >
> > >          assertNotNull(lastNameResult, "First Name ValidatorResult
> should
> > > not be null.");
> > > -        assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> > > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > > -        assertTrue(lastNameResult.isValid(ACTION), () -> "Last Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > > +        assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > +        assertTrue(lastNameResult.isValid(ACTION), "Last Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > >      }
> > >
> > >  }
> > > \ No newline at end of file
> > > diff --git
> > > a/src/test/java/org/apache/commons/validator/ValidatorResultsTest.java
> > > b/src/test/java/org/apache/commons/validator/ValidatorResultsTest.java
> > > index b956d071..54a8f5fb 100644
> > > ---
> > a/src/test/java/org/apache/commons/validator/ValidatorResultsTest.java
> > > +++
> > b/src/test/java/org/apache/commons/validator/ValidatorResultsTest.java
> > > @@ -47,8 +47,8 @@ public class ValidatorResultsTest extends
> > > AbstractCommonTest {
> > >       */
> > >      private void checkNotRun(final ValidatorResults results, final
> > String
> > > field, final String action) {
> > >          final ValidatorResult result =
> > results.getValidatorResult(field);
> > > -        assertNotNull(result, () -> field + " result");
> > > -        assertFalse(result.containsAction(action), () -> field + "[" +
> > > action + "] run");
> > > +        assertNotNull(result, field + " result");
> > > +        assertFalse(result.containsAction(action), field + "[" +
> action
> > +
> > > "] run");
> > >          // System.out.println(field + "[" + action + "] not run");
> > >      }
> > >
> > > @@ -58,9 +58,9 @@ public class ValidatorResultsTest extends
> > > AbstractCommonTest {
> > >      private void checkValidatorResult(final ValidatorResults results,
> > > final String field, final String action, final boolean expected) {
> > >          final ValidatorResult result =
> > results.getValidatorResult(field);
> > >          // System.out.println(field + "[" + action + "]=" +
> > > result.isValid(action));
> > > -        assertNotNull(result, () -> field + " result");
> > > -        assertTrue(result.containsAction(action), () -> field + "[" +
> > > action + "] not run");
> > > -        assertEquals(expected, result.isValid(action), () -> field +
> "["
> > > + action + "] result");
> > > +        assertNotNull(result, field + " result");
> > > +        assertTrue(result.containsAction(action), field + "[" +
> action +
> > > "] not run");
> > > +        assertEquals(expected, result.isValid(action), field + "[" +
> > > action + "] result");
> > >      }
> > >
> > >      /**
> > > diff --git
> > >
> >
> a/src/test/java/org/apache/commons/validator/routines/AbstractNumberValidatorTest.java
> > >
> >
> b/src/test/java/org/apache/commons/validator/routines/AbstractNumberValidatorTest.java
> > > index a9847cf8..66849f25 100644
> > > ---
> > >
> >
> a/src/test/java/org/apache/commons/validator/routines/AbstractNumberValidatorTest.java
> > > +++
> > >
> >
> b/src/test/java/org/apache/commons/validator/routines/AbstractNumberValidatorTest.java
> > > @@ -107,10 +107,10 @@ public abstract class
> AbstractNumberValidatorTest {
> > >      public void testInvalidNotStrict() {
> > >          for (int i = 0; i < invalid.length; i++) {
> > >              final String text = "idx=[" + i + "] value=[" +
> invalid[i] +
> > > "]";
> > > -            assertNull(validator.parse(invalid[i], null, Locale.US),
> ()
> > > -> "(A) " + text);
> > > -            assertFalse(validator.isValid(invalid[i], null,
> Locale.US),
> > > () -> "(B) " + text);
> > > -            assertNull(validator.parse(invalid[i], testPattern, null),
> > ()
> > > -> "(C) " + text);
> > > -            assertFalse(validator.isValid(invalid[i], testPattern,
> > null),
> > > () -> "(D) " + text);
> > > +            assertNull(validator.parse(invalid[i], null, Locale.US),
> > "(A)
> > > " + text);
> > > +            assertFalse(validator.isValid(invalid[i], null,
> Locale.US),
> > > "(B) " + text);
> > > +            assertNull(validator.parse(invalid[i], testPattern, null),
> > > "(C) " + text);
> > > +            assertFalse(validator.isValid(invalid[i], testPattern,
> > null),
> > > "(D) " + text);
> > >          }
> > >      }
> > >
> > > @@ -121,10 +121,10 @@ public abstract class
> AbstractNumberValidatorTest {
> > >      public void testInvalidStrict() {
> > >          for (int i = 0; i < invalidStrict.length; i++) {
> > >              final String text = "idx=[" + i + "] value=[" +
> > > invalidStrict[i] + "]";
> > > -            assertNull(strictValidator.parse(invalidStrict[i], null,
> > > Locale.US), () -> "(A) " + text);
> > > -            assertFalse(strictValidator.isValid(invalidStrict[i],
> null,
> > > Locale.US), () -> "(B) " + text);
> > > -            assertNull(strictValidator.parse(invalidStrict[i],
> > > testPattern, null), () -> "(C) " + text);
> > > -            assertFalse(strictValidator.isValid(invalidStrict[i],
> > > testPattern, null), () -> "(D) " + text);
> > > +            assertNull(strictValidator.parse(invalidStrict[i], null,
> > > Locale.US), "(A) " + text);
> > > +            assertFalse(strictValidator.isValid(invalidStrict[i],
> null,
> > > Locale.US), "(B) " + text);
> > > +            assertNull(strictValidator.parse(invalidStrict[i],
> > > testPattern, null), "(C) " + text);
> > > +            assertFalse(strictValidator.isValid(invalidStrict[i],
> > > testPattern, null), "(D) " + text);
> > >          }
> > >      }
> > >
> > > diff --git
> > >
> >
> a/src/test/java/org/apache/commons/validator/routines/InetAddressValidatorTest.java
> > >
> >
> b/src/test/java/org/apache/commons/validator/routines/InetAddressValidatorTest.java
> > > index 49971f2e..8566dde0 100644
> > > ---
> > >
> >
> a/src/test/java/org/apache/commons/validator/routines/InetAddressValidatorTest.java
> > > +++
> > >
> >
> b/src/test/java/org/apache/commons/validator/routines/InetAddressValidatorTest.java
> > > @@ -672,10 +672,10 @@ public class InetAddressValidatorTest {
> > >                  "2001:0000:1234:0000:0000:C1C0:ABCD:0876%abc%defgh",
> //
> > > '%' in node id
> > >          };
> > >          for (final String item : valid) {
> > > -            assertTrue(validator.isValid(item), () ->
> String.format("%s
> > > should be valid", item));
> > > +            assertTrue(validator.isValid(item), String.format("%s
> should
> > > be valid", item));
> > >          }
> > >          for (final String item : invalid) {
> > > -            assertFalse(validator.isValid(item), () ->
> String.format("%s
> > > should be invalid", item));
> > > +            assertFalse(validator.isValid(item), String.format("%s
> > should
> > > be invalid", item));
> > >          }
> > >      }
> > >  }
> > > diff --git
> > >
> >
> a/src/test/java/org/apache/commons/validator/routines/TimeValidatorTest.java
> > >
> >
> b/src/test/java/org/apache/commons/validator/routines/TimeValidatorTest.java
> > > index 72747901..bbeca924 100644
> > > ---
> > >
> >
> a/src/test/java/org/apache/commons/validator/routines/TimeValidatorTest.java
> > > +++
> > >
> >
> b/src/test/java/org/apache/commons/validator/routines/TimeValidatorTest.java
> > > @@ -198,8 +198,8 @@ public class TimeValidatorTest {
> > >          for (int i = 0; i < localeInvalid.length; i++) {
> > >              final String text = i + " value=[" + localeInvalid[i] + "]
> > > passed ";
> > >              final Object date = validator.validate(localeInvalid[i],
> > > Locale.US);
> > > -            assertNull(date, () -> "validate() " + text + date);
> > > -            assertFalse(validator.isValid(localeInvalid[i],
> Locale.UK),
> > > () -> "isValid() " + text);
> > > +            assertNull(date, "validate() " + text + date);
> > > +            assertFalse(validator.isValid(localeInvalid[i],
> Locale.UK),
> > > "isValid() " + text);
> > >          }
> > >      }
> > >
> > > @@ -211,10 +211,10 @@ public class TimeValidatorTest {
> > >          for (int i = 0; i < localeValid.length; i++) {
> > >              final String text = i + " value=[" + localeValid[i] + "]
> > > failed ";
> > >              final Calendar calendar =
> validator.validate(localeValid[i],
> > > Locale.UK);
> > > -            assertNotNull(calendar, () -> "validate() " + text);
> > > +            assertNotNull(calendar, "validate() " + text);
> > >              final Date date = calendar.getTime();
> > > -            assertTrue(validator.isValid(localeValid[i], Locale.UK),
> ()
> > > -> "isValid() " + text);
> > > -            assertEquals(localeExpect[i], date, () -> "compare " +
> > text);
> > > +            assertTrue(validator.isValid(localeValid[i], Locale.UK),
> > > "isValid() " + text);
> > > +            assertEquals(localeExpect[i], date, "compare " + text);
> > >          }
> > >      }
> > >
> > > @@ -226,8 +226,8 @@ public class TimeValidatorTest {
> > >          for (int i = 0; i < patternInvalid.length; i++) {
> > >              final String text = i + " value=[" + patternInvalid[i] +
> "]
> > > passed ";
> > >              final Object date = validator.validate(patternInvalid[i],
> > > "HH-mm-ss");
> > > -            assertNull(date, () -> "validate() " + text + date);
> > > -            assertFalse(validator.isValid(patternInvalid[i],
> > "HH-mm-ss"),
> > > () -> "isValid() " + text);
> > > +            assertNull(date, "validate() " + text + date);
> > > +            assertFalse(validator.isValid(patternInvalid[i],
> > "HH-mm-ss"),
> > > "isValid() " + text);
> > >          }
> > >      }
> > >
> > > @@ -239,10 +239,10 @@ public class TimeValidatorTest {
> > >          for (int i = 0; i < patternValid.length; i++) {
> > >              final String text = i + " value=[" + patternValid[i] + "]
> > > failed ";
> > >              final Calendar calendar =
> > validator.validate(patternValid[i],
> > > "HH-mm-ss");
> > > -            assertNotNull(calendar, () -> "validateObj() " + text);
> > > +            assertNotNull(calendar, "validateObj() " + text);
> > >              final Date date = calendar.getTime();
> > > -            assertTrue(validator.isValid(patternValid[i], "HH-mm-ss"),
> > ()
> > > -> "isValid() " + text);
> > > -            assertEquals(patternExpect[i], date, () -> "compare " +
> > text);
> > > +            assertTrue(validator.isValid(patternValid[i], "HH-mm-ss"),
> > > "isValid() " + text);
> > > +            assertEquals(patternExpect[i], date, "compare " + text);
> > >          }
> > >      }
> > >
> > > diff --git
> > >
> >
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/CUSIPCheckDigitTest.java
> > >
> >
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/CUSIPCheckDigitTest.java
> > > index 69136900..fb5df1f2 100644
> > > ---
> > >
> >
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/CUSIPCheckDigitTest.java
> > > +++
> > >
> >
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/CUSIPCheckDigitTest.java
> > > @@ -44,14 +44,14 @@ public class CUSIPCheckDigitTest extends
> > > AbstractCheckDigitTest {
> > >      @Test
> > >      public void testValidator336InvalidCheckDigits() {
> > >          for (final String invalidCheckDigit : INVALID_CHECK_DIGITS) {
> > > -            assertFalse(routine.isValid(invalidCheckDigit), () ->
> > "Should
> > > fail: " + invalidCheckDigit);
> > > +            assertFalse(routine.isValid(invalidCheckDigit), "Should
> > fail:
> > > " + invalidCheckDigit);
> > >          }
> > >      }
> > >
> > >      @Test
> > >      public void testValidator336ValidCheckDigits() {
> > >          for (final String validCheckDigit : VALID_CHECK_DIGITS) {
> > > -            assertTrue(routine.isValid(validCheckDigit), () -> "Should
> > > fail: " + validCheckDigit);
> > > +            assertTrue(routine.isValid(validCheckDigit), "Should
> fail: "
> > > + validCheckDigit);
> > >          }
> > >      }
> > >  }
> > > diff --git
> > >
> >
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/ISINCheckDigitTest.java
> > >
> >
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/ISINCheckDigitTest.java
> > > index f84ec5ce..62b9cb25 100644
> > > ---
> > >
> >
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/ISINCheckDigitTest.java
> > > +++
> > >
> >
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/ISINCheckDigitTest.java
> > > @@ -54,7 +54,7 @@ public class ISINCheckDigitTest extends
> > > AbstractCheckDigitTest {
> > >      @Test
> > >      public void testValidator345() {
> > >          for (final String invalidCheckDigit : INVALID_CHECK_DIGITS) {
> > > -            assertFalse(routine.isValid(invalidCheckDigit), () ->
> > "Should
> > > fail: " + invalidCheckDigit);
> > > +            assertFalse(routine.isValid(invalidCheckDigit), "Should
> > fail:
> > > " + invalidCheckDigit);
> > >          }
> > >      }
> > >  }
> > > diff --git
> > >
> >
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenCUSIPCheckDigitTest.java
> > >
> >
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenCUSIPCheckDigitTest.java
> > > index 1217ef90..8dd23b9a 100644
> > > ---
> > >
> >
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenCUSIPCheckDigitTest.java
> > > +++
> > >
> >
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenCUSIPCheckDigitTest.java
> > > @@ -44,14 +44,14 @@ public class ModulusTenCUSIPCheckDigitTest extends
> > > AbstractCheckDigitTest {
> > >      @Test
> > >      public void testValidator336InvalidCheckDigits() {
> > >          for (final String invalidCheckDigit : INVALID_CHECK_DIGITS) {
> > > -            assertFalse(routine.isValid(invalidCheckDigit), () ->
> > "Should
> > > fail: " + invalidCheckDigit);
> > > +            assertFalse(routine.isValid(invalidCheckDigit), "Should
> > fail:
> > > " + invalidCheckDigit);
> > >          }
> > >      }
> > >
> > >      @Test
> > >      public void testValidator336ValidCheckDigits() {
> > >          for (final String validCheckDigit : VALID_CHECK_DIGITS) {
> > > -            assertTrue(routine.isValid(validCheckDigit), () -> "Should
> > > fail: " + validCheckDigit);
> > > +            assertTrue(routine.isValid(validCheckDigit), "Should
> fail: "
> > > + validCheckDigit);
> > >          }
> > >      }
> > >  }
> > > diff --git
> > >
> >
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenSedolCheckDigitTest.java
> > >
> >
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenSedolCheckDigitTest.java
> > > index 90d03eb0..12458a83 100644
> > > ---
> > >
> >
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenSedolCheckDigitTest.java
> > > +++
> > >
> >
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenSedolCheckDigitTest.java
> > > @@ -47,7 +47,7 @@ public class ModulusTenSedolCheckDigitTest extends
> > > AbstractCheckDigitTest {
> > >      @Test
> > >      public void testValidator346() {
> > >          for (final String invalidCheckDigit : INVALID_CHECK_DIGITS) {
> > > -            assertFalse(routine.isValid(invalidCheckDigit), () ->
> > "Should
> > > fail: " + invalidCheckDigit);
> > > +            assertFalse(routine.isValid(invalidCheckDigit), "Should
> > fail:
> > > " + invalidCheckDigit);
> > >          }
> > >      }
> > >
> > > diff --git
> > >
> >
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/SedolCheckDigitTest.java
> > >
> >
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/SedolCheckDigitTest.java
> > > index 47017a36..43712ed6 100644
> > > ---
> > >
> >
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/SedolCheckDigitTest.java
> > > +++
> > >
> >
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/SedolCheckDigitTest.java
> > > @@ -47,7 +47,7 @@ public class SedolCheckDigitTest extends
> > > AbstractCheckDigitTest {
> > >      @Test
> > >      public void testValidator346() {
> > >          for (final String invalidCheckDigit : INVALID_CHECK_DIGITS) {
> > > -            assertFalse(routine.isValid(invalidCheckDigit), () ->
> > "Should
> > > fail: " + invalidCheckDigit);
> > > +            assertFalse(routine.isValid(invalidCheckDigit), "Should
> > fail:
> > > " + invalidCheckDigit);
> > >          }
> > >      }
> > >
> > >
> > >
> >
>

Re: (commons-validator) 08/11: Removed unnecessary lambdas in the tests

Posted by Mike Drob <md...@mdrob.com>.
In practical terms, what is the time cost? I imagined the lambda APIs
existing to avoid heavy processing, like printing out the state of a
database or other large complex graph. StringBuilder doesn't seem like a
huge issue and the readability is nice. Have we spent more time writing
these emails than would be saved over the lifetime of every developer who
ever runs the tests?

On Mon, Nov 18, 2024 at 10:12 AM Gary Gregory <ga...@gmail.com>
wrote:

> -1 you are undoing the port to JUnit 5. This commit is a classic JUnit
> mistake imo, please stop, these JUnit APIs exist for a reason: The lambdas
> avoid construction of failure message strings, which, as a pattern, add
> processing, can have side effects, and always creates more garbage. This is
> bad since in general toString() methods can do anything. String.format() is
> a great way to create nice messages in a compact way but is not free.
>
> Gary
>
> On Mon, Nov 18, 2024, 7:53 AM <eb...@apache.org> wrote:
>
> > This is an automated email from the ASF dual-hosted git repository.
> >
> > ebourg pushed a commit to branch master
> > in repository https://gitbox.apache.org/repos/asf/commons-validator.git
> >
> > commit dfd4a9e426ea6d0901af757ce333d2577772b2b1
> > Author: Emmanuel Bourg <eb...@apache.org>
> > AuthorDate: Mon Nov 18 11:22:35 2024 +0100
> >
> >     Removed unnecessary lambdas in the tests
> > ---
> >  .../commons/validator/AbstractNumberTest.java      |  6 ++--
> >  .../org/apache/commons/validator/DateTest.java     |  6 ++--
> >  .../org/apache/commons/validator/EmailTest.java    |  6 ++--
> >  .../validator/GenericTypeValidatorTest.java        | 16 ++++-----
> >  .../org/apache/commons/validator/MultipleTest.java | 20 +++++------
> >  .../apache/commons/validator/ParameterTest.java    |  4 +--
> >  .../apache/commons/validator/RequiredIfTest.java   | 36
> > +++++++++----------
> >  .../apache/commons/validator/RequiredNameTest.java | 40
> > +++++++++++-----------
> >  .../commons/validator/ValidatorResultsTest.java    | 10 +++---
> >  .../routines/AbstractNumberValidatorTest.java      | 16 ++++-----
> >  .../routines/InetAddressValidatorTest.java         |  4 +--
> >  .../validator/routines/TimeValidatorTest.java      | 20 +++++------
> >  .../routines/checkdigit/CUSIPCheckDigitTest.java   |  4 +--
> >  .../routines/checkdigit/ISINCheckDigitTest.java    |  2 +-
> >  .../checkdigit/ModulusTenCUSIPCheckDigitTest.java  |  4 +--
> >  .../checkdigit/ModulusTenSedolCheckDigitTest.java  |  2 +-
> >  .../routines/checkdigit/SedolCheckDigitTest.java   |  2 +-
> >  17 files changed, 99 insertions(+), 99 deletions(-)
> >
> > diff --git
> > a/src/test/java/org/apache/commons/validator/AbstractNumberTest.java
> > b/src/test/java/org/apache/commons/validator/AbstractNumberTest.java
> > index b245c536..6652428e 100644
> > --- a/src/test/java/org/apache/commons/validator/AbstractNumberTest.java
> > +++ b/src/test/java/org/apache/commons/validator/AbstractNumberTest.java
> > @@ -100,10 +100,10 @@ public abstract class AbstractNumberTest extends
> > AbstractCommonTest {
> >
> >          final ValidatorResult result =
> > results.getValidatorResult("value");
> >
> > -        assertNotNull(result, () -> action + " value ValidatorResult
> > should not be null.");
> > -        assertTrue(result.containsAction(action), () -> action + " value
> > ValidatorResult should contain the '" + action + "' action.");
> > +        assertNotNull(result, action + " value ValidatorResult should
> not
> > be null.");
> > +        assertTrue(result.containsAction(action), action + " value
> > ValidatorResult should contain the '" + action + "' action.");
> >          assertTrue(passed ? result.isValid(action) :
> > !result.isValid(action),
> > -                () -> action + " value ValidatorResult for the '" +
> > action + "' action should have " + (passed ? "passed" : "failed") + ".");
> > +                action + " value ValidatorResult for the '" + action +
> "'
> > action should have " + (passed ? "passed" : "failed") + ".");
> >      }
> >
> >  }
> > diff --git a/src/test/java/org/apache/commons/validator/DateTest.java
> > b/src/test/java/org/apache/commons/validator/DateTest.java
> > index c7db41d4..a42d6b4c 100644
> > --- a/src/test/java/org/apache/commons/validator/DateTest.java
> > +++ b/src/test/java/org/apache/commons/validator/DateTest.java
> > @@ -98,10 +98,10 @@ public class DateTest extends AbstractCommonTest {
> >
> >          final ValidatorResult result =
> > results.getValidatorResult("value");
> >
> > -        assertNotNull(result, () -> ACTION + " value ValidatorResult
> > should not be null.");
> > -        assertTrue(result.containsAction(ACTION), () -> ACTION + " value
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > +        assertNotNull(result, ACTION + " value ValidatorResult should
> not
> > be null.");
> > +        assertTrue(result.containsAction(ACTION), ACTION + " value
> > ValidatorResult should contain the '" + ACTION + "' action.");
> >          assertTrue(passed ? result.isValid(ACTION) :
> > !result.isValid(ACTION),
> > -                () -> ACTION + " value ValidatorResult for the '" +
> > ACTION + "' action should have " + (passed ? "passed" : "failed") + ".");
> > +                ACTION + " value ValidatorResult for the '" + ACTION +
> "'
> > action should have " + (passed ? "passed" : "failed") + ".");
> >      }
> >
> >  }
> > diff --git a/src/test/java/org/apache/commons/validator/EmailTest.java
> > b/src/test/java/org/apache/commons/validator/EmailTest.java
> > index 39a78230..92ae84ce 100644
> > --- a/src/test/java/org/apache/commons/validator/EmailTest.java
> > +++ b/src/test/java/org/apache/commons/validator/EmailTest.java
> > @@ -406,9 +406,9 @@ public class EmailTest extends AbstractCommonTest {
> >
> >          final ValidatorResult result =
> > results.getValidatorResult("value");
> >
> > -        assertNotNull(result, () -> ACTION + " value ValidatorResult
> > should not be null.");
> > -        assertTrue(result.containsAction(ACTION), () -> "Value " +
> > info.getValue() + " ValidatorResult should contain the '" + ACTION + "'
> > action.");
> > +        assertNotNull(result, ACTION + " value ValidatorResult should
> not
> > be null.");
> > +        assertTrue(result.containsAction(ACTION), "Value " +
> > info.getValue() + " ValidatorResult should contain the '" + ACTION + "'
> > action.");
> >          assertTrue(passed ? result.isValid(ACTION) :
> > !result.isValid(ACTION),
> > -                () -> "Value " + info.getValue() + "ValidatorResult for
> > the '" + ACTION + "' action should have " + (passed ? "passed" :
> "failed")
> > + ".");
> > +                "Value " + info.getValue() + "ValidatorResult for the '"
> > + ACTION + "' action should have " + (passed ? "passed" : "failed") +
> ".");
> >      }
> >  }
> > diff --git
> >
> a/src/test/java/org/apache/commons/validator/GenericTypeValidatorTest.java
> >
> b/src/test/java/org/apache/commons/validator/GenericTypeValidatorTest.java
> > index 104bfb4f..dd70d65f 100644
> > ---
> >
> a/src/test/java/org/apache/commons/validator/GenericTypeValidatorTest.java
> > +++
> >
> b/src/test/java/org/apache/commons/validator/GenericTypeValidatorTest.java
> > @@ -69,18 +69,18 @@ public class GenericTypeValidatorTest extends
> > AbstractCommonTest {
> >
> >          final Map<String, ?> hResultValues =
> results.getResultValueMap();
> >
> > -        assertInstanceOf(Byte.class, hResultValues.get("byte"), () ->
> > "Expecting byte result to be an instance of Byte for locale: " + locale);
> > -        assertInstanceOf(Short.class, hResultValues.get("short"), () ->
> > "Expecting short result to be an instance of Short for locale: " +
> locale);
> > -        assertInstanceOf(Integer.class, hResultValues.get("integer"), ()
> > -> "Expecting integer result to be an instance of Integer for locale: " +
> > locale);
> > -        assertInstanceOf(Long.class, hResultValues.get("long"), () ->
> > "Expecting long result to be an instance of Long for locale: " + locale);
> > -        assertInstanceOf(Float.class, hResultValues.get("float"), () ->
> > "Expecting float result to be an instance of Float for locale: " +
> locale);
> > -        assertInstanceOf(Double.class, hResultValues.get("double"), ()
> ->
> > "Expecting double result to be an instance of Double for locale: " +
> > locale);
> > -        assertInstanceOf(Date.class, hResultValues.get("date"), () ->
> > "Expecting date result to be an instance of Date for locale: " + locale);
> > +        assertInstanceOf(Byte.class, hResultValues.get("byte"),
> > "Expecting byte result to be an instance of Byte for locale: " + locale);
> > +        assertInstanceOf(Short.class, hResultValues.get("short"),
> > "Expecting short result to be an instance of Short for locale: " +
> locale);
> > +        assertInstanceOf(Integer.class, hResultValues.get("integer"),
> > "Expecting integer result to be an instance of Integer for locale: " +
> > locale);
> > +        assertInstanceOf(Long.class, hResultValues.get("long"),
> > "Expecting long result to be an instance of Long for locale: " + locale);
> > +        assertInstanceOf(Float.class, hResultValues.get("float"),
> > "Expecting float result to be an instance of Float for locale: " +
> locale);
> > +        assertInstanceOf(Double.class, hResultValues.get("double"),
> > "Expecting double result to be an instance of Double for locale: " +
> > locale);
> > +        assertInstanceOf(Date.class, hResultValues.get("date"),
> > "Expecting date result to be an instance of Date for locale: " + locale);
> >
> >          for (final String key : hResultValues.keySet()) {
> >              final Object value = hResultValues.get(key);
> >
> > -            assertNotNull(value, () -> "value
> > ValidatorResults.getResultValueMap() should not be null for locale: " +
> > locale);
> > +            assertNotNull(value, "value
> > ValidatorResults.getResultValueMap() should not be null for locale: " +
> > locale);
> >          }
> >          return hResultValues;
> >      }
> > diff --git a/src/test/java/org/apache/commons/validator/MultipleTest.java
> > b/src/test/java/org/apache/commons/validator/MultipleTest.java
> > index 5e9cfa04..e20cedea 100644
> > --- a/src/test/java/org/apache/commons/validator/MultipleTest.java
> > +++ b/src/test/java/org/apache/commons/validator/MultipleTest.java
> > @@ -83,12 +83,12 @@ public class MultipleTest extends AbstractCommonTest
> {
> >          final ValidatorResult lastNameResult =
> > results.getValidatorResult("lastName");
> >
> >          assertNotNull(firstNameResult, "First Name ValidatorResult
> should
> > not be null.");
> > -        assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > -        assertFalse(firstNameResult.isValid(ACTION), () -> "First Name
> > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > +        assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > +        assertFalse(firstNameResult.isValid(ACTION), "First Name
> > ValidatorResult for the '" + ACTION + "' action should have failed.");
> >
> >          assertNotNull(lastNameResult, "Last Name ValidatorResult should
> > not be null.");
> > -        assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > -        assertFalse(lastNameResult.isValid(ACTION), () -> "Last Name
> > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > +        assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > +        assertFalse(lastNameResult.isValid(ACTION), "Last Name
> > ValidatorResult for the '" + ACTION + "' action should have failed.");
> >          assertFalse(lastNameResult.containsAction("int"), "Last Name
> > ValidatorResults should not contain the 'int' action.");
> >      }
> >
> > @@ -262,8 +262,8 @@ public class MultipleTest extends AbstractCommonTest
> {
> >          final ValidatorResult lastNameResult =
> > results.getValidatorResult("lastName");
> >
> >          assertNotNull(firstNameResult, "First Name ValidatorResult
> should
> > not be null.");
> > -        assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > -        assertFalse(firstNameResult.isValid(ACTION), () -> "First Name
> > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > +        assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > +        assertFalse(firstNameResult.isValid(ACTION), "First Name
> > ValidatorResult for the '" + ACTION + "' action should have failed.");
> >
> >          assertNotNull(lastNameResult, "Last Name ValidatorResult should
> > not be null.");
> >          assertTrue(lastNameResult.containsAction("int"), "Last Name
> > ValidatorResult should contain the 'int' action.");
> > @@ -296,8 +296,8 @@ public class MultipleTest extends AbstractCommonTest
> {
> >          final ValidatorResult lastNameResult =
> > results.getValidatorResult("lastName");
> >
> >          assertNotNull(firstNameResult, "First Name ValidatorResult
> should
> > not be null.");
> > -        assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > -        assertTrue(firstNameResult.isValid(ACTION), () -> "First Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > +        assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > +        assertTrue(firstNameResult.isValid(ACTION), "First Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> >
> >          assertNotNull(lastNameResult, "Last Name ValidatorResult should
> > not be null.");
> >          assertTrue(lastNameResult.containsAction("int"), "Last Name
> > ValidatorResult should contain the 'int' action.");
> > @@ -330,8 +330,8 @@ public class MultipleTest extends AbstractCommonTest
> {
> >          final ValidatorResult lastNameResult =
> > results.getValidatorResult("lastName");
> >
> >          assertNotNull(firstNameResult, "First Name ValidatorResult
> should
> > not be null.");
> > -        assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > -        assertTrue(firstNameResult.isValid(ACTION), () -> "First Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > +        assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > +        assertTrue(firstNameResult.isValid(ACTION), "First Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> >
> >          assertNotNull(lastNameResult, "Last Name ValidatorResult should
> > not be null.");
> >          assertTrue(lastNameResult.containsAction("int"), "Last Name
> > ValidatorResult should contain the 'int' action.");
> > diff --git
> a/src/test/java/org/apache/commons/validator/ParameterTest.java
> > b/src/test/java/org/apache/commons/validator/ParameterTest.java
> > index 629c06e7..c254d160 100644
> > --- a/src/test/java/org/apache/commons/validator/ParameterTest.java
> > +++ b/src/test/java/org/apache/commons/validator/ParameterTest.java
> > @@ -43,8 +43,8 @@ public class ParameterTest extends AbstractCommonTest {
> >
> >      private void assertParameterValue(final Validator validator, final
> > String name, final Class<?> type) {
> >          final Object value = validator.getParameterValue(name);
> > -        assertNotNull(value, () -> "Expected '" + type.getName() + "'
> but
> > was null");
> > -        assertTrue(type.isInstance(value), () -> "Expected '" +
> > type.getName() + "' but was '" + value.getClass().getName() + "'");
> > +        assertNotNull(value, "Expected '" + type.getName() + "' but was
> > null");
> > +        assertTrue(type.isInstance(value), "Expected '" + type.getName()
> > + "' but was '" + value.getClass().getName() + "'");
> >      }
> >
> >      /**
> > diff --git
> > a/src/test/java/org/apache/commons/validator/RequiredIfTest.java
> > b/src/test/java/org/apache/commons/validator/RequiredIfTest.java
> > index 699db985..95324a37 100644
> > --- a/src/test/java/org/apache/commons/validator/RequiredIfTest.java
> > +++ b/src/test/java/org/apache/commons/validator/RequiredIfTest.java
> > @@ -83,12 +83,12 @@ public class RequiredIfTest extends
> AbstractCommonTest
> > {
> >          final ValidatorResult lastNameResult =
> > results.getValidatorResult("lastName");
> >
> >          assertNotNull(firstNameResult, "First Name ValidatorResult
> should
> > not be null.");
> > -        assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > -        assertTrue(firstNameResult.isValid(ACTION), () -> "First Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > +        assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > +        assertTrue(firstNameResult.isValid(ACTION), "First Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> >
> >          assertNotNull(lastNameResult, "Last Name ValidatorResult should
> > not be null.");
> > -        assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > -        assertTrue(lastNameResult.isValid(ACTION), () -> "Last Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > +        assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > +        assertTrue(lastNameResult.isValid(ACTION), "Last Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> >      }
> >
> >      /**
> > @@ -117,12 +117,12 @@ public class RequiredIfTest extends
> > AbstractCommonTest {
> >          final ValidatorResult lastNameResult =
> > results.getValidatorResult("lastName");
> >
> >          assertNotNull(firstNameResult, "First Name ValidatorResult
> should
> > not be null.");
> > -        assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > -        assertTrue(firstNameResult.isValid(ACTION), () -> "First Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > +        assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > +        assertTrue(firstNameResult.isValid(ACTION), "First Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> >
> >          assertNotNull(lastNameResult, "Last Name ValidatorResult should
> > not be null.");
> > -        assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > -        assertTrue(lastNameResult.isValid(ACTION), () -> "Last Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > +        assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > +        assertTrue(lastNameResult.isValid(ACTION), "Last Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> >      }
> >
> >      /**
> > @@ -151,12 +151,12 @@ public class RequiredIfTest extends
> > AbstractCommonTest {
> >          final ValidatorResult lastNameResult =
> > results.getValidatorResult("lastName");
> >
> >          assertNotNull(firstNameResult, "First Name ValidatorResult
> should
> > not be null.");
> > -        assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > -        assertFalse(firstNameResult.isValid(ACTION), () -> "First Name
> > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > +        assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > +        assertFalse(firstNameResult.isValid(ACTION), "First Name
> > ValidatorResult for the '" + ACTION + "' action should have failed.");
> >
> >          assertNotNull(lastNameResult, "Last Name ValidatorResult should
> > not be null.");
> > -        assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > -        assertTrue(lastNameResult.isValid(ACTION), () -> "Last Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > +        assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > +        assertTrue(lastNameResult.isValid(ACTION), "Last Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> >      }
> >
> >      /**
> > @@ -189,8 +189,8 @@ public class RequiredIfTest extends
> AbstractCommonTest
> > {
> >          assertTrue(firstNameResult.isValid(ACTION), "First Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> >
> >          assertNotNull(lastNameResult, "Last Name ValidatorResult should
> > not be null.");
> > -        assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > -        assertTrue(lastNameResult.isValid(ACTION), () -> "Last Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > +        assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > +        assertTrue(lastNameResult.isValid(ACTION), "Last Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> >
> >      }
> >
> > @@ -220,12 +220,12 @@ public class RequiredIfTest extends
> > AbstractCommonTest {
> >          final ValidatorResult lastNameResult =
> > results.getValidatorResult("lastName");
> >
> >          assertNotNull(firstNameResult, "First Name ValidatorResult
> should
> > not be null.");
> > -        assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > -        assertTrue(firstNameResult.isValid(ACTION), () -> "First Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > +        assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > +        assertTrue(firstNameResult.isValid(ACTION), "First Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> >
> >          assertNotNull(lastNameResult, "Last Name ValidatorResult should
> > not be null.");
> > -        assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > -        assertFalse(lastNameResult.isValid(ACTION), () -> "Last Name
> > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > +        assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > +        assertFalse(lastNameResult.isValid(ACTION), "Last Name
> > ValidatorResult for the '" + ACTION + "' action should have failed.");
> >      }
> >
> >  }
> > diff --git
> > a/src/test/java/org/apache/commons/validator/RequiredNameTest.java
> > b/src/test/java/org/apache/commons/validator/RequiredNameTest.java
> > index 6578e360..05689158 100644
> > --- a/src/test/java/org/apache/commons/validator/RequiredNameTest.java
> > +++ b/src/test/java/org/apache/commons/validator/RequiredNameTest.java
> > @@ -83,8 +83,8 @@ public class RequiredNameTest extends
> AbstractCommonTest
> > {
> >          final ValidatorResult lastNameResult =
> > results.getValidatorResult("lastName");
> >
> >          assertNotNull(firstNameResult, "First Name ValidatorResult
> should
> > not be null.");
> > -        assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > -        assertFalse(firstNameResult.isValid(ACTION), () -> "First Name
> > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > +        assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > +        assertFalse(firstNameResult.isValid(ACTION), "First Name
> > ValidatorResult for the '" + ACTION + "' action should have failed.");
> >
> >          assertNotNull(lastNameResult, "First Name ValidatorResult should
> > not be null.");
> >          assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > @@ -116,12 +116,12 @@ public class RequiredNameTest extends
> > AbstractCommonTest {
> >          final ValidatorResult lastNameResult =
> > results.getValidatorResult("lastName");
> >
> >          assertNotNull(firstNameResult, "First Name ValidatorResult
> should
> > not be null.");
> > -        assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > -        assertTrue(firstNameResult.isValid(ACTION), () -> "First Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > +        assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > +        assertTrue(firstNameResult.isValid(ACTION), "First Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> >
> >          assertNotNull(lastNameResult, "First Name ValidatorResult should
> > not be null.");
> > -        assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > -        assertFalse(lastNameResult.isValid(ACTION), () -> "Last Name
> > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > +        assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > +        assertFalse(lastNameResult.isValid(ACTION), "Last Name
> > ValidatorResult for the '" + ACTION + "' action should have failed.");
> >      }
> >
> >      /**
> > @@ -149,12 +149,12 @@ public class RequiredNameTest extends
> > AbstractCommonTest {
> >          final ValidatorResult lastNameResult =
> > results.getValidatorResult("lastName");
> >
> >          assertNotNull(firstNameResult, "First Name ValidatorResult
> should
> > not be null.");
> > -        assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > -        assertFalse(firstNameResult.isValid(ACTION), () -> "First Name
> > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > +        assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > +        assertFalse(firstNameResult.isValid(ACTION), "First Name
> > ValidatorResult for the '" + ACTION + "' action should have failed.");
> >
> >          assertNotNull(lastNameResult, "First Name ValidatorResult should
> > not be null.");
> > -        assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > -        assertFalse(lastNameResult.isValid(ACTION), () -> "Last Name
> > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > +        assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > +        assertFalse(lastNameResult.isValid(ACTION), "Last Name
> > ValidatorResult for the '" + ACTION + "' action should have failed.");
> >      }
> >
> >      /**
> > @@ -182,12 +182,12 @@ public class RequiredNameTest extends
> > AbstractCommonTest {
> >          final ValidatorResult lastNameResult =
> > results.getValidatorResult("lastName");
> >
> >          assertNotNull(firstNameResult, "First Name ValidatorResult
> should
> > not be null.");
> > -        assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > -        assertFalse(firstNameResult.isValid(ACTION), () -> "First Name
> > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > +        assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > +        assertFalse(firstNameResult.isValid(ACTION), "First Name
> > ValidatorResult for the '" + ACTION + "' action should have failed.");
> >
> >          assertNotNull(lastNameResult, "First Name ValidatorResult should
> > not be null.");
> > -        assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > -        assertTrue(lastNameResult.isValid(ACTION), () -> "Last Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > +        assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > +        assertTrue(lastNameResult.isValid(ACTION), "Last Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> >
> >      }
> >
> > @@ -220,8 +220,8 @@ public class RequiredNameTest extends
> > AbstractCommonTest {
> >          assertFalse(firstNameResult.isValid(ACTION), "First Name
> > ValidatorResult for the '" + ACTION + "' action should have failed.");
> >
> >          assertNotNull(lastNameResult, "First Name ValidatorResult should
> > not be null.");
> > -        assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > -        assertFalse(lastNameResult.isValid(ACTION), () -> "Last Name
> > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > +        assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > +        assertFalse(lastNameResult.isValid(ACTION), "Last Name
> > ValidatorResult for the '" + ACTION + "' action should have failed.");
> >      }
> >
> >      /**
> > @@ -250,12 +250,12 @@ public class RequiredNameTest extends
> > AbstractCommonTest {
> >          final ValidatorResult lastNameResult =
> > results.getValidatorResult("lastName");
> >
> >          assertNotNull(firstNameResult, "First Name ValidatorResult
> should
> > not be null.");
> > -        assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > -        assertTrue(firstNameResult.isValid(ACTION), () -> "First Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > +        assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > +        assertTrue(firstNameResult.isValid(ACTION), "First Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> >
> >          assertNotNull(lastNameResult, "First Name ValidatorResult should
> > not be null.");
> > -        assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > -        assertTrue(lastNameResult.isValid(ACTION), () -> "Last Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > +        assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > +        assertTrue(lastNameResult.isValid(ACTION), "Last Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> >      }
> >
> >  }
> > \ No newline at end of file
> > diff --git
> > a/src/test/java/org/apache/commons/validator/ValidatorResultsTest.java
> > b/src/test/java/org/apache/commons/validator/ValidatorResultsTest.java
> > index b956d071..54a8f5fb 100644
> > ---
> a/src/test/java/org/apache/commons/validator/ValidatorResultsTest.java
> > +++
> b/src/test/java/org/apache/commons/validator/ValidatorResultsTest.java
> > @@ -47,8 +47,8 @@ public class ValidatorResultsTest extends
> > AbstractCommonTest {
> >       */
> >      private void checkNotRun(final ValidatorResults results, final
> String
> > field, final String action) {
> >          final ValidatorResult result =
> results.getValidatorResult(field);
> > -        assertNotNull(result, () -> field + " result");
> > -        assertFalse(result.containsAction(action), () -> field + "[" +
> > action + "] run");
> > +        assertNotNull(result, field + " result");
> > +        assertFalse(result.containsAction(action), field + "[" + action
> +
> > "] run");
> >          // System.out.println(field + "[" + action + "] not run");
> >      }
> >
> > @@ -58,9 +58,9 @@ public class ValidatorResultsTest extends
> > AbstractCommonTest {
> >      private void checkValidatorResult(final ValidatorResults results,
> > final String field, final String action, final boolean expected) {
> >          final ValidatorResult result =
> results.getValidatorResult(field);
> >          // System.out.println(field + "[" + action + "]=" +
> > result.isValid(action));
> > -        assertNotNull(result, () -> field + " result");
> > -        assertTrue(result.containsAction(action), () -> field + "[" +
> > action + "] not run");
> > -        assertEquals(expected, result.isValid(action), () -> field + "["
> > + action + "] result");
> > +        assertNotNull(result, field + " result");
> > +        assertTrue(result.containsAction(action), field + "[" + action +
> > "] not run");
> > +        assertEquals(expected, result.isValid(action), field + "[" +
> > action + "] result");
> >      }
> >
> >      /**
> > diff --git
> >
> a/src/test/java/org/apache/commons/validator/routines/AbstractNumberValidatorTest.java
> >
> b/src/test/java/org/apache/commons/validator/routines/AbstractNumberValidatorTest.java
> > index a9847cf8..66849f25 100644
> > ---
> >
> a/src/test/java/org/apache/commons/validator/routines/AbstractNumberValidatorTest.java
> > +++
> >
> b/src/test/java/org/apache/commons/validator/routines/AbstractNumberValidatorTest.java
> > @@ -107,10 +107,10 @@ public abstract class AbstractNumberValidatorTest {
> >      public void testInvalidNotStrict() {
> >          for (int i = 0; i < invalid.length; i++) {
> >              final String text = "idx=[" + i + "] value=[" + invalid[i] +
> > "]";
> > -            assertNull(validator.parse(invalid[i], null, Locale.US), ()
> > -> "(A) " + text);
> > -            assertFalse(validator.isValid(invalid[i], null, Locale.US),
> > () -> "(B) " + text);
> > -            assertNull(validator.parse(invalid[i], testPattern, null),
> ()
> > -> "(C) " + text);
> > -            assertFalse(validator.isValid(invalid[i], testPattern,
> null),
> > () -> "(D) " + text);
> > +            assertNull(validator.parse(invalid[i], null, Locale.US),
> "(A)
> > " + text);
> > +            assertFalse(validator.isValid(invalid[i], null, Locale.US),
> > "(B) " + text);
> > +            assertNull(validator.parse(invalid[i], testPattern, null),
> > "(C) " + text);
> > +            assertFalse(validator.isValid(invalid[i], testPattern,
> null),
> > "(D) " + text);
> >          }
> >      }
> >
> > @@ -121,10 +121,10 @@ public abstract class AbstractNumberValidatorTest {
> >      public void testInvalidStrict() {
> >          for (int i = 0; i < invalidStrict.length; i++) {
> >              final String text = "idx=[" + i + "] value=[" +
> > invalidStrict[i] + "]";
> > -            assertNull(strictValidator.parse(invalidStrict[i], null,
> > Locale.US), () -> "(A) " + text);
> > -            assertFalse(strictValidator.isValid(invalidStrict[i], null,
> > Locale.US), () -> "(B) " + text);
> > -            assertNull(strictValidator.parse(invalidStrict[i],
> > testPattern, null), () -> "(C) " + text);
> > -            assertFalse(strictValidator.isValid(invalidStrict[i],
> > testPattern, null), () -> "(D) " + text);
> > +            assertNull(strictValidator.parse(invalidStrict[i], null,
> > Locale.US), "(A) " + text);
> > +            assertFalse(strictValidator.isValid(invalidStrict[i], null,
> > Locale.US), "(B) " + text);
> > +            assertNull(strictValidator.parse(invalidStrict[i],
> > testPattern, null), "(C) " + text);
> > +            assertFalse(strictValidator.isValid(invalidStrict[i],
> > testPattern, null), "(D) " + text);
> >          }
> >      }
> >
> > diff --git
> >
> a/src/test/java/org/apache/commons/validator/routines/InetAddressValidatorTest.java
> >
> b/src/test/java/org/apache/commons/validator/routines/InetAddressValidatorTest.java
> > index 49971f2e..8566dde0 100644
> > ---
> >
> a/src/test/java/org/apache/commons/validator/routines/InetAddressValidatorTest.java
> > +++
> >
> b/src/test/java/org/apache/commons/validator/routines/InetAddressValidatorTest.java
> > @@ -672,10 +672,10 @@ public class InetAddressValidatorTest {
> >                  "2001:0000:1234:0000:0000:C1C0:ABCD:0876%abc%defgh", //
> > '%' in node id
> >          };
> >          for (final String item : valid) {
> > -            assertTrue(validator.isValid(item), () -> String.format("%s
> > should be valid", item));
> > +            assertTrue(validator.isValid(item), String.format("%s should
> > be valid", item));
> >          }
> >          for (final String item : invalid) {
> > -            assertFalse(validator.isValid(item), () -> String.format("%s
> > should be invalid", item));
> > +            assertFalse(validator.isValid(item), String.format("%s
> should
> > be invalid", item));
> >          }
> >      }
> >  }
> > diff --git
> >
> a/src/test/java/org/apache/commons/validator/routines/TimeValidatorTest.java
> >
> b/src/test/java/org/apache/commons/validator/routines/TimeValidatorTest.java
> > index 72747901..bbeca924 100644
> > ---
> >
> a/src/test/java/org/apache/commons/validator/routines/TimeValidatorTest.java
> > +++
> >
> b/src/test/java/org/apache/commons/validator/routines/TimeValidatorTest.java
> > @@ -198,8 +198,8 @@ public class TimeValidatorTest {
> >          for (int i = 0; i < localeInvalid.length; i++) {
> >              final String text = i + " value=[" + localeInvalid[i] + "]
> > passed ";
> >              final Object date = validator.validate(localeInvalid[i],
> > Locale.US);
> > -            assertNull(date, () -> "validate() " + text + date);
> > -            assertFalse(validator.isValid(localeInvalid[i], Locale.UK),
> > () -> "isValid() " + text);
> > +            assertNull(date, "validate() " + text + date);
> > +            assertFalse(validator.isValid(localeInvalid[i], Locale.UK),
> > "isValid() " + text);
> >          }
> >      }
> >
> > @@ -211,10 +211,10 @@ public class TimeValidatorTest {
> >          for (int i = 0; i < localeValid.length; i++) {
> >              final String text = i + " value=[" + localeValid[i] + "]
> > failed ";
> >              final Calendar calendar = validator.validate(localeValid[i],
> > Locale.UK);
> > -            assertNotNull(calendar, () -> "validate() " + text);
> > +            assertNotNull(calendar, "validate() " + text);
> >              final Date date = calendar.getTime();
> > -            assertTrue(validator.isValid(localeValid[i], Locale.UK), ()
> > -> "isValid() " + text);
> > -            assertEquals(localeExpect[i], date, () -> "compare " +
> text);
> > +            assertTrue(validator.isValid(localeValid[i], Locale.UK),
> > "isValid() " + text);
> > +            assertEquals(localeExpect[i], date, "compare " + text);
> >          }
> >      }
> >
> > @@ -226,8 +226,8 @@ public class TimeValidatorTest {
> >          for (int i = 0; i < patternInvalid.length; i++) {
> >              final String text = i + " value=[" + patternInvalid[i] + "]
> > passed ";
> >              final Object date = validator.validate(patternInvalid[i],
> > "HH-mm-ss");
> > -            assertNull(date, () -> "validate() " + text + date);
> > -            assertFalse(validator.isValid(patternInvalid[i],
> "HH-mm-ss"),
> > () -> "isValid() " + text);
> > +            assertNull(date, "validate() " + text + date);
> > +            assertFalse(validator.isValid(patternInvalid[i],
> "HH-mm-ss"),
> > "isValid() " + text);
> >          }
> >      }
> >
> > @@ -239,10 +239,10 @@ public class TimeValidatorTest {
> >          for (int i = 0; i < patternValid.length; i++) {
> >              final String text = i + " value=[" + patternValid[i] + "]
> > failed ";
> >              final Calendar calendar =
> validator.validate(patternValid[i],
> > "HH-mm-ss");
> > -            assertNotNull(calendar, () -> "validateObj() " + text);
> > +            assertNotNull(calendar, "validateObj() " + text);
> >              final Date date = calendar.getTime();
> > -            assertTrue(validator.isValid(patternValid[i], "HH-mm-ss"),
> ()
> > -> "isValid() " + text);
> > -            assertEquals(patternExpect[i], date, () -> "compare " +
> text);
> > +            assertTrue(validator.isValid(patternValid[i], "HH-mm-ss"),
> > "isValid() " + text);
> > +            assertEquals(patternExpect[i], date, "compare " + text);
> >          }
> >      }
> >
> > diff --git
> >
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/CUSIPCheckDigitTest.java
> >
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/CUSIPCheckDigitTest.java
> > index 69136900..fb5df1f2 100644
> > ---
> >
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/CUSIPCheckDigitTest.java
> > +++
> >
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/CUSIPCheckDigitTest.java
> > @@ -44,14 +44,14 @@ public class CUSIPCheckDigitTest extends
> > AbstractCheckDigitTest {
> >      @Test
> >      public void testValidator336InvalidCheckDigits() {
> >          for (final String invalidCheckDigit : INVALID_CHECK_DIGITS) {
> > -            assertFalse(routine.isValid(invalidCheckDigit), () ->
> "Should
> > fail: " + invalidCheckDigit);
> > +            assertFalse(routine.isValid(invalidCheckDigit), "Should
> fail:
> > " + invalidCheckDigit);
> >          }
> >      }
> >
> >      @Test
> >      public void testValidator336ValidCheckDigits() {
> >          for (final String validCheckDigit : VALID_CHECK_DIGITS) {
> > -            assertTrue(routine.isValid(validCheckDigit), () -> "Should
> > fail: " + validCheckDigit);
> > +            assertTrue(routine.isValid(validCheckDigit), "Should fail: "
> > + validCheckDigit);
> >          }
> >      }
> >  }
> > diff --git
> >
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/ISINCheckDigitTest.java
> >
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/ISINCheckDigitTest.java
> > index f84ec5ce..62b9cb25 100644
> > ---
> >
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/ISINCheckDigitTest.java
> > +++
> >
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/ISINCheckDigitTest.java
> > @@ -54,7 +54,7 @@ public class ISINCheckDigitTest extends
> > AbstractCheckDigitTest {
> >      @Test
> >      public void testValidator345() {
> >          for (final String invalidCheckDigit : INVALID_CHECK_DIGITS) {
> > -            assertFalse(routine.isValid(invalidCheckDigit), () ->
> "Should
> > fail: " + invalidCheckDigit);
> > +            assertFalse(routine.isValid(invalidCheckDigit), "Should
> fail:
> > " + invalidCheckDigit);
> >          }
> >      }
> >  }
> > diff --git
> >
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenCUSIPCheckDigitTest.java
> >
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenCUSIPCheckDigitTest.java
> > index 1217ef90..8dd23b9a 100644
> > ---
> >
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenCUSIPCheckDigitTest.java
> > +++
> >
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenCUSIPCheckDigitTest.java
> > @@ -44,14 +44,14 @@ public class ModulusTenCUSIPCheckDigitTest extends
> > AbstractCheckDigitTest {
> >      @Test
> >      public void testValidator336InvalidCheckDigits() {
> >          for (final String invalidCheckDigit : INVALID_CHECK_DIGITS) {
> > -            assertFalse(routine.isValid(invalidCheckDigit), () ->
> "Should
> > fail: " + invalidCheckDigit);
> > +            assertFalse(routine.isValid(invalidCheckDigit), "Should
> fail:
> > " + invalidCheckDigit);
> >          }
> >      }
> >
> >      @Test
> >      public void testValidator336ValidCheckDigits() {
> >          for (final String validCheckDigit : VALID_CHECK_DIGITS) {
> > -            assertTrue(routine.isValid(validCheckDigit), () -> "Should
> > fail: " + validCheckDigit);
> > +            assertTrue(routine.isValid(validCheckDigit), "Should fail: "
> > + validCheckDigit);
> >          }
> >      }
> >  }
> > diff --git
> >
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenSedolCheckDigitTest.java
> >
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenSedolCheckDigitTest.java
> > index 90d03eb0..12458a83 100644
> > ---
> >
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenSedolCheckDigitTest.java
> > +++
> >
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenSedolCheckDigitTest.java
> > @@ -47,7 +47,7 @@ public class ModulusTenSedolCheckDigitTest extends
> > AbstractCheckDigitTest {
> >      @Test
> >      public void testValidator346() {
> >          for (final String invalidCheckDigit : INVALID_CHECK_DIGITS) {
> > -            assertFalse(routine.isValid(invalidCheckDigit), () ->
> "Should
> > fail: " + invalidCheckDigit);
> > +            assertFalse(routine.isValid(invalidCheckDigit), "Should
> fail:
> > " + invalidCheckDigit);
> >          }
> >      }
> >
> > diff --git
> >
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/SedolCheckDigitTest.java
> >
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/SedolCheckDigitTest.java
> > index 47017a36..43712ed6 100644
> > ---
> >
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/SedolCheckDigitTest.java
> > +++
> >
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/SedolCheckDigitTest.java
> > @@ -47,7 +47,7 @@ public class SedolCheckDigitTest extends
> > AbstractCheckDigitTest {
> >      @Test
> >      public void testValidator346() {
> >          for (final String invalidCheckDigit : INVALID_CHECK_DIGITS) {
> > -            assertFalse(routine.isValid(invalidCheckDigit), () ->
> "Should
> > fail: " + invalidCheckDigit);
> > +            assertFalse(routine.isValid(invalidCheckDigit), "Should
> fail:
> > " + invalidCheckDigit);
> >          }
> >      }
> >
> >
> >
>

Re: (commons-validator) 08/11: Removed unnecessary lambdas in the tests

Posted by Gary Gregory <ga...@gmail.com>.
-1 you are undoing the port to JUnit 5. This commit is a classic JUnit
mistake imo, please stop, these JUnit APIs exist for a reason: The lambdas
avoid construction of failure message strings, which, as a pattern, add
processing, can have side effects, and always creates more garbage. This is
bad since in general toString() methods can do anything. String.format() is
a great way to create nice messages in a compact way but is not free.

Gary

On Mon, Nov 18, 2024, 7:53 AM <eb...@apache.org> wrote:

> This is an automated email from the ASF dual-hosted git repository.
>
> ebourg pushed a commit to branch master
> in repository https://gitbox.apache.org/repos/asf/commons-validator.git
>
> commit dfd4a9e426ea6d0901af757ce333d2577772b2b1
> Author: Emmanuel Bourg <eb...@apache.org>
> AuthorDate: Mon Nov 18 11:22:35 2024 +0100
>
>     Removed unnecessary lambdas in the tests
> ---
>  .../commons/validator/AbstractNumberTest.java      |  6 ++--
>  .../org/apache/commons/validator/DateTest.java     |  6 ++--
>  .../org/apache/commons/validator/EmailTest.java    |  6 ++--
>  .../validator/GenericTypeValidatorTest.java        | 16 ++++-----
>  .../org/apache/commons/validator/MultipleTest.java | 20 +++++------
>  .../apache/commons/validator/ParameterTest.java    |  4 +--
>  .../apache/commons/validator/RequiredIfTest.java   | 36
> +++++++++----------
>  .../apache/commons/validator/RequiredNameTest.java | 40
> +++++++++++-----------
>  .../commons/validator/ValidatorResultsTest.java    | 10 +++---
>  .../routines/AbstractNumberValidatorTest.java      | 16 ++++-----
>  .../routines/InetAddressValidatorTest.java         |  4 +--
>  .../validator/routines/TimeValidatorTest.java      | 20 +++++------
>  .../routines/checkdigit/CUSIPCheckDigitTest.java   |  4 +--
>  .../routines/checkdigit/ISINCheckDigitTest.java    |  2 +-
>  .../checkdigit/ModulusTenCUSIPCheckDigitTest.java  |  4 +--
>  .../checkdigit/ModulusTenSedolCheckDigitTest.java  |  2 +-
>  .../routines/checkdigit/SedolCheckDigitTest.java   |  2 +-
>  17 files changed, 99 insertions(+), 99 deletions(-)
>
> diff --git
> a/src/test/java/org/apache/commons/validator/AbstractNumberTest.java
> b/src/test/java/org/apache/commons/validator/AbstractNumberTest.java
> index b245c536..6652428e 100644
> --- a/src/test/java/org/apache/commons/validator/AbstractNumberTest.java
> +++ b/src/test/java/org/apache/commons/validator/AbstractNumberTest.java
> @@ -100,10 +100,10 @@ public abstract class AbstractNumberTest extends
> AbstractCommonTest {
>
>          final ValidatorResult result =
> results.getValidatorResult("value");
>
> -        assertNotNull(result, () -> action + " value ValidatorResult
> should not be null.");
> -        assertTrue(result.containsAction(action), () -> action + " value
> ValidatorResult should contain the '" + action + "' action.");
> +        assertNotNull(result, action + " value ValidatorResult should not
> be null.");
> +        assertTrue(result.containsAction(action), action + " value
> ValidatorResult should contain the '" + action + "' action.");
>          assertTrue(passed ? result.isValid(action) :
> !result.isValid(action),
> -                () -> action + " value ValidatorResult for the '" +
> action + "' action should have " + (passed ? "passed" : "failed") + ".");
> +                action + " value ValidatorResult for the '" + action + "'
> action should have " + (passed ? "passed" : "failed") + ".");
>      }
>
>  }
> diff --git a/src/test/java/org/apache/commons/validator/DateTest.java
> b/src/test/java/org/apache/commons/validator/DateTest.java
> index c7db41d4..a42d6b4c 100644
> --- a/src/test/java/org/apache/commons/validator/DateTest.java
> +++ b/src/test/java/org/apache/commons/validator/DateTest.java
> @@ -98,10 +98,10 @@ public class DateTest extends AbstractCommonTest {
>
>          final ValidatorResult result =
> results.getValidatorResult("value");
>
> -        assertNotNull(result, () -> ACTION + " value ValidatorResult
> should not be null.");
> -        assertTrue(result.containsAction(ACTION), () -> ACTION + " value
> ValidatorResult should contain the '" + ACTION + "' action.");
> +        assertNotNull(result, ACTION + " value ValidatorResult should not
> be null.");
> +        assertTrue(result.containsAction(ACTION), ACTION + " value
> ValidatorResult should contain the '" + ACTION + "' action.");
>          assertTrue(passed ? result.isValid(ACTION) :
> !result.isValid(ACTION),
> -                () -> ACTION + " value ValidatorResult for the '" +
> ACTION + "' action should have " + (passed ? "passed" : "failed") + ".");
> +                ACTION + " value ValidatorResult for the '" + ACTION + "'
> action should have " + (passed ? "passed" : "failed") + ".");
>      }
>
>  }
> diff --git a/src/test/java/org/apache/commons/validator/EmailTest.java
> b/src/test/java/org/apache/commons/validator/EmailTest.java
> index 39a78230..92ae84ce 100644
> --- a/src/test/java/org/apache/commons/validator/EmailTest.java
> +++ b/src/test/java/org/apache/commons/validator/EmailTest.java
> @@ -406,9 +406,9 @@ public class EmailTest extends AbstractCommonTest {
>
>          final ValidatorResult result =
> results.getValidatorResult("value");
>
> -        assertNotNull(result, () -> ACTION + " value ValidatorResult
> should not be null.");
> -        assertTrue(result.containsAction(ACTION), () -> "Value " +
> info.getValue() + " ValidatorResult should contain the '" + ACTION + "'
> action.");
> +        assertNotNull(result, ACTION + " value ValidatorResult should not
> be null.");
> +        assertTrue(result.containsAction(ACTION), "Value " +
> info.getValue() + " ValidatorResult should contain the '" + ACTION + "'
> action.");
>          assertTrue(passed ? result.isValid(ACTION) :
> !result.isValid(ACTION),
> -                () -> "Value " + info.getValue() + "ValidatorResult for
> the '" + ACTION + "' action should have " + (passed ? "passed" : "failed")
> + ".");
> +                "Value " + info.getValue() + "ValidatorResult for the '"
> + ACTION + "' action should have " + (passed ? "passed" : "failed") + ".");
>      }
>  }
> diff --git
> a/src/test/java/org/apache/commons/validator/GenericTypeValidatorTest.java
> b/src/test/java/org/apache/commons/validator/GenericTypeValidatorTest.java
> index 104bfb4f..dd70d65f 100644
> ---
> a/src/test/java/org/apache/commons/validator/GenericTypeValidatorTest.java
> +++
> b/src/test/java/org/apache/commons/validator/GenericTypeValidatorTest.java
> @@ -69,18 +69,18 @@ public class GenericTypeValidatorTest extends
> AbstractCommonTest {
>
>          final Map<String, ?> hResultValues = results.getResultValueMap();
>
> -        assertInstanceOf(Byte.class, hResultValues.get("byte"), () ->
> "Expecting byte result to be an instance of Byte for locale: " + locale);
> -        assertInstanceOf(Short.class, hResultValues.get("short"), () ->
> "Expecting short result to be an instance of Short for locale: " + locale);
> -        assertInstanceOf(Integer.class, hResultValues.get("integer"), ()
> -> "Expecting integer result to be an instance of Integer for locale: " +
> locale);
> -        assertInstanceOf(Long.class, hResultValues.get("long"), () ->
> "Expecting long result to be an instance of Long for locale: " + locale);
> -        assertInstanceOf(Float.class, hResultValues.get("float"), () ->
> "Expecting float result to be an instance of Float for locale: " + locale);
> -        assertInstanceOf(Double.class, hResultValues.get("double"), () ->
> "Expecting double result to be an instance of Double for locale: " +
> locale);
> -        assertInstanceOf(Date.class, hResultValues.get("date"), () ->
> "Expecting date result to be an instance of Date for locale: " + locale);
> +        assertInstanceOf(Byte.class, hResultValues.get("byte"),
> "Expecting byte result to be an instance of Byte for locale: " + locale);
> +        assertInstanceOf(Short.class, hResultValues.get("short"),
> "Expecting short result to be an instance of Short for locale: " + locale);
> +        assertInstanceOf(Integer.class, hResultValues.get("integer"),
> "Expecting integer result to be an instance of Integer for locale: " +
> locale);
> +        assertInstanceOf(Long.class, hResultValues.get("long"),
> "Expecting long result to be an instance of Long for locale: " + locale);
> +        assertInstanceOf(Float.class, hResultValues.get("float"),
> "Expecting float result to be an instance of Float for locale: " + locale);
> +        assertInstanceOf(Double.class, hResultValues.get("double"),
> "Expecting double result to be an instance of Double for locale: " +
> locale);
> +        assertInstanceOf(Date.class, hResultValues.get("date"),
> "Expecting date result to be an instance of Date for locale: " + locale);
>
>          for (final String key : hResultValues.keySet()) {
>              final Object value = hResultValues.get(key);
>
> -            assertNotNull(value, () -> "value
> ValidatorResults.getResultValueMap() should not be null for locale: " +
> locale);
> +            assertNotNull(value, "value
> ValidatorResults.getResultValueMap() should not be null for locale: " +
> locale);
>          }
>          return hResultValues;
>      }
> diff --git a/src/test/java/org/apache/commons/validator/MultipleTest.java
> b/src/test/java/org/apache/commons/validator/MultipleTest.java
> index 5e9cfa04..e20cedea 100644
> --- a/src/test/java/org/apache/commons/validator/MultipleTest.java
> +++ b/src/test/java/org/apache/commons/validator/MultipleTest.java
> @@ -83,12 +83,12 @@ public class MultipleTest extends AbstractCommonTest {
>          final ValidatorResult lastNameResult =
> results.getValidatorResult("lastName");
>
>          assertNotNull(firstNameResult, "First Name ValidatorResult should
> not be null.");
> -        assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> Name ValidatorResult should contain the '" + ACTION + "' action.");
> -        assertFalse(firstNameResult.isValid(ACTION), () -> "First Name
> ValidatorResult for the '" + ACTION + "' action should have failed.");
> +        assertTrue(firstNameResult.containsAction(ACTION), "First Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> +        assertFalse(firstNameResult.isValid(ACTION), "First Name
> ValidatorResult for the '" + ACTION + "' action should have failed.");
>
>          assertNotNull(lastNameResult, "Last Name ValidatorResult should
> not be null.");
> -        assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> Name ValidatorResult should contain the '" + ACTION + "' action.");
> -        assertFalse(lastNameResult.isValid(ACTION), () -> "Last Name
> ValidatorResult for the '" + ACTION + "' action should have failed.");
> +        assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> +        assertFalse(lastNameResult.isValid(ACTION), "Last Name
> ValidatorResult for the '" + ACTION + "' action should have failed.");
>          assertFalse(lastNameResult.containsAction("int"), "Last Name
> ValidatorResults should not contain the 'int' action.");
>      }
>
> @@ -262,8 +262,8 @@ public class MultipleTest extends AbstractCommonTest {
>          final ValidatorResult lastNameResult =
> results.getValidatorResult("lastName");
>
>          assertNotNull(firstNameResult, "First Name ValidatorResult should
> not be null.");
> -        assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> Name ValidatorResult should contain the '" + ACTION + "' action.");
> -        assertFalse(firstNameResult.isValid(ACTION), () -> "First Name
> ValidatorResult for the '" + ACTION + "' action should have failed.");
> +        assertTrue(firstNameResult.containsAction(ACTION), "First Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> +        assertFalse(firstNameResult.isValid(ACTION), "First Name
> ValidatorResult for the '" + ACTION + "' action should have failed.");
>
>          assertNotNull(lastNameResult, "Last Name ValidatorResult should
> not be null.");
>          assertTrue(lastNameResult.containsAction("int"), "Last Name
> ValidatorResult should contain the 'int' action.");
> @@ -296,8 +296,8 @@ public class MultipleTest extends AbstractCommonTest {
>          final ValidatorResult lastNameResult =
> results.getValidatorResult("lastName");
>
>          assertNotNull(firstNameResult, "First Name ValidatorResult should
> not be null.");
> -        assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> Name ValidatorResult should contain the '" + ACTION + "' action.");
> -        assertTrue(firstNameResult.isValid(ACTION), () -> "First Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
> +        assertTrue(firstNameResult.containsAction(ACTION), "First Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> +        assertTrue(firstNameResult.isValid(ACTION), "First Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
>
>          assertNotNull(lastNameResult, "Last Name ValidatorResult should
> not be null.");
>          assertTrue(lastNameResult.containsAction("int"), "Last Name
> ValidatorResult should contain the 'int' action.");
> @@ -330,8 +330,8 @@ public class MultipleTest extends AbstractCommonTest {
>          final ValidatorResult lastNameResult =
> results.getValidatorResult("lastName");
>
>          assertNotNull(firstNameResult, "First Name ValidatorResult should
> not be null.");
> -        assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> Name ValidatorResult should contain the '" + ACTION + "' action.");
> -        assertTrue(firstNameResult.isValid(ACTION), () -> "First Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
> +        assertTrue(firstNameResult.containsAction(ACTION), "First Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> +        assertTrue(firstNameResult.isValid(ACTION), "First Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
>
>          assertNotNull(lastNameResult, "Last Name ValidatorResult should
> not be null.");
>          assertTrue(lastNameResult.containsAction("int"), "Last Name
> ValidatorResult should contain the 'int' action.");
> diff --git a/src/test/java/org/apache/commons/validator/ParameterTest.java
> b/src/test/java/org/apache/commons/validator/ParameterTest.java
> index 629c06e7..c254d160 100644
> --- a/src/test/java/org/apache/commons/validator/ParameterTest.java
> +++ b/src/test/java/org/apache/commons/validator/ParameterTest.java
> @@ -43,8 +43,8 @@ public class ParameterTest extends AbstractCommonTest {
>
>      private void assertParameterValue(final Validator validator, final
> String name, final Class<?> type) {
>          final Object value = validator.getParameterValue(name);
> -        assertNotNull(value, () -> "Expected '" + type.getName() + "' but
> was null");
> -        assertTrue(type.isInstance(value), () -> "Expected '" +
> type.getName() + "' but was '" + value.getClass().getName() + "'");
> +        assertNotNull(value, "Expected '" + type.getName() + "' but was
> null");
> +        assertTrue(type.isInstance(value), "Expected '" + type.getName()
> + "' but was '" + value.getClass().getName() + "'");
>      }
>
>      /**
> diff --git
> a/src/test/java/org/apache/commons/validator/RequiredIfTest.java
> b/src/test/java/org/apache/commons/validator/RequiredIfTest.java
> index 699db985..95324a37 100644
> --- a/src/test/java/org/apache/commons/validator/RequiredIfTest.java
> +++ b/src/test/java/org/apache/commons/validator/RequiredIfTest.java
> @@ -83,12 +83,12 @@ public class RequiredIfTest extends AbstractCommonTest
> {
>          final ValidatorResult lastNameResult =
> results.getValidatorResult("lastName");
>
>          assertNotNull(firstNameResult, "First Name ValidatorResult should
> not be null.");
> -        assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> Name ValidatorResult should contain the '" + ACTION + "' action.");
> -        assertTrue(firstNameResult.isValid(ACTION), () -> "First Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
> +        assertTrue(firstNameResult.containsAction(ACTION), "First Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> +        assertTrue(firstNameResult.isValid(ACTION), "First Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
>
>          assertNotNull(lastNameResult, "Last Name ValidatorResult should
> not be null.");
> -        assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> Name ValidatorResult should contain the '" + ACTION + "' action.");
> -        assertTrue(lastNameResult.isValid(ACTION), () -> "Last Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
> +        assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> +        assertTrue(lastNameResult.isValid(ACTION), "Last Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
>      }
>
>      /**
> @@ -117,12 +117,12 @@ public class RequiredIfTest extends
> AbstractCommonTest {
>          final ValidatorResult lastNameResult =
> results.getValidatorResult("lastName");
>
>          assertNotNull(firstNameResult, "First Name ValidatorResult should
> not be null.");
> -        assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> Name ValidatorResult should contain the '" + ACTION + "' action.");
> -        assertTrue(firstNameResult.isValid(ACTION), () -> "First Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
> +        assertTrue(firstNameResult.containsAction(ACTION), "First Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> +        assertTrue(firstNameResult.isValid(ACTION), "First Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
>
>          assertNotNull(lastNameResult, "Last Name ValidatorResult should
> not be null.");
> -        assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> Name ValidatorResult should contain the '" + ACTION + "' action.");
> -        assertTrue(lastNameResult.isValid(ACTION), () -> "Last Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
> +        assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> +        assertTrue(lastNameResult.isValid(ACTION), "Last Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
>      }
>
>      /**
> @@ -151,12 +151,12 @@ public class RequiredIfTest extends
> AbstractCommonTest {
>          final ValidatorResult lastNameResult =
> results.getValidatorResult("lastName");
>
>          assertNotNull(firstNameResult, "First Name ValidatorResult should
> not be null.");
> -        assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> Name ValidatorResult should contain the '" + ACTION + "' action.");
> -        assertFalse(firstNameResult.isValid(ACTION), () -> "First Name
> ValidatorResult for the '" + ACTION + "' action should have failed.");
> +        assertTrue(firstNameResult.containsAction(ACTION), "First Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> +        assertFalse(firstNameResult.isValid(ACTION), "First Name
> ValidatorResult for the '" + ACTION + "' action should have failed.");
>
>          assertNotNull(lastNameResult, "Last Name ValidatorResult should
> not be null.");
> -        assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> Name ValidatorResult should contain the '" + ACTION + "' action.");
> -        assertTrue(lastNameResult.isValid(ACTION), () -> "Last Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
> +        assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> +        assertTrue(lastNameResult.isValid(ACTION), "Last Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
>      }
>
>      /**
> @@ -189,8 +189,8 @@ public class RequiredIfTest extends AbstractCommonTest
> {
>          assertTrue(firstNameResult.isValid(ACTION), "First Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
>
>          assertNotNull(lastNameResult, "Last Name ValidatorResult should
> not be null.");
> -        assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> Name ValidatorResult should contain the '" + ACTION + "' action.");
> -        assertTrue(lastNameResult.isValid(ACTION), () -> "Last Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
> +        assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> +        assertTrue(lastNameResult.isValid(ACTION), "Last Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
>
>      }
>
> @@ -220,12 +220,12 @@ public class RequiredIfTest extends
> AbstractCommonTest {
>          final ValidatorResult lastNameResult =
> results.getValidatorResult("lastName");
>
>          assertNotNull(firstNameResult, "First Name ValidatorResult should
> not be null.");
> -        assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> Name ValidatorResult should contain the '" + ACTION + "' action.");
> -        assertTrue(firstNameResult.isValid(ACTION), () -> "First Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
> +        assertTrue(firstNameResult.containsAction(ACTION), "First Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> +        assertTrue(firstNameResult.isValid(ACTION), "First Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
>
>          assertNotNull(lastNameResult, "Last Name ValidatorResult should
> not be null.");
> -        assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> Name ValidatorResult should contain the '" + ACTION + "' action.");
> -        assertFalse(lastNameResult.isValid(ACTION), () -> "Last Name
> ValidatorResult for the '" + ACTION + "' action should have failed.");
> +        assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> +        assertFalse(lastNameResult.isValid(ACTION), "Last Name
> ValidatorResult for the '" + ACTION + "' action should have failed.");
>      }
>
>  }
> diff --git
> a/src/test/java/org/apache/commons/validator/RequiredNameTest.java
> b/src/test/java/org/apache/commons/validator/RequiredNameTest.java
> index 6578e360..05689158 100644
> --- a/src/test/java/org/apache/commons/validator/RequiredNameTest.java
> +++ b/src/test/java/org/apache/commons/validator/RequiredNameTest.java
> @@ -83,8 +83,8 @@ public class RequiredNameTest extends AbstractCommonTest
> {
>          final ValidatorResult lastNameResult =
> results.getValidatorResult("lastName");
>
>          assertNotNull(firstNameResult, "First Name ValidatorResult should
> not be null.");
> -        assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> Name ValidatorResult should contain the '" + ACTION + "' action.");
> -        assertFalse(firstNameResult.isValid(ACTION), () -> "First Name
> ValidatorResult for the '" + ACTION + "' action should have failed.");
> +        assertTrue(firstNameResult.containsAction(ACTION), "First Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> +        assertFalse(firstNameResult.isValid(ACTION), "First Name
> ValidatorResult for the '" + ACTION + "' action should have failed.");
>
>          assertNotNull(lastNameResult, "First Name ValidatorResult should
> not be null.");
>          assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> @@ -116,12 +116,12 @@ public class RequiredNameTest extends
> AbstractCommonTest {
>          final ValidatorResult lastNameResult =
> results.getValidatorResult("lastName");
>
>          assertNotNull(firstNameResult, "First Name ValidatorResult should
> not be null.");
> -        assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> Name ValidatorResult should contain the '" + ACTION + "' action.");
> -        assertTrue(firstNameResult.isValid(ACTION), () -> "First Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
> +        assertTrue(firstNameResult.containsAction(ACTION), "First Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> +        assertTrue(firstNameResult.isValid(ACTION), "First Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
>
>          assertNotNull(lastNameResult, "First Name ValidatorResult should
> not be null.");
> -        assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> Name ValidatorResult should contain the '" + ACTION + "' action.");
> -        assertFalse(lastNameResult.isValid(ACTION), () -> "Last Name
> ValidatorResult for the '" + ACTION + "' action should have failed.");
> +        assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> +        assertFalse(lastNameResult.isValid(ACTION), "Last Name
> ValidatorResult for the '" + ACTION + "' action should have failed.");
>      }
>
>      /**
> @@ -149,12 +149,12 @@ public class RequiredNameTest extends
> AbstractCommonTest {
>          final ValidatorResult lastNameResult =
> results.getValidatorResult("lastName");
>
>          assertNotNull(firstNameResult, "First Name ValidatorResult should
> not be null.");
> -        assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> Name ValidatorResult should contain the '" + ACTION + "' action.");
> -        assertFalse(firstNameResult.isValid(ACTION), () -> "First Name
> ValidatorResult for the '" + ACTION + "' action should have failed.");
> +        assertTrue(firstNameResult.containsAction(ACTION), "First Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> +        assertFalse(firstNameResult.isValid(ACTION), "First Name
> ValidatorResult for the '" + ACTION + "' action should have failed.");
>
>          assertNotNull(lastNameResult, "First Name ValidatorResult should
> not be null.");
> -        assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> Name ValidatorResult should contain the '" + ACTION + "' action.");
> -        assertFalse(lastNameResult.isValid(ACTION), () -> "Last Name
> ValidatorResult for the '" + ACTION + "' action should have failed.");
> +        assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> +        assertFalse(lastNameResult.isValid(ACTION), "Last Name
> ValidatorResult for the '" + ACTION + "' action should have failed.");
>      }
>
>      /**
> @@ -182,12 +182,12 @@ public class RequiredNameTest extends
> AbstractCommonTest {
>          final ValidatorResult lastNameResult =
> results.getValidatorResult("lastName");
>
>          assertNotNull(firstNameResult, "First Name ValidatorResult should
> not be null.");
> -        assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> Name ValidatorResult should contain the '" + ACTION + "' action.");
> -        assertFalse(firstNameResult.isValid(ACTION), () -> "First Name
> ValidatorResult for the '" + ACTION + "' action should have failed.");
> +        assertTrue(firstNameResult.containsAction(ACTION), "First Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> +        assertFalse(firstNameResult.isValid(ACTION), "First Name
> ValidatorResult for the '" + ACTION + "' action should have failed.");
>
>          assertNotNull(lastNameResult, "First Name ValidatorResult should
> not be null.");
> -        assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> Name ValidatorResult should contain the '" + ACTION + "' action.");
> -        assertTrue(lastNameResult.isValid(ACTION), () -> "Last Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
> +        assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> +        assertTrue(lastNameResult.isValid(ACTION), "Last Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
>
>      }
>
> @@ -220,8 +220,8 @@ public class RequiredNameTest extends
> AbstractCommonTest {
>          assertFalse(firstNameResult.isValid(ACTION), "First Name
> ValidatorResult for the '" + ACTION + "' action should have failed.");
>
>          assertNotNull(lastNameResult, "First Name ValidatorResult should
> not be null.");
> -        assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> Name ValidatorResult should contain the '" + ACTION + "' action.");
> -        assertFalse(lastNameResult.isValid(ACTION), () -> "Last Name
> ValidatorResult for the '" + ACTION + "' action should have failed.");
> +        assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> +        assertFalse(lastNameResult.isValid(ACTION), "Last Name
> ValidatorResult for the '" + ACTION + "' action should have failed.");
>      }
>
>      /**
> @@ -250,12 +250,12 @@ public class RequiredNameTest extends
> AbstractCommonTest {
>          final ValidatorResult lastNameResult =
> results.getValidatorResult("lastName");
>
>          assertNotNull(firstNameResult, "First Name ValidatorResult should
> not be null.");
> -        assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> Name ValidatorResult should contain the '" + ACTION + "' action.");
> -        assertTrue(firstNameResult.isValid(ACTION), () -> "First Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
> +        assertTrue(firstNameResult.containsAction(ACTION), "First Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> +        assertTrue(firstNameResult.isValid(ACTION), "First Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
>
>          assertNotNull(lastNameResult, "First Name ValidatorResult should
> not be null.");
> -        assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> Name ValidatorResult should contain the '" + ACTION + "' action.");
> -        assertTrue(lastNameResult.isValid(ACTION), () -> "Last Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
> +        assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> +        assertTrue(lastNameResult.isValid(ACTION), "Last Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
>      }
>
>  }
> \ No newline at end of file
> diff --git
> a/src/test/java/org/apache/commons/validator/ValidatorResultsTest.java
> b/src/test/java/org/apache/commons/validator/ValidatorResultsTest.java
> index b956d071..54a8f5fb 100644
> --- a/src/test/java/org/apache/commons/validator/ValidatorResultsTest.java
> +++ b/src/test/java/org/apache/commons/validator/ValidatorResultsTest.java
> @@ -47,8 +47,8 @@ public class ValidatorResultsTest extends
> AbstractCommonTest {
>       */
>      private void checkNotRun(final ValidatorResults results, final String
> field, final String action) {
>          final ValidatorResult result = results.getValidatorResult(field);
> -        assertNotNull(result, () -> field + " result");
> -        assertFalse(result.containsAction(action), () -> field + "[" +
> action + "] run");
> +        assertNotNull(result, field + " result");
> +        assertFalse(result.containsAction(action), field + "[" + action +
> "] run");
>          // System.out.println(field + "[" + action + "] not run");
>      }
>
> @@ -58,9 +58,9 @@ public class ValidatorResultsTest extends
> AbstractCommonTest {
>      private void checkValidatorResult(final ValidatorResults results,
> final String field, final String action, final boolean expected) {
>          final ValidatorResult result = results.getValidatorResult(field);
>          // System.out.println(field + "[" + action + "]=" +
> result.isValid(action));
> -        assertNotNull(result, () -> field + " result");
> -        assertTrue(result.containsAction(action), () -> field + "[" +
> action + "] not run");
> -        assertEquals(expected, result.isValid(action), () -> field + "["
> + action + "] result");
> +        assertNotNull(result, field + " result");
> +        assertTrue(result.containsAction(action), field + "[" + action +
> "] not run");
> +        assertEquals(expected, result.isValid(action), field + "[" +
> action + "] result");
>      }
>
>      /**
> diff --git
> a/src/test/java/org/apache/commons/validator/routines/AbstractNumberValidatorTest.java
> b/src/test/java/org/apache/commons/validator/routines/AbstractNumberValidatorTest.java
> index a9847cf8..66849f25 100644
> ---
> a/src/test/java/org/apache/commons/validator/routines/AbstractNumberValidatorTest.java
> +++
> b/src/test/java/org/apache/commons/validator/routines/AbstractNumberValidatorTest.java
> @@ -107,10 +107,10 @@ public abstract class AbstractNumberValidatorTest {
>      public void testInvalidNotStrict() {
>          for (int i = 0; i < invalid.length; i++) {
>              final String text = "idx=[" + i + "] value=[" + invalid[i] +
> "]";
> -            assertNull(validator.parse(invalid[i], null, Locale.US), ()
> -> "(A) " + text);
> -            assertFalse(validator.isValid(invalid[i], null, Locale.US),
> () -> "(B) " + text);
> -            assertNull(validator.parse(invalid[i], testPattern, null), ()
> -> "(C) " + text);
> -            assertFalse(validator.isValid(invalid[i], testPattern, null),
> () -> "(D) " + text);
> +            assertNull(validator.parse(invalid[i], null, Locale.US), "(A)
> " + text);
> +            assertFalse(validator.isValid(invalid[i], null, Locale.US),
> "(B) " + text);
> +            assertNull(validator.parse(invalid[i], testPattern, null),
> "(C) " + text);
> +            assertFalse(validator.isValid(invalid[i], testPattern, null),
> "(D) " + text);
>          }
>      }
>
> @@ -121,10 +121,10 @@ public abstract class AbstractNumberValidatorTest {
>      public void testInvalidStrict() {
>          for (int i = 0; i < invalidStrict.length; i++) {
>              final String text = "idx=[" + i + "] value=[" +
> invalidStrict[i] + "]";
> -            assertNull(strictValidator.parse(invalidStrict[i], null,
> Locale.US), () -> "(A) " + text);
> -            assertFalse(strictValidator.isValid(invalidStrict[i], null,
> Locale.US), () -> "(B) " + text);
> -            assertNull(strictValidator.parse(invalidStrict[i],
> testPattern, null), () -> "(C) " + text);
> -            assertFalse(strictValidator.isValid(invalidStrict[i],
> testPattern, null), () -> "(D) " + text);
> +            assertNull(strictValidator.parse(invalidStrict[i], null,
> Locale.US), "(A) " + text);
> +            assertFalse(strictValidator.isValid(invalidStrict[i], null,
> Locale.US), "(B) " + text);
> +            assertNull(strictValidator.parse(invalidStrict[i],
> testPattern, null), "(C) " + text);
> +            assertFalse(strictValidator.isValid(invalidStrict[i],
> testPattern, null), "(D) " + text);
>          }
>      }
>
> diff --git
> a/src/test/java/org/apache/commons/validator/routines/InetAddressValidatorTest.java
> b/src/test/java/org/apache/commons/validator/routines/InetAddressValidatorTest.java
> index 49971f2e..8566dde0 100644
> ---
> a/src/test/java/org/apache/commons/validator/routines/InetAddressValidatorTest.java
> +++
> b/src/test/java/org/apache/commons/validator/routines/InetAddressValidatorTest.java
> @@ -672,10 +672,10 @@ public class InetAddressValidatorTest {
>                  "2001:0000:1234:0000:0000:C1C0:ABCD:0876%abc%defgh", //
> '%' in node id
>          };
>          for (final String item : valid) {
> -            assertTrue(validator.isValid(item), () -> String.format("%s
> should be valid", item));
> +            assertTrue(validator.isValid(item), String.format("%s should
> be valid", item));
>          }
>          for (final String item : invalid) {
> -            assertFalse(validator.isValid(item), () -> String.format("%s
> should be invalid", item));
> +            assertFalse(validator.isValid(item), String.format("%s should
> be invalid", item));
>          }
>      }
>  }
> diff --git
> a/src/test/java/org/apache/commons/validator/routines/TimeValidatorTest.java
> b/src/test/java/org/apache/commons/validator/routines/TimeValidatorTest.java
> index 72747901..bbeca924 100644
> ---
> a/src/test/java/org/apache/commons/validator/routines/TimeValidatorTest.java
> +++
> b/src/test/java/org/apache/commons/validator/routines/TimeValidatorTest.java
> @@ -198,8 +198,8 @@ public class TimeValidatorTest {
>          for (int i = 0; i < localeInvalid.length; i++) {
>              final String text = i + " value=[" + localeInvalid[i] + "]
> passed ";
>              final Object date = validator.validate(localeInvalid[i],
> Locale.US);
> -            assertNull(date, () -> "validate() " + text + date);
> -            assertFalse(validator.isValid(localeInvalid[i], Locale.UK),
> () -> "isValid() " + text);
> +            assertNull(date, "validate() " + text + date);
> +            assertFalse(validator.isValid(localeInvalid[i], Locale.UK),
> "isValid() " + text);
>          }
>      }
>
> @@ -211,10 +211,10 @@ public class TimeValidatorTest {
>          for (int i = 0; i < localeValid.length; i++) {
>              final String text = i + " value=[" + localeValid[i] + "]
> failed ";
>              final Calendar calendar = validator.validate(localeValid[i],
> Locale.UK);
> -            assertNotNull(calendar, () -> "validate() " + text);
> +            assertNotNull(calendar, "validate() " + text);
>              final Date date = calendar.getTime();
> -            assertTrue(validator.isValid(localeValid[i], Locale.UK), ()
> -> "isValid() " + text);
> -            assertEquals(localeExpect[i], date, () -> "compare " + text);
> +            assertTrue(validator.isValid(localeValid[i], Locale.UK),
> "isValid() " + text);
> +            assertEquals(localeExpect[i], date, "compare " + text);
>          }
>      }
>
> @@ -226,8 +226,8 @@ public class TimeValidatorTest {
>          for (int i = 0; i < patternInvalid.length; i++) {
>              final String text = i + " value=[" + patternInvalid[i] + "]
> passed ";
>              final Object date = validator.validate(patternInvalid[i],
> "HH-mm-ss");
> -            assertNull(date, () -> "validate() " + text + date);
> -            assertFalse(validator.isValid(patternInvalid[i], "HH-mm-ss"),
> () -> "isValid() " + text);
> +            assertNull(date, "validate() " + text + date);
> +            assertFalse(validator.isValid(patternInvalid[i], "HH-mm-ss"),
> "isValid() " + text);
>          }
>      }
>
> @@ -239,10 +239,10 @@ public class TimeValidatorTest {
>          for (int i = 0; i < patternValid.length; i++) {
>              final String text = i + " value=[" + patternValid[i] + "]
> failed ";
>              final Calendar calendar = validator.validate(patternValid[i],
> "HH-mm-ss");
> -            assertNotNull(calendar, () -> "validateObj() " + text);
> +            assertNotNull(calendar, "validateObj() " + text);
>              final Date date = calendar.getTime();
> -            assertTrue(validator.isValid(patternValid[i], "HH-mm-ss"), ()
> -> "isValid() " + text);
> -            assertEquals(patternExpect[i], date, () -> "compare " + text);
> +            assertTrue(validator.isValid(patternValid[i], "HH-mm-ss"),
> "isValid() " + text);
> +            assertEquals(patternExpect[i], date, "compare " + text);
>          }
>      }
>
> diff --git
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/CUSIPCheckDigitTest.java
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/CUSIPCheckDigitTest.java
> index 69136900..fb5df1f2 100644
> ---
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/CUSIPCheckDigitTest.java
> +++
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/CUSIPCheckDigitTest.java
> @@ -44,14 +44,14 @@ public class CUSIPCheckDigitTest extends
> AbstractCheckDigitTest {
>      @Test
>      public void testValidator336InvalidCheckDigits() {
>          for (final String invalidCheckDigit : INVALID_CHECK_DIGITS) {
> -            assertFalse(routine.isValid(invalidCheckDigit), () -> "Should
> fail: " + invalidCheckDigit);
> +            assertFalse(routine.isValid(invalidCheckDigit), "Should fail:
> " + invalidCheckDigit);
>          }
>      }
>
>      @Test
>      public void testValidator336ValidCheckDigits() {
>          for (final String validCheckDigit : VALID_CHECK_DIGITS) {
> -            assertTrue(routine.isValid(validCheckDigit), () -> "Should
> fail: " + validCheckDigit);
> +            assertTrue(routine.isValid(validCheckDigit), "Should fail: "
> + validCheckDigit);
>          }
>      }
>  }
> diff --git
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/ISINCheckDigitTest.java
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/ISINCheckDigitTest.java
> index f84ec5ce..62b9cb25 100644
> ---
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/ISINCheckDigitTest.java
> +++
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/ISINCheckDigitTest.java
> @@ -54,7 +54,7 @@ public class ISINCheckDigitTest extends
> AbstractCheckDigitTest {
>      @Test
>      public void testValidator345() {
>          for (final String invalidCheckDigit : INVALID_CHECK_DIGITS) {
> -            assertFalse(routine.isValid(invalidCheckDigit), () -> "Should
> fail: " + invalidCheckDigit);
> +            assertFalse(routine.isValid(invalidCheckDigit), "Should fail:
> " + invalidCheckDigit);
>          }
>      }
>  }
> diff --git
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenCUSIPCheckDigitTest.java
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenCUSIPCheckDigitTest.java
> index 1217ef90..8dd23b9a 100644
> ---
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenCUSIPCheckDigitTest.java
> +++
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenCUSIPCheckDigitTest.java
> @@ -44,14 +44,14 @@ public class ModulusTenCUSIPCheckDigitTest extends
> AbstractCheckDigitTest {
>      @Test
>      public void testValidator336InvalidCheckDigits() {
>          for (final String invalidCheckDigit : INVALID_CHECK_DIGITS) {
> -            assertFalse(routine.isValid(invalidCheckDigit), () -> "Should
> fail: " + invalidCheckDigit);
> +            assertFalse(routine.isValid(invalidCheckDigit), "Should fail:
> " + invalidCheckDigit);
>          }
>      }
>
>      @Test
>      public void testValidator336ValidCheckDigits() {
>          for (final String validCheckDigit : VALID_CHECK_DIGITS) {
> -            assertTrue(routine.isValid(validCheckDigit), () -> "Should
> fail: " + validCheckDigit);
> +            assertTrue(routine.isValid(validCheckDigit), "Should fail: "
> + validCheckDigit);
>          }
>      }
>  }
> diff --git
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenSedolCheckDigitTest.java
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenSedolCheckDigitTest.java
> index 90d03eb0..12458a83 100644
> ---
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenSedolCheckDigitTest.java
> +++
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenSedolCheckDigitTest.java
> @@ -47,7 +47,7 @@ public class ModulusTenSedolCheckDigitTest extends
> AbstractCheckDigitTest {
>      @Test
>      public void testValidator346() {
>          for (final String invalidCheckDigit : INVALID_CHECK_DIGITS) {
> -            assertFalse(routine.isValid(invalidCheckDigit), () -> "Should
> fail: " + invalidCheckDigit);
> +            assertFalse(routine.isValid(invalidCheckDigit), "Should fail:
> " + invalidCheckDigit);
>          }
>      }
>
> diff --git
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/SedolCheckDigitTest.java
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/SedolCheckDigitTest.java
> index 47017a36..43712ed6 100644
> ---
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/SedolCheckDigitTest.java
> +++
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/SedolCheckDigitTest.java
> @@ -47,7 +47,7 @@ public class SedolCheckDigitTest extends
> AbstractCheckDigitTest {
>      @Test
>      public void testValidator346() {
>          for (final String invalidCheckDigit : INVALID_CHECK_DIGITS) {
> -            assertFalse(routine.isValid(invalidCheckDigit), () -> "Should
> fail: " + invalidCheckDigit);
> +            assertFalse(routine.isValid(invalidCheckDigit), "Should fail:
> " + invalidCheckDigit);
>          }
>      }
>
>
>

(commons-validator) 08/11: Removed unnecessary lambdas in the tests

Posted by eb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ebourg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-validator.git

commit dfd4a9e426ea6d0901af757ce333d2577772b2b1
Author: Emmanuel Bourg <eb...@apache.org>
AuthorDate: Mon Nov 18 11:22:35 2024 +0100

    Removed unnecessary lambdas in the tests
---
 .../commons/validator/AbstractNumberTest.java      |  6 ++--
 .../org/apache/commons/validator/DateTest.java     |  6 ++--
 .../org/apache/commons/validator/EmailTest.java    |  6 ++--
 .../validator/GenericTypeValidatorTest.java        | 16 ++++-----
 .../org/apache/commons/validator/MultipleTest.java | 20 +++++------
 .../apache/commons/validator/ParameterTest.java    |  4 +--
 .../apache/commons/validator/RequiredIfTest.java   | 36 +++++++++----------
 .../apache/commons/validator/RequiredNameTest.java | 40 +++++++++++-----------
 .../commons/validator/ValidatorResultsTest.java    | 10 +++---
 .../routines/AbstractNumberValidatorTest.java      | 16 ++++-----
 .../routines/InetAddressValidatorTest.java         |  4 +--
 .../validator/routines/TimeValidatorTest.java      | 20 +++++------
 .../routines/checkdigit/CUSIPCheckDigitTest.java   |  4 +--
 .../routines/checkdigit/ISINCheckDigitTest.java    |  2 +-
 .../checkdigit/ModulusTenCUSIPCheckDigitTest.java  |  4 +--
 .../checkdigit/ModulusTenSedolCheckDigitTest.java  |  2 +-
 .../routines/checkdigit/SedolCheckDigitTest.java   |  2 +-
 17 files changed, 99 insertions(+), 99 deletions(-)

diff --git a/src/test/java/org/apache/commons/validator/AbstractNumberTest.java b/src/test/java/org/apache/commons/validator/AbstractNumberTest.java
index b245c536..6652428e 100644
--- a/src/test/java/org/apache/commons/validator/AbstractNumberTest.java
+++ b/src/test/java/org/apache/commons/validator/AbstractNumberTest.java
@@ -100,10 +100,10 @@ public abstract class AbstractNumberTest extends AbstractCommonTest {
 
         final ValidatorResult result = results.getValidatorResult("value");
 
-        assertNotNull(result, () -> action + " value ValidatorResult should not be null.");
-        assertTrue(result.containsAction(action), () -> action + " value ValidatorResult should contain the '" + action + "' action.");
+        assertNotNull(result, action + " value ValidatorResult should not be null.");
+        assertTrue(result.containsAction(action), action + " value ValidatorResult should contain the '" + action + "' action.");
         assertTrue(passed ? result.isValid(action) : !result.isValid(action),
-                () -> action + " value ValidatorResult for the '" + action + "' action should have " + (passed ? "passed" : "failed") + ".");
+                action + " value ValidatorResult for the '" + action + "' action should have " + (passed ? "passed" : "failed") + ".");
     }
 
 }
diff --git a/src/test/java/org/apache/commons/validator/DateTest.java b/src/test/java/org/apache/commons/validator/DateTest.java
index c7db41d4..a42d6b4c 100644
--- a/src/test/java/org/apache/commons/validator/DateTest.java
+++ b/src/test/java/org/apache/commons/validator/DateTest.java
@@ -98,10 +98,10 @@ public class DateTest extends AbstractCommonTest {
 
         final ValidatorResult result = results.getValidatorResult("value");
 
-        assertNotNull(result, () -> ACTION + " value ValidatorResult should not be null.");
-        assertTrue(result.containsAction(ACTION), () -> ACTION + " value ValidatorResult should contain the '" + ACTION + "' action.");
+        assertNotNull(result, ACTION + " value ValidatorResult should not be null.");
+        assertTrue(result.containsAction(ACTION), ACTION + " value ValidatorResult should contain the '" + ACTION + "' action.");
         assertTrue(passed ? result.isValid(ACTION) : !result.isValid(ACTION),
-                () -> ACTION + " value ValidatorResult for the '" + ACTION + "' action should have " + (passed ? "passed" : "failed") + ".");
+                ACTION + " value ValidatorResult for the '" + ACTION + "' action should have " + (passed ? "passed" : "failed") + ".");
     }
 
 }
diff --git a/src/test/java/org/apache/commons/validator/EmailTest.java b/src/test/java/org/apache/commons/validator/EmailTest.java
index 39a78230..92ae84ce 100644
--- a/src/test/java/org/apache/commons/validator/EmailTest.java
+++ b/src/test/java/org/apache/commons/validator/EmailTest.java
@@ -406,9 +406,9 @@ public class EmailTest extends AbstractCommonTest {
 
         final ValidatorResult result = results.getValidatorResult("value");
 
-        assertNotNull(result, () -> ACTION + " value ValidatorResult should not be null.");
-        assertTrue(result.containsAction(ACTION), () -> "Value " + info.getValue() + " ValidatorResult should contain the '" + ACTION + "' action.");
+        assertNotNull(result, ACTION + " value ValidatorResult should not be null.");
+        assertTrue(result.containsAction(ACTION), "Value " + info.getValue() + " ValidatorResult should contain the '" + ACTION + "' action.");
         assertTrue(passed ? result.isValid(ACTION) : !result.isValid(ACTION),
-                () -> "Value " + info.getValue() + "ValidatorResult for the '" + ACTION + "' action should have " + (passed ? "passed" : "failed") + ".");
+                "Value " + info.getValue() + "ValidatorResult for the '" + ACTION + "' action should have " + (passed ? "passed" : "failed") + ".");
     }
 }
diff --git a/src/test/java/org/apache/commons/validator/GenericTypeValidatorTest.java b/src/test/java/org/apache/commons/validator/GenericTypeValidatorTest.java
index 104bfb4f..dd70d65f 100644
--- a/src/test/java/org/apache/commons/validator/GenericTypeValidatorTest.java
+++ b/src/test/java/org/apache/commons/validator/GenericTypeValidatorTest.java
@@ -69,18 +69,18 @@ public class GenericTypeValidatorTest extends AbstractCommonTest {
 
         final Map<String, ?> hResultValues = results.getResultValueMap();
 
-        assertInstanceOf(Byte.class, hResultValues.get("byte"), () -> "Expecting byte result to be an instance of Byte for locale: " + locale);
-        assertInstanceOf(Short.class, hResultValues.get("short"), () -> "Expecting short result to be an instance of Short for locale: " + locale);
-        assertInstanceOf(Integer.class, hResultValues.get("integer"), () -> "Expecting integer result to be an instance of Integer for locale: " + locale);
-        assertInstanceOf(Long.class, hResultValues.get("long"), () -> "Expecting long result to be an instance of Long for locale: " + locale);
-        assertInstanceOf(Float.class, hResultValues.get("float"), () -> "Expecting float result to be an instance of Float for locale: " + locale);
-        assertInstanceOf(Double.class, hResultValues.get("double"), () -> "Expecting double result to be an instance of Double for locale: " + locale);
-        assertInstanceOf(Date.class, hResultValues.get("date"), () -> "Expecting date result to be an instance of Date for locale: " + locale);
+        assertInstanceOf(Byte.class, hResultValues.get("byte"), "Expecting byte result to be an instance of Byte for locale: " + locale);
+        assertInstanceOf(Short.class, hResultValues.get("short"), "Expecting short result to be an instance of Short for locale: " + locale);
+        assertInstanceOf(Integer.class, hResultValues.get("integer"), "Expecting integer result to be an instance of Integer for locale: " + locale);
+        assertInstanceOf(Long.class, hResultValues.get("long"), "Expecting long result to be an instance of Long for locale: " + locale);
+        assertInstanceOf(Float.class, hResultValues.get("float"), "Expecting float result to be an instance of Float for locale: " + locale);
+        assertInstanceOf(Double.class, hResultValues.get("double"), "Expecting double result to be an instance of Double for locale: " + locale);
+        assertInstanceOf(Date.class, hResultValues.get("date"), "Expecting date result to be an instance of Date for locale: " + locale);
 
         for (final String key : hResultValues.keySet()) {
             final Object value = hResultValues.get(key);
 
-            assertNotNull(value, () -> "value ValidatorResults.getResultValueMap() should not be null for locale: " + locale);
+            assertNotNull(value, "value ValidatorResults.getResultValueMap() should not be null for locale: " + locale);
         }
         return hResultValues;
     }
diff --git a/src/test/java/org/apache/commons/validator/MultipleTest.java b/src/test/java/org/apache/commons/validator/MultipleTest.java
index 5e9cfa04..e20cedea 100644
--- a/src/test/java/org/apache/commons/validator/MultipleTest.java
+++ b/src/test/java/org/apache/commons/validator/MultipleTest.java
@@ -83,12 +83,12 @@ public class MultipleTest extends AbstractCommonTest {
         final ValidatorResult lastNameResult = results.getValidatorResult("lastName");
 
         assertNotNull(firstNameResult, "First Name ValidatorResult should not be null.");
-        assertTrue(firstNameResult.containsAction(ACTION), () -> "First Name ValidatorResult should contain the '" + ACTION + "' action.");
-        assertFalse(firstNameResult.isValid(ACTION), () -> "First Name ValidatorResult for the '" + ACTION + "' action should have failed.");
+        assertTrue(firstNameResult.containsAction(ACTION), "First Name ValidatorResult should contain the '" + ACTION + "' action.");
+        assertFalse(firstNameResult.isValid(ACTION), "First Name ValidatorResult for the '" + ACTION + "' action should have failed.");
 
         assertNotNull(lastNameResult, "Last Name ValidatorResult should not be null.");
-        assertTrue(lastNameResult.containsAction(ACTION), () -> "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
-        assertFalse(lastNameResult.isValid(ACTION), () -> "Last Name ValidatorResult for the '" + ACTION + "' action should have failed.");
+        assertTrue(lastNameResult.containsAction(ACTION), "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
+        assertFalse(lastNameResult.isValid(ACTION), "Last Name ValidatorResult for the '" + ACTION + "' action should have failed.");
         assertFalse(lastNameResult.containsAction("int"), "Last Name ValidatorResults should not contain the 'int' action.");
     }
 
@@ -262,8 +262,8 @@ public class MultipleTest extends AbstractCommonTest {
         final ValidatorResult lastNameResult = results.getValidatorResult("lastName");
 
         assertNotNull(firstNameResult, "First Name ValidatorResult should not be null.");
-        assertTrue(firstNameResult.containsAction(ACTION), () -> "First Name ValidatorResult should contain the '" + ACTION + "' action.");
-        assertFalse(firstNameResult.isValid(ACTION), () -> "First Name ValidatorResult for the '" + ACTION + "' action should have failed.");
+        assertTrue(firstNameResult.containsAction(ACTION), "First Name ValidatorResult should contain the '" + ACTION + "' action.");
+        assertFalse(firstNameResult.isValid(ACTION), "First Name ValidatorResult for the '" + ACTION + "' action should have failed.");
 
         assertNotNull(lastNameResult, "Last Name ValidatorResult should not be null.");
         assertTrue(lastNameResult.containsAction("int"), "Last Name ValidatorResult should contain the 'int' action.");
@@ -296,8 +296,8 @@ public class MultipleTest extends AbstractCommonTest {
         final ValidatorResult lastNameResult = results.getValidatorResult("lastName");
 
         assertNotNull(firstNameResult, "First Name ValidatorResult should not be null.");
-        assertTrue(firstNameResult.containsAction(ACTION), () -> "First Name ValidatorResult should contain the '" + ACTION + "' action.");
-        assertTrue(firstNameResult.isValid(ACTION), () -> "First Name ValidatorResult for the '" + ACTION + "' action should have passed.");
+        assertTrue(firstNameResult.containsAction(ACTION), "First Name ValidatorResult should contain the '" + ACTION + "' action.");
+        assertTrue(firstNameResult.isValid(ACTION), "First Name ValidatorResult for the '" + ACTION + "' action should have passed.");
 
         assertNotNull(lastNameResult, "Last Name ValidatorResult should not be null.");
         assertTrue(lastNameResult.containsAction("int"), "Last Name ValidatorResult should contain the 'int' action.");
@@ -330,8 +330,8 @@ public class MultipleTest extends AbstractCommonTest {
         final ValidatorResult lastNameResult = results.getValidatorResult("lastName");
 
         assertNotNull(firstNameResult, "First Name ValidatorResult should not be null.");
-        assertTrue(firstNameResult.containsAction(ACTION), () -> "First Name ValidatorResult should contain the '" + ACTION + "' action.");
-        assertTrue(firstNameResult.isValid(ACTION), () -> "First Name ValidatorResult for the '" + ACTION + "' action should have passed.");
+        assertTrue(firstNameResult.containsAction(ACTION), "First Name ValidatorResult should contain the '" + ACTION + "' action.");
+        assertTrue(firstNameResult.isValid(ACTION), "First Name ValidatorResult for the '" + ACTION + "' action should have passed.");
 
         assertNotNull(lastNameResult, "Last Name ValidatorResult should not be null.");
         assertTrue(lastNameResult.containsAction("int"), "Last Name ValidatorResult should contain the 'int' action.");
diff --git a/src/test/java/org/apache/commons/validator/ParameterTest.java b/src/test/java/org/apache/commons/validator/ParameterTest.java
index 629c06e7..c254d160 100644
--- a/src/test/java/org/apache/commons/validator/ParameterTest.java
+++ b/src/test/java/org/apache/commons/validator/ParameterTest.java
@@ -43,8 +43,8 @@ public class ParameterTest extends AbstractCommonTest {
 
     private void assertParameterValue(final Validator validator, final String name, final Class<?> type) {
         final Object value = validator.getParameterValue(name);
-        assertNotNull(value, () -> "Expected '" + type.getName() + "' but was null");
-        assertTrue(type.isInstance(value), () -> "Expected '" + type.getName() + "' but was '" + value.getClass().getName() + "'");
+        assertNotNull(value, "Expected '" + type.getName() + "' but was null");
+        assertTrue(type.isInstance(value), "Expected '" + type.getName() + "' but was '" + value.getClass().getName() + "'");
     }
 
     /**
diff --git a/src/test/java/org/apache/commons/validator/RequiredIfTest.java b/src/test/java/org/apache/commons/validator/RequiredIfTest.java
index 699db985..95324a37 100644
--- a/src/test/java/org/apache/commons/validator/RequiredIfTest.java
+++ b/src/test/java/org/apache/commons/validator/RequiredIfTest.java
@@ -83,12 +83,12 @@ public class RequiredIfTest extends AbstractCommonTest {
         final ValidatorResult lastNameResult = results.getValidatorResult("lastName");
 
         assertNotNull(firstNameResult, "First Name ValidatorResult should not be null.");
-        assertTrue(firstNameResult.containsAction(ACTION), () -> "First Name ValidatorResult should contain the '" + ACTION + "' action.");
-        assertTrue(firstNameResult.isValid(ACTION), () -> "First Name ValidatorResult for the '" + ACTION + "' action should have passed.");
+        assertTrue(firstNameResult.containsAction(ACTION), "First Name ValidatorResult should contain the '" + ACTION + "' action.");
+        assertTrue(firstNameResult.isValid(ACTION), "First Name ValidatorResult for the '" + ACTION + "' action should have passed.");
 
         assertNotNull(lastNameResult, "Last Name ValidatorResult should not be null.");
-        assertTrue(lastNameResult.containsAction(ACTION), () -> "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
-        assertTrue(lastNameResult.isValid(ACTION), () -> "Last Name ValidatorResult for the '" + ACTION + "' action should have passed.");
+        assertTrue(lastNameResult.containsAction(ACTION), "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
+        assertTrue(lastNameResult.isValid(ACTION), "Last Name ValidatorResult for the '" + ACTION + "' action should have passed.");
     }
 
     /**
@@ -117,12 +117,12 @@ public class RequiredIfTest extends AbstractCommonTest {
         final ValidatorResult lastNameResult = results.getValidatorResult("lastName");
 
         assertNotNull(firstNameResult, "First Name ValidatorResult should not be null.");
-        assertTrue(firstNameResult.containsAction(ACTION), () -> "First Name ValidatorResult should contain the '" + ACTION + "' action.");
-        assertTrue(firstNameResult.isValid(ACTION), () -> "First Name ValidatorResult for the '" + ACTION + "' action should have passed.");
+        assertTrue(firstNameResult.containsAction(ACTION), "First Name ValidatorResult should contain the '" + ACTION + "' action.");
+        assertTrue(firstNameResult.isValid(ACTION), "First Name ValidatorResult for the '" + ACTION + "' action should have passed.");
 
         assertNotNull(lastNameResult, "Last Name ValidatorResult should not be null.");
-        assertTrue(lastNameResult.containsAction(ACTION), () -> "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
-        assertTrue(lastNameResult.isValid(ACTION), () -> "Last Name ValidatorResult for the '" + ACTION + "' action should have passed.");
+        assertTrue(lastNameResult.containsAction(ACTION), "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
+        assertTrue(lastNameResult.isValid(ACTION), "Last Name ValidatorResult for the '" + ACTION + "' action should have passed.");
     }
 
     /**
@@ -151,12 +151,12 @@ public class RequiredIfTest extends AbstractCommonTest {
         final ValidatorResult lastNameResult = results.getValidatorResult("lastName");
 
         assertNotNull(firstNameResult, "First Name ValidatorResult should not be null.");
-        assertTrue(firstNameResult.containsAction(ACTION), () -> "First Name ValidatorResult should contain the '" + ACTION + "' action.");
-        assertFalse(firstNameResult.isValid(ACTION), () -> "First Name ValidatorResult for the '" + ACTION + "' action should have failed.");
+        assertTrue(firstNameResult.containsAction(ACTION), "First Name ValidatorResult should contain the '" + ACTION + "' action.");
+        assertFalse(firstNameResult.isValid(ACTION), "First Name ValidatorResult for the '" + ACTION + "' action should have failed.");
 
         assertNotNull(lastNameResult, "Last Name ValidatorResult should not be null.");
-        assertTrue(lastNameResult.containsAction(ACTION), () -> "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
-        assertTrue(lastNameResult.isValid(ACTION), () -> "Last Name ValidatorResult for the '" + ACTION + "' action should have passed.");
+        assertTrue(lastNameResult.containsAction(ACTION), "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
+        assertTrue(lastNameResult.isValid(ACTION), "Last Name ValidatorResult for the '" + ACTION + "' action should have passed.");
     }
 
     /**
@@ -189,8 +189,8 @@ public class RequiredIfTest extends AbstractCommonTest {
         assertTrue(firstNameResult.isValid(ACTION), "First Name ValidatorResult for the '" + ACTION + "' action should have passed.");
 
         assertNotNull(lastNameResult, "Last Name ValidatorResult should not be null.");
-        assertTrue(lastNameResult.containsAction(ACTION), () -> "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
-        assertTrue(lastNameResult.isValid(ACTION), () -> "Last Name ValidatorResult for the '" + ACTION + "' action should have passed.");
+        assertTrue(lastNameResult.containsAction(ACTION), "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
+        assertTrue(lastNameResult.isValid(ACTION), "Last Name ValidatorResult for the '" + ACTION + "' action should have passed.");
 
     }
 
@@ -220,12 +220,12 @@ public class RequiredIfTest extends AbstractCommonTest {
         final ValidatorResult lastNameResult = results.getValidatorResult("lastName");
 
         assertNotNull(firstNameResult, "First Name ValidatorResult should not be null.");
-        assertTrue(firstNameResult.containsAction(ACTION), () -> "First Name ValidatorResult should contain the '" + ACTION + "' action.");
-        assertTrue(firstNameResult.isValid(ACTION), () -> "First Name ValidatorResult for the '" + ACTION + "' action should have passed.");
+        assertTrue(firstNameResult.containsAction(ACTION), "First Name ValidatorResult should contain the '" + ACTION + "' action.");
+        assertTrue(firstNameResult.isValid(ACTION), "First Name ValidatorResult for the '" + ACTION + "' action should have passed.");
 
         assertNotNull(lastNameResult, "Last Name ValidatorResult should not be null.");
-        assertTrue(lastNameResult.containsAction(ACTION), () -> "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
-        assertFalse(lastNameResult.isValid(ACTION), () -> "Last Name ValidatorResult for the '" + ACTION + "' action should have failed.");
+        assertTrue(lastNameResult.containsAction(ACTION), "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
+        assertFalse(lastNameResult.isValid(ACTION), "Last Name ValidatorResult for the '" + ACTION + "' action should have failed.");
     }
 
 }
diff --git a/src/test/java/org/apache/commons/validator/RequiredNameTest.java b/src/test/java/org/apache/commons/validator/RequiredNameTest.java
index 6578e360..05689158 100644
--- a/src/test/java/org/apache/commons/validator/RequiredNameTest.java
+++ b/src/test/java/org/apache/commons/validator/RequiredNameTest.java
@@ -83,8 +83,8 @@ public class RequiredNameTest extends AbstractCommonTest {
         final ValidatorResult lastNameResult = results.getValidatorResult("lastName");
 
         assertNotNull(firstNameResult, "First Name ValidatorResult should not be null.");
-        assertTrue(firstNameResult.containsAction(ACTION), () -> "First Name ValidatorResult should contain the '" + ACTION + "' action.");
-        assertFalse(firstNameResult.isValid(ACTION), () -> "First Name ValidatorResult for the '" + ACTION + "' action should have failed.");
+        assertTrue(firstNameResult.containsAction(ACTION), "First Name ValidatorResult should contain the '" + ACTION + "' action.");
+        assertFalse(firstNameResult.isValid(ACTION), "First Name ValidatorResult for the '" + ACTION + "' action should have failed.");
 
         assertNotNull(lastNameResult, "First Name ValidatorResult should not be null.");
         assertTrue(lastNameResult.containsAction(ACTION), "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
@@ -116,12 +116,12 @@ public class RequiredNameTest extends AbstractCommonTest {
         final ValidatorResult lastNameResult = results.getValidatorResult("lastName");
 
         assertNotNull(firstNameResult, "First Name ValidatorResult should not be null.");
-        assertTrue(firstNameResult.containsAction(ACTION), () -> "First Name ValidatorResult should contain the '" + ACTION + "' action.");
-        assertTrue(firstNameResult.isValid(ACTION), () -> "First Name ValidatorResult for the '" + ACTION + "' action should have passed.");
+        assertTrue(firstNameResult.containsAction(ACTION), "First Name ValidatorResult should contain the '" + ACTION + "' action.");
+        assertTrue(firstNameResult.isValid(ACTION), "First Name ValidatorResult for the '" + ACTION + "' action should have passed.");
 
         assertNotNull(lastNameResult, "First Name ValidatorResult should not be null.");
-        assertTrue(lastNameResult.containsAction(ACTION), () -> "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
-        assertFalse(lastNameResult.isValid(ACTION), () -> "Last Name ValidatorResult for the '" + ACTION + "' action should have failed.");
+        assertTrue(lastNameResult.containsAction(ACTION), "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
+        assertFalse(lastNameResult.isValid(ACTION), "Last Name ValidatorResult for the '" + ACTION + "' action should have failed.");
     }
 
     /**
@@ -149,12 +149,12 @@ public class RequiredNameTest extends AbstractCommonTest {
         final ValidatorResult lastNameResult = results.getValidatorResult("lastName");
 
         assertNotNull(firstNameResult, "First Name ValidatorResult should not be null.");
-        assertTrue(firstNameResult.containsAction(ACTION), () -> "First Name ValidatorResult should contain the '" + ACTION + "' action.");
-        assertFalse(firstNameResult.isValid(ACTION), () -> "First Name ValidatorResult for the '" + ACTION + "' action should have failed.");
+        assertTrue(firstNameResult.containsAction(ACTION), "First Name ValidatorResult should contain the '" + ACTION + "' action.");
+        assertFalse(firstNameResult.isValid(ACTION), "First Name ValidatorResult for the '" + ACTION + "' action should have failed.");
 
         assertNotNull(lastNameResult, "First Name ValidatorResult should not be null.");
-        assertTrue(lastNameResult.containsAction(ACTION), () -> "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
-        assertFalse(lastNameResult.isValid(ACTION), () -> "Last Name ValidatorResult for the '" + ACTION + "' action should have failed.");
+        assertTrue(lastNameResult.containsAction(ACTION), "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
+        assertFalse(lastNameResult.isValid(ACTION), "Last Name ValidatorResult for the '" + ACTION + "' action should have failed.");
     }
 
     /**
@@ -182,12 +182,12 @@ public class RequiredNameTest extends AbstractCommonTest {
         final ValidatorResult lastNameResult = results.getValidatorResult("lastName");
 
         assertNotNull(firstNameResult, "First Name ValidatorResult should not be null.");
-        assertTrue(firstNameResult.containsAction(ACTION), () -> "First Name ValidatorResult should contain the '" + ACTION + "' action.");
-        assertFalse(firstNameResult.isValid(ACTION), () -> "First Name ValidatorResult for the '" + ACTION + "' action should have failed.");
+        assertTrue(firstNameResult.containsAction(ACTION), "First Name ValidatorResult should contain the '" + ACTION + "' action.");
+        assertFalse(firstNameResult.isValid(ACTION), "First Name ValidatorResult for the '" + ACTION + "' action should have failed.");
 
         assertNotNull(lastNameResult, "First Name ValidatorResult should not be null.");
-        assertTrue(lastNameResult.containsAction(ACTION), () -> "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
-        assertTrue(lastNameResult.isValid(ACTION), () -> "Last Name ValidatorResult for the '" + ACTION + "' action should have passed.");
+        assertTrue(lastNameResult.containsAction(ACTION), "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
+        assertTrue(lastNameResult.isValid(ACTION), "Last Name ValidatorResult for the '" + ACTION + "' action should have passed.");
 
     }
 
@@ -220,8 +220,8 @@ public class RequiredNameTest extends AbstractCommonTest {
         assertFalse(firstNameResult.isValid(ACTION), "First Name ValidatorResult for the '" + ACTION + "' action should have failed.");
 
         assertNotNull(lastNameResult, "First Name ValidatorResult should not be null.");
-        assertTrue(lastNameResult.containsAction(ACTION), () -> "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
-        assertFalse(lastNameResult.isValid(ACTION), () -> "Last Name ValidatorResult for the '" + ACTION + "' action should have failed.");
+        assertTrue(lastNameResult.containsAction(ACTION), "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
+        assertFalse(lastNameResult.isValid(ACTION), "Last Name ValidatorResult for the '" + ACTION + "' action should have failed.");
     }
 
     /**
@@ -250,12 +250,12 @@ public class RequiredNameTest extends AbstractCommonTest {
         final ValidatorResult lastNameResult = results.getValidatorResult("lastName");
 
         assertNotNull(firstNameResult, "First Name ValidatorResult should not be null.");
-        assertTrue(firstNameResult.containsAction(ACTION), () -> "First Name ValidatorResult should contain the '" + ACTION + "' action.");
-        assertTrue(firstNameResult.isValid(ACTION), () -> "First Name ValidatorResult for the '" + ACTION + "' action should have passed.");
+        assertTrue(firstNameResult.containsAction(ACTION), "First Name ValidatorResult should contain the '" + ACTION + "' action.");
+        assertTrue(firstNameResult.isValid(ACTION), "First Name ValidatorResult for the '" + ACTION + "' action should have passed.");
 
         assertNotNull(lastNameResult, "First Name ValidatorResult should not be null.");
-        assertTrue(lastNameResult.containsAction(ACTION), () -> "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
-        assertTrue(lastNameResult.isValid(ACTION), () -> "Last Name ValidatorResult for the '" + ACTION + "' action should have passed.");
+        assertTrue(lastNameResult.containsAction(ACTION), "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
+        assertTrue(lastNameResult.isValid(ACTION), "Last Name ValidatorResult for the '" + ACTION + "' action should have passed.");
     }
 
 }
\ No newline at end of file
diff --git a/src/test/java/org/apache/commons/validator/ValidatorResultsTest.java b/src/test/java/org/apache/commons/validator/ValidatorResultsTest.java
index b956d071..54a8f5fb 100644
--- a/src/test/java/org/apache/commons/validator/ValidatorResultsTest.java
+++ b/src/test/java/org/apache/commons/validator/ValidatorResultsTest.java
@@ -47,8 +47,8 @@ public class ValidatorResultsTest extends AbstractCommonTest {
      */
     private void checkNotRun(final ValidatorResults results, final String field, final String action) {
         final ValidatorResult result = results.getValidatorResult(field);
-        assertNotNull(result, () -> field + " result");
-        assertFalse(result.containsAction(action), () -> field + "[" + action + "] run");
+        assertNotNull(result, field + " result");
+        assertFalse(result.containsAction(action), field + "[" + action + "] run");
         // System.out.println(field + "[" + action + "] not run");
     }
 
@@ -58,9 +58,9 @@ public class ValidatorResultsTest extends AbstractCommonTest {
     private void checkValidatorResult(final ValidatorResults results, final String field, final String action, final boolean expected) {
         final ValidatorResult result = results.getValidatorResult(field);
         // System.out.println(field + "[" + action + "]=" + result.isValid(action));
-        assertNotNull(result, () -> field + " result");
-        assertTrue(result.containsAction(action), () -> field + "[" + action + "] not run");
-        assertEquals(expected, result.isValid(action), () -> field + "[" + action + "] result");
+        assertNotNull(result, field + " result");
+        assertTrue(result.containsAction(action), field + "[" + action + "] not run");
+        assertEquals(expected, result.isValid(action), field + "[" + action + "] result");
     }
 
     /**
diff --git a/src/test/java/org/apache/commons/validator/routines/AbstractNumberValidatorTest.java b/src/test/java/org/apache/commons/validator/routines/AbstractNumberValidatorTest.java
index a9847cf8..66849f25 100644
--- a/src/test/java/org/apache/commons/validator/routines/AbstractNumberValidatorTest.java
+++ b/src/test/java/org/apache/commons/validator/routines/AbstractNumberValidatorTest.java
@@ -107,10 +107,10 @@ public abstract class AbstractNumberValidatorTest {
     public void testInvalidNotStrict() {
         for (int i = 0; i < invalid.length; i++) {
             final String text = "idx=[" + i + "] value=[" + invalid[i] + "]";
-            assertNull(validator.parse(invalid[i], null, Locale.US), () -> "(A) " + text);
-            assertFalse(validator.isValid(invalid[i], null, Locale.US), () -> "(B) " + text);
-            assertNull(validator.parse(invalid[i], testPattern, null), () -> "(C) " + text);
-            assertFalse(validator.isValid(invalid[i], testPattern, null), () -> "(D) " + text);
+            assertNull(validator.parse(invalid[i], null, Locale.US), "(A) " + text);
+            assertFalse(validator.isValid(invalid[i], null, Locale.US), "(B) " + text);
+            assertNull(validator.parse(invalid[i], testPattern, null), "(C) " + text);
+            assertFalse(validator.isValid(invalid[i], testPattern, null), "(D) " + text);
         }
     }
 
@@ -121,10 +121,10 @@ public abstract class AbstractNumberValidatorTest {
     public void testInvalidStrict() {
         for (int i = 0; i < invalidStrict.length; i++) {
             final String text = "idx=[" + i + "] value=[" + invalidStrict[i] + "]";
-            assertNull(strictValidator.parse(invalidStrict[i], null, Locale.US), () -> "(A) " + text);
-            assertFalse(strictValidator.isValid(invalidStrict[i], null, Locale.US), () -> "(B) " + text);
-            assertNull(strictValidator.parse(invalidStrict[i], testPattern, null), () -> "(C) " + text);
-            assertFalse(strictValidator.isValid(invalidStrict[i], testPattern, null), () -> "(D) " + text);
+            assertNull(strictValidator.parse(invalidStrict[i], null, Locale.US), "(A) " + text);
+            assertFalse(strictValidator.isValid(invalidStrict[i], null, Locale.US), "(B) " + text);
+            assertNull(strictValidator.parse(invalidStrict[i], testPattern, null), "(C) " + text);
+            assertFalse(strictValidator.isValid(invalidStrict[i], testPattern, null), "(D) " + text);
         }
     }
 
diff --git a/src/test/java/org/apache/commons/validator/routines/InetAddressValidatorTest.java b/src/test/java/org/apache/commons/validator/routines/InetAddressValidatorTest.java
index 49971f2e..8566dde0 100644
--- a/src/test/java/org/apache/commons/validator/routines/InetAddressValidatorTest.java
+++ b/src/test/java/org/apache/commons/validator/routines/InetAddressValidatorTest.java
@@ -672,10 +672,10 @@ public class InetAddressValidatorTest {
                 "2001:0000:1234:0000:0000:C1C0:ABCD:0876%abc%defgh", // '%' in node id
         };
         for (final String item : valid) {
-            assertTrue(validator.isValid(item), () -> String.format("%s should be valid", item));
+            assertTrue(validator.isValid(item), String.format("%s should be valid", item));
         }
         for (final String item : invalid) {
-            assertFalse(validator.isValid(item), () -> String.format("%s should be invalid", item));
+            assertFalse(validator.isValid(item), String.format("%s should be invalid", item));
         }
     }
 }
diff --git a/src/test/java/org/apache/commons/validator/routines/TimeValidatorTest.java b/src/test/java/org/apache/commons/validator/routines/TimeValidatorTest.java
index 72747901..bbeca924 100644
--- a/src/test/java/org/apache/commons/validator/routines/TimeValidatorTest.java
+++ b/src/test/java/org/apache/commons/validator/routines/TimeValidatorTest.java
@@ -198,8 +198,8 @@ public class TimeValidatorTest {
         for (int i = 0; i < localeInvalid.length; i++) {
             final String text = i + " value=[" + localeInvalid[i] + "] passed ";
             final Object date = validator.validate(localeInvalid[i], Locale.US);
-            assertNull(date, () -> "validate() " + text + date);
-            assertFalse(validator.isValid(localeInvalid[i], Locale.UK), () -> "isValid() " + text);
+            assertNull(date, "validate() " + text + date);
+            assertFalse(validator.isValid(localeInvalid[i], Locale.UK), "isValid() " + text);
         }
     }
 
@@ -211,10 +211,10 @@ public class TimeValidatorTest {
         for (int i = 0; i < localeValid.length; i++) {
             final String text = i + " value=[" + localeValid[i] + "] failed ";
             final Calendar calendar = validator.validate(localeValid[i], Locale.UK);
-            assertNotNull(calendar, () -> "validate() " + text);
+            assertNotNull(calendar, "validate() " + text);
             final Date date = calendar.getTime();
-            assertTrue(validator.isValid(localeValid[i], Locale.UK), () -> "isValid() " + text);
-            assertEquals(localeExpect[i], date, () -> "compare " + text);
+            assertTrue(validator.isValid(localeValid[i], Locale.UK), "isValid() " + text);
+            assertEquals(localeExpect[i], date, "compare " + text);
         }
     }
 
@@ -226,8 +226,8 @@ public class TimeValidatorTest {
         for (int i = 0; i < patternInvalid.length; i++) {
             final String text = i + " value=[" + patternInvalid[i] + "] passed ";
             final Object date = validator.validate(patternInvalid[i], "HH-mm-ss");
-            assertNull(date, () -> "validate() " + text + date);
-            assertFalse(validator.isValid(patternInvalid[i], "HH-mm-ss"), () -> "isValid() " + text);
+            assertNull(date, "validate() " + text + date);
+            assertFalse(validator.isValid(patternInvalid[i], "HH-mm-ss"), "isValid() " + text);
         }
     }
 
@@ -239,10 +239,10 @@ public class TimeValidatorTest {
         for (int i = 0; i < patternValid.length; i++) {
             final String text = i + " value=[" + patternValid[i] + "] failed ";
             final Calendar calendar = validator.validate(patternValid[i], "HH-mm-ss");
-            assertNotNull(calendar, () -> "validateObj() " + text);
+            assertNotNull(calendar, "validateObj() " + text);
             final Date date = calendar.getTime();
-            assertTrue(validator.isValid(patternValid[i], "HH-mm-ss"), () -> "isValid() " + text);
-            assertEquals(patternExpect[i], date, () -> "compare " + text);
+            assertTrue(validator.isValid(patternValid[i], "HH-mm-ss"), "isValid() " + text);
+            assertEquals(patternExpect[i], date, "compare " + text);
         }
     }
 
diff --git a/src/test/java/org/apache/commons/validator/routines/checkdigit/CUSIPCheckDigitTest.java b/src/test/java/org/apache/commons/validator/routines/checkdigit/CUSIPCheckDigitTest.java
index 69136900..fb5df1f2 100644
--- a/src/test/java/org/apache/commons/validator/routines/checkdigit/CUSIPCheckDigitTest.java
+++ b/src/test/java/org/apache/commons/validator/routines/checkdigit/CUSIPCheckDigitTest.java
@@ -44,14 +44,14 @@ public class CUSIPCheckDigitTest extends AbstractCheckDigitTest {
     @Test
     public void testValidator336InvalidCheckDigits() {
         for (final String invalidCheckDigit : INVALID_CHECK_DIGITS) {
-            assertFalse(routine.isValid(invalidCheckDigit), () -> "Should fail: " + invalidCheckDigit);
+            assertFalse(routine.isValid(invalidCheckDigit), "Should fail: " + invalidCheckDigit);
         }
     }
 
     @Test
     public void testValidator336ValidCheckDigits() {
         for (final String validCheckDigit : VALID_CHECK_DIGITS) {
-            assertTrue(routine.isValid(validCheckDigit), () -> "Should fail: " + validCheckDigit);
+            assertTrue(routine.isValid(validCheckDigit), "Should fail: " + validCheckDigit);
         }
     }
 }
diff --git a/src/test/java/org/apache/commons/validator/routines/checkdigit/ISINCheckDigitTest.java b/src/test/java/org/apache/commons/validator/routines/checkdigit/ISINCheckDigitTest.java
index f84ec5ce..62b9cb25 100644
--- a/src/test/java/org/apache/commons/validator/routines/checkdigit/ISINCheckDigitTest.java
+++ b/src/test/java/org/apache/commons/validator/routines/checkdigit/ISINCheckDigitTest.java
@@ -54,7 +54,7 @@ public class ISINCheckDigitTest extends AbstractCheckDigitTest {
     @Test
     public void testValidator345() {
         for (final String invalidCheckDigit : INVALID_CHECK_DIGITS) {
-            assertFalse(routine.isValid(invalidCheckDigit), () -> "Should fail: " + invalidCheckDigit);
+            assertFalse(routine.isValid(invalidCheckDigit), "Should fail: " + invalidCheckDigit);
         }
     }
 }
diff --git a/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenCUSIPCheckDigitTest.java b/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenCUSIPCheckDigitTest.java
index 1217ef90..8dd23b9a 100644
--- a/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenCUSIPCheckDigitTest.java
+++ b/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenCUSIPCheckDigitTest.java
@@ -44,14 +44,14 @@ public class ModulusTenCUSIPCheckDigitTest extends AbstractCheckDigitTest {
     @Test
     public void testValidator336InvalidCheckDigits() {
         for (final String invalidCheckDigit : INVALID_CHECK_DIGITS) {
-            assertFalse(routine.isValid(invalidCheckDigit), () -> "Should fail: " + invalidCheckDigit);
+            assertFalse(routine.isValid(invalidCheckDigit), "Should fail: " + invalidCheckDigit);
         }
     }
 
     @Test
     public void testValidator336ValidCheckDigits() {
         for (final String validCheckDigit : VALID_CHECK_DIGITS) {
-            assertTrue(routine.isValid(validCheckDigit), () -> "Should fail: " + validCheckDigit);
+            assertTrue(routine.isValid(validCheckDigit), "Should fail: " + validCheckDigit);
         }
     }
 }
diff --git a/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenSedolCheckDigitTest.java b/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenSedolCheckDigitTest.java
index 90d03eb0..12458a83 100644
--- a/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenSedolCheckDigitTest.java
+++ b/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenSedolCheckDigitTest.java
@@ -47,7 +47,7 @@ public class ModulusTenSedolCheckDigitTest extends AbstractCheckDigitTest {
     @Test
     public void testValidator346() {
         for (final String invalidCheckDigit : INVALID_CHECK_DIGITS) {
-            assertFalse(routine.isValid(invalidCheckDigit), () -> "Should fail: " + invalidCheckDigit);
+            assertFalse(routine.isValid(invalidCheckDigit), "Should fail: " + invalidCheckDigit);
         }
     }
 
diff --git a/src/test/java/org/apache/commons/validator/routines/checkdigit/SedolCheckDigitTest.java b/src/test/java/org/apache/commons/validator/routines/checkdigit/SedolCheckDigitTest.java
index 47017a36..43712ed6 100644
--- a/src/test/java/org/apache/commons/validator/routines/checkdigit/SedolCheckDigitTest.java
+++ b/src/test/java/org/apache/commons/validator/routines/checkdigit/SedolCheckDigitTest.java
@@ -47,7 +47,7 @@ public class SedolCheckDigitTest extends AbstractCheckDigitTest {
     @Test
     public void testValidator346() {
         for (final String invalidCheckDigit : INVALID_CHECK_DIGITS) {
-            assertFalse(routine.isValid(invalidCheckDigit), () -> "Should fail: " + invalidCheckDigit);
+            assertFalse(routine.isValid(invalidCheckDigit), "Should fail: " + invalidCheckDigit);
         }
     }
 


(commons-validator) 03/11: Replace org.junit.Assert with org.junit.jupiter.api.Assertions

Posted by eb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ebourg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-validator.git

commit 4b2e3dc040ec42e83b356e199796be52844f0b45
Author: Emmanuel Bourg <eb...@apache.org>
AuthorDate: Mon Nov 18 10:24:47 2024 +0100

    Replace org.junit.Assert with org.junit.jupiter.api.Assertions
---
 .../commons/validator/routines/checkdigit/IBANCheckDigitTest.java | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/test/java/org/apache/commons/validator/routines/checkdigit/IBANCheckDigitTest.java b/src/test/java/org/apache/commons/validator/routines/checkdigit/IBANCheckDigitTest.java
index 67069637..84e2984f 100644
--- a/src/test/java/org/apache/commons/validator/routines/checkdigit/IBANCheckDigitTest.java
+++ b/src/test/java/org/apache/commons/validator/routines/checkdigit/IBANCheckDigitTest.java
@@ -16,12 +16,14 @@
  */
 package org.apache.commons.validator.routines.checkdigit;
 
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
 import java.io.BufferedReader;
 import java.io.InputStreamReader;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.junit.Assert;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 
@@ -201,9 +203,9 @@ public class IBANCheckDigitTest extends AbstractCheckDigitTest {
                 if (!line.startsWith("#") && !line.isEmpty()) {
                     if (line.startsWith("-")) {
                         line = line.substring(1);
-                        Assert.assertFalse(line, routine.isValid(line.replace(" ", "")));
+                        assertFalse(routine.isValid(line.replace(" ", "")), line);
                     } else {
-                        Assert.assertTrue(line, routine.isValid(line.replace(" ", "")));
+                        assertTrue(routine.isValid(line.replace(" ", "")), line);
                     }
                 }
             }