Re: (commons-validator) branch master updated: Fix deprecations in test classes

sebb <[email protected]> Wed, 24 Jun 2026 13:38:13 +0100
Newsgroups gmane.comp.jakarta.commons.devel
Message-ID <CAOGo0Va3k8KgvZR_RS0KSCUPGG8mszNSpMRQvmkMAFhVCdYMSg@mail.gmail.com>
On Wed, 24 Jun 2026 at 13:02, Gary Gregory <[email protected]> wrote:
>
> This can't be a good idea. Deprecated APIs MUST still be tested!

Perhaps true for the Validator methods, but they are just renames.

> What am I missing?

The other deprecations are in CSV, which is a separate component.

> Gary
>
> On Wed, Jun 24, 2026 at 7:39=E2=80=AFAM <[email protected]> wrote:
> >
> > This is an automated email from the ASF dual-hosted git repository.
> >
> > asf-gitbox-commits pushed a commit to branch master
> > in repository https://gitbox.apache.org/repos/asf/commons-validator.git
> >
> >
> > The following commit(s) were added to refs/heads/master by this push:
> >      new 1cfcfc9b Fix deprecations in test classes
> > 1cfcfc9b is described below
> >
> > commit 1cfcfc9bc8564584c2d300dc78262ef6fa174cfe
> > Author: Sebb <[email protected]>
> > AuthorDate: Wed Jun 24 12:38:58 2026 +0100
> >
> >     Fix deprecations in test classes
> > ---
> >  src/changes/changes.xml                                           | 1 =
+
> >  src/test/java/org/apache/commons/validator/ValidatorTest.java     | 4 =
++--
> >  .../org/apache/commons/validator/routines/IBANValidatorTest.java  | 8 =
++++----
> >  3 files changed, 7 insertions(+), 6 deletions(-)
> >
> > diff --git a/src/changes/changes.xml b/src/changes/changes.xml
> > index a5821a44..cc072d21 100644
> > --- a/src/changes/changes.xml
> > +++ b/src/changes/changes.xml
> > @@ -91,6 +91,7 @@ The <action> type attribute can be add,update,fix,rem=
ove.
> >      <action type=3D"fix" dev=3D"ggregory" due-to=3D"sahvx655-wq, Gary =
Gregory">Preserve exact value in BigDecimal and BigInteger validate (#406).=
</action>
> >      <action type=3D"fix" dev=3D"ggregory" due-to=3D"sahvx655-wq, Gary =
Gregory">Preserve fractional bound in BigIntegerValidator range checks (#40=
7).</action>
> >      <action type=3D"fix" dev=3D"sebb" due-to=3D"sahvx655-wq">DomainVal=
idatorTest: ensure CC is in correct list (#409).</action>
> > +    <action type=3D"fix" dev=3D"sebb">Fix deprecations in test classes=
.</action>
> >      <!-- ADD -->
> >      <action type=3D"add" dev=3D"ggregory" due-to=3D"Gary Gregory">Add =
and use CheckDigitException.CheckDigitException(String, Object...) (#389).<=
/action>
> >      <action type=3D"add" dev=3D"ggregory" due-to=3D"Gary Gregory">Add =
and use ValidatorException.ValidatorException(Throwable). Call sites that p=
reviously called new ValidatorException(Throwable#getMessage()) now preserv=
e that exception (#390).</action>
> > diff --git a/src/test/java/org/apache/commons/validator/ValidatorTest.j=
ava b/src/test/java/org/apache/commons/validator/ValidatorTest.java
> > index 3ae9e4ab..ffd02bbf 100644
> > --- a/src/test/java/org/apache/commons/validator/ValidatorTest.java
> > +++ b/src/test/java/org/apache/commons/validator/ValidatorTest.java
> > @@ -101,7 +101,7 @@ class ValidatorTest {
> >
> >          final ValidatorAction va =3D new ValidatorAction();
> >          va.setName(action);
> > -        va.setClassname("org.apache.commons.validator.ValidatorTest");
> > +        va.setClassName("org.apache.commons.validator.ValidatorTest");
> >          va.setMethod("formatDate");
> >          va.setMethodParams("java.lang.Object,org.apache.commons.valida=
tor.Field");
> >
> > @@ -185,7 +185,7 @@ class ValidatorTest {
> >
> >          final ValidatorAction va =3D new ValidatorAction();
> >          va.setName("capLetter");
> > -        va.setClassname("org.apache.commons.validator.ValidatorTest");
> > +        va.setClassName("org.apache.commons.validator.ValidatorTest");
> >          va.setMethod("isCapLetter");
> >          va.setMethodParams("java.lang.Object,org.apache.commons.valida=
tor.Field,java.util.List");
> >
> > diff --git a/src/test/java/org/apache/commons/validator/routines/IBANVa=
lidatorTest.java b/src/test/java/org/apache/commons/validator/routines/IBAN=
ValidatorTest.java
> > index 646db562..95c90898 100644
> > --- a/src/test/java/org/apache/commons/validator/routines/IBANValidator=
Test.java
> > +++ b/src/test/java/org/apache/commons/validator/routines/IBANValidator=
Test.java
> > @@ -275,7 +275,7 @@ class IBANValidatorTest {
> >      static Collection<Arguments> ibanRegistrySource() throws Exception=
 {
> >          final Path ibanRegistry =3D Paths.get(IBANValidator.class.getR=
esource(IBAN_REGISTRY).toURI());
> >
> > -        final CSVFormat format =3D CSVFormat.DEFAULT.builder().setDeli=
miter('\t').build();
> > +        final CSVFormat format =3D CSVFormat.DEFAULT.builder().setDeli=
miter('\t').get();
> >          final Reader rdr =3D Files.newBufferedReader(ibanRegistry, IBA=
N_REGISTRY_CHARSET);
> >
> >          CSVRecord country =3D null;
> > @@ -284,7 +284,7 @@ class IBANValidatorTest {
> >          CSVRecord structure =3D null;
> >          CSVRecord length =3D null;
> >
> > -        try (CSVParser p =3D new CSVParser(rdr, format)) {
> > +        try (CSVParser p =3D CSVParser.builder().setReader(rdr).setFor=
mat(format).get()) {
> >              for (final CSVRecord o : p) {
> >                  final String item =3D o.get(0);
> >                  switch (item) {
> > @@ -333,14 +333,14 @@ class IBANValidatorTest {
> >      static Collection<Arguments> ibanRegistrySourceExamples() throws E=
xception {
> >          final Path ibanRegistry =3D Paths.get(IBANValidator.class.getR=
esource(IBAN_REGISTRY).toURI());
> >
> > -        final CSVFormat format =3D CSVFormat.DEFAULT.builder().setDeli=
miter('\t').build();
> > +        final CSVFormat format =3D CSVFormat.DEFAULT.builder().setDeli=
miter('\t').get();
> >          final Reader rdr =3D Files.newBufferedReader(ibanRegistry, IBA=
N_REGISTRY_CHARSET);
> >
> >          CSVRecord country =3D null;
> >          CSVRecord electronicExample =3D null;
> >          CSVRecord lastUpdateDate =3D null;
> >
> > -        try (CSVParser p =3D new CSVParser(rdr, format)) {
> > +        try (CSVParser p =3D CSVParser.builder().setReader(rdr).setFor=
mat(format).get()) {
> >              for (final CSVRecord o : p) {
> >                  final String item =3D o.get(0);
> >                  switch (item) {
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>