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

sebb <[email protected]> Wed, 24 Jun 2026 13:41:04 +0100
Newsgroups gmane.comp.jakarta.commons.devel
Message-ID <CAOGo0VatDjA2WfNDOR2c6tSP_dVpX-MG490Qry9eAku-fXWtXA@mail.gmail.com>
On Wed, 24 Jun 2026 at 13:38, sebb <[email protected]> wrote:
>
> 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.

Also note that the new method was not previously being tested.

> > 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.g=
it
> > >
> > >
> > > 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,r=
emove.
> > >      <action type=3D"fix" dev=3D"ggregory" due-to=3D"sahvx655-wq, Gar=
y Gregory">Preserve exact value in BigDecimal and BigInteger validate (#406=
).</action>
> > >      <action type=3D"fix" dev=3D"ggregory" due-to=3D"sahvx655-wq, Gar=
y Gregory">Preserve fractional bound in BigIntegerValidator range checks (#=
407).</action>
> > >      <action type=3D"fix" dev=3D"sebb" due-to=3D"sahvx655-wq">DomainV=
alidatorTest: ensure CC is in correct list (#409).</action>
> > > +    <action type=3D"fix" dev=3D"sebb">Fix deprecations in test class=
es.</action>
> > >      <!-- ADD -->
> > >      <action type=3D"add" dev=3D"ggregory" due-to=3D"Gary Gregory">Ad=
d and use CheckDigitException.CheckDigitException(String, Object...) (#389)=
.</action>
> > >      <action type=3D"add" dev=3D"ggregory" due-to=3D"Gary Gregory">Ad=
d and use ValidatorException.ValidatorException(Throwable). Call sites that=
 previously called new ValidatorException(Throwable#getMessage()) now prese=
rve that exception (#390).</action>
> > > diff --git a/src/test/java/org/apache/commons/validator/ValidatorTest=
.java 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.vali=
dator.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.vali=
dator.Field,java.util.List");
> > >
> > > diff --git a/src/test/java/org/apache/commons/validator/routines/IBAN=
ValidatorTest.java b/src/test/java/org/apache/commons/validator/routines/IB=
ANValidatorTest.java
> > > index 646db562..95c90898 100644
> > > --- a/src/test/java/org/apache/commons/validator/routines/IBANValidat=
orTest.java
> > > +++ b/src/test/java/org/apache/commons/validator/routines/IBANValidat=
orTest.java
> > > @@ -275,7 +275,7 @@ class IBANValidatorTest {
> > >      static Collection<Arguments> ibanRegistrySource() throws Excepti=
on {
> > >          final Path ibanRegistry =3D Paths.get(IBANValidator.class.ge=
tResource(IBAN_REGISTRY).toURI());
> > >
> > > -        final CSVFormat format =3D CSVFormat.DEFAULT.builder().setDe=
limiter('\t').build();
> > > +        final CSVFormat format =3D CSVFormat.DEFAULT.builder().setDe=
limiter('\t').get();
> > >          final Reader rdr =3D Files.newBufferedReader(ibanRegistry, I=
BAN_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).setF=
ormat(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=
 Exception {
> > >          final Path ibanRegistry =3D Paths.get(IBANValidator.class.ge=
tResource(IBAN_REGISTRY).toURI());
> > >
> > > -        final CSVFormat format =3D CSVFormat.DEFAULT.builder().setDe=
limiter('\t').build();
> > > +        final CSVFormat format =3D CSVFormat.DEFAULT.builder().setDe=
limiter('\t').get();
> > >          final Reader rdr =3D Files.newBufferedReader(ibanRegistry, I=
BAN_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).setF=
ormat(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]
> >