You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2024/12/26 15:29:36 UTC

(commons-validator) branch master updated (48e7dd82 -> 97e7669d)

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

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


    from 48e7dd82 Use JUnit Pioneer instead of direct global variables access
     new a8cac181 Remove unused test code
     new 7f2f8328 Use JUnit Pioneer instead of direct global variables access
     new 97e7669d Use JUnit Pioneer instead of direct global variables access

The 3 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:
 .../org/apache/commons/validator/routines/DateValidatorTest.java  | 1 -
 .../apache/commons/validator/routines/PercentValidatorTest.java   | 5 ++---
 .../org/apache/commons/validator/routines/TimeValidatorTest.java  | 8 +-------
 3 files changed, 3 insertions(+), 11 deletions(-)


(commons-validator) 01/03: Remove unused test code

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

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

commit a8cac1819736a42dfd18938d77f4800cf6508dfc
Author: Gary D. Gregory <ga...@gmail.com>
AuthorDate: Thu Dec 26 10:28:07 2024 -0500

    Remove unused test code
---
 .../java/org/apache/commons/validator/routines/TimeValidatorTest.java | 4 ----
 1 file changed, 4 deletions(-)

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 9acfcba6..2ceb2cfe 100644
--- a/src/test/java/org/apache/commons/validator/routines/TimeValidatorTest.java
+++ b/src/test/java/org/apache/commons/validator/routines/TimeValidatorTest.java
@@ -112,15 +112,12 @@ public class TimeValidatorTest {
             , "10::1" // invalid pattern
             , "10:1:" }; // invalid pattern
 
-    private Locale origDefault;
-
     private TimeZone defaultZone;
 
     @BeforeEach
     protected void setUp() {
         validator = new TimeValidator();
         defaultZone = TimeZone.getDefault();
-        origDefault = Locale.getDefault();
     }
 
     /**
@@ -129,7 +126,6 @@ public class TimeValidatorTest {
     @AfterEach
     protected void tearDown() {
         validator = null;
-        Locale.setDefault(origDefault);
         TimeZone.setDefault(defaultZone);
     }
 


(commons-validator) 02/03: Use JUnit Pioneer instead of direct global variables access

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

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

commit 7f2f832838f24aefa0771d8a6592f095685b4361
Author: Gary D. Gregory <ga...@gmail.com>
AuthorDate: Thu Dec 26 10:28:50 2024 -0500

    Use JUnit Pioneer instead of direct global variables access
---
 .../java/org/apache/commons/validator/routines/TimeValidatorTest.java | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

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 2ceb2cfe..8148f073 100644
--- a/src/test/java/org/apache/commons/validator/routines/TimeValidatorTest.java
+++ b/src/test/java/org/apache/commons/validator/routines/TimeValidatorTest.java
@@ -179,10 +179,8 @@ public class TimeValidatorTest {
      * Test Invalid Dates with "locale" validation
      */
     @Test
+    @DefaultLocale("en-GB")
     public void testFormat() {
-        // Set the default Locale
-        Locale.setDefault(Locale.UK);
-
         // The JVM format varies; calculate expected results
         final Calendar cal = createTime(null, 164923, 0);
         final DateFormat df = DateFormat.getTimeInstance(DateFormat.SHORT);


(commons-validator) 03/03: Use JUnit Pioneer instead of direct global variables access

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

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

commit 97e7669d717ad5248f5ea622071d6f8af5a19cd2
Author: Gary D. Gregory <ga...@gmail.com>
AuthorDate: Thu Dec 26 10:29:27 2024 -0500

    Use JUnit Pioneer instead of direct global variables access
---
 .../org/apache/commons/validator/routines/DateValidatorTest.java     | 1 -
 .../org/apache/commons/validator/routines/PercentValidatorTest.java  | 5 ++---
 2 files changed, 2 insertions(+), 4 deletions(-)

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 d8c0e616..f302262d 100644
--- a/src/test/java/org/apache/commons/validator/routines/DateValidatorTest.java
+++ b/src/test/java/org/apache/commons/validator/routines/DateValidatorTest.java
@@ -29,7 +29,6 @@ import java.util.Date;
 import java.util.Locale;
 import java.util.TimeZone;
 
-import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import org.junitpioneer.jupiter.DefaultLocale;
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 1bbc7465..88146f6b 100644
--- a/src/test/java/org/apache/commons/validator/routines/PercentValidatorTest.java
+++ b/src/test/java/org/apache/commons/validator/routines/PercentValidatorTest.java
@@ -26,6 +26,7 @@ import java.util.Locale;
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
+import org.junitpioneer.jupiter.DefaultLocale;
 
 /**
  * Test Case for PercentValidator.
@@ -85,10 +86,8 @@ public class PercentValidatorTest {
      * Test Valid percentage values
      */
     @Test
+    @DefaultLocale("en-GB")
     public void testValid() {
-        // Set the default Locale
-        Locale.setDefault(Locale.UK);
-
         final BigDecimalValidator validator = PercentValidator.getInstance();
         final BigDecimal expected = new BigDecimal("0.12");
         final BigDecimal negative = new BigDecimal("-0.12");