Re: (commons-validator) branch master updated: Fix deprecations in test classes
Gary Gregory <[email protected]> Wed, 24 Jun 2026 08:02:24 -0400
| Newsgroups | gmane.comp.jakarta.commons.devel |
|---|---|
| Message-ID | <CACZkXPwkWP8U0upvdhmYgrAd5zpsXf-fKgoBqTt7u42H1M81Eg@mail.gmail.com> |
This can't be a good idea. Deprecated APIs MUST still be tested! What am I missing? 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,remov= e. > <action type=3D"fix" dev=3D"ggregory" due-to=3D"sahvx655-wq, Gary Gr= egory">Preserve exact value in BigDecimal and BigInteger validate (#406).</= action> > <action type=3D"fix" dev=3D"ggregory" due-to=3D"sahvx655-wq, Gary Gr= egory">Preserve fractional bound in BigIntegerValidator range checks (#407)= .</action> > <action type=3D"fix" dev=3D"sebb" due-to=3D"sahvx655-wq">DomainValid= atorTest: 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 an= d use CheckDigitException.CheckDigitException(String, Object...) (#389).</a= ction> > <action type=3D"add" dev=3D"ggregory" due-to=3D"Gary Gregory">Add an= d use ValidatorException.ValidatorException(Throwable). Call sites that pre= viously called new ValidatorException(Throwable#getMessage()) now preserve = that exception (#390).</action> > diff --git a/src/test/java/org/apache/commons/validator/ValidatorTest.jav= a 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.validato= r.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.validato= r.Field,java.util.List"); > > diff --git a/src/test/java/org/apache/commons/validator/routines/IBANVali= datorTest.java b/src/test/java/org/apache/commons/validator/routines/IBANVa= lidatorTest.java > index 646db562..95c90898 100644 > --- a/src/test/java/org/apache/commons/validator/routines/IBANValidatorTe= st.java > +++ b/src/test/java/org/apache/commons/validator/routines/IBANValidatorTe= st.java > @@ -275,7 +275,7 @@ class IBANValidatorTest { > static Collection<Arguments> ibanRegistrySource() throws Exception { > final Path ibanRegistry =3D Paths.get(IBANValidator.class.getRes= ource(IBAN_REGISTRY).toURI()); > > - final CSVFormat format =3D CSVFormat.DEFAULT.builder().setDelimi= ter('\t').build(); > + final CSVFormat format =3D CSVFormat.DEFAULT.builder().setDelimi= ter('\t').get(); > final Reader rdr =3D Files.newBufferedReader(ibanRegistry, IBAN_= 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).setForma= t(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 Exc= eption { > final Path ibanRegistry =3D Paths.get(IBANValidator.class.getRes= ource(IBAN_REGISTRY).toURI()); > > - final CSVFormat format =3D CSVFormat.DEFAULT.builder().setDelimi= ter('\t').build(); > + final CSVFormat format =3D CSVFormat.DEFAULT.builder().setDelimi= ter('\t').get(); > final Reader rdr =3D Files.newBufferedReader(ibanRegistry, IBAN_= 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).setForma= t(format).get()) { > for (final CSVRecord o : p) { > final String item =3D o.get(0); > switch (item) { >