308eb5
From 98753efcb2ff4d531a1eca08ded5c227ae6149b6 Mon Sep 17 00:00:00 2001
308eb5
From: Mikolaj Izdebski <mizdebsk@redhat.com>
308eb5
Date: Thu, 11 Mar 2021 13:14:20 +0100
308eb5
Subject: [PATCH] Remove test dependency on JUnit Pioneer
308eb5
308eb5
sed -i '/<groupId>org.junit-pioneer/,/<dependency>/d' pom.xml
308eb5
308eb5
sed -i '/^import org.junitpioneer/ d
308eb5
        /@Default\(Locale\|TimeZone\)([^)]*)/ {
308eb5
          h
308eb5
          d
308eb5
        }
308eb5
        /@Test/ {
308eb5
          x
308eb5
          s/\( *\)..*/\1@org.junit.jupiter.api.Disabled("JUnit Pioneer not available")/
308eb5
          /./p
308eb5
          s/.*//
308eb5
          x
308eb5
        }' $(grep org.junitpioneer -rl src/test/java/)
308eb5
---
308eb5
 pom.xml                                            |  6 ------
308eb5
 .../commons/lang3/StringUtilsContainsTest.java     |  3 +--
308eb5
 .../commons/lang3/time/DateFormatUtilsTest.java    |  6 ++----
308eb5
 .../apache/commons/lang3/time/DateUtilsTest.java   | 11 +++++------
308eb5
 .../commons/lang3/time/FastDateFormatTest.java     | 14 +++++---------
308eb5
 .../commons/lang3/time/FastDatePrinterTest.java    | 10 +++-------
308eb5
 6 files changed, 16 insertions(+), 34 deletions(-)
308eb5
308eb5
diff --git a/pom.xml b/pom.xml
308eb5
index 167a85a47..d08c66336 100644
308eb5
--- a/pom.xml
308eb5
+++ b/pom.xml
308eb5
@@ -533,12 +533,6 @@
308eb5
       <artifactId>junit-jupiter</artifactId>
308eb5
       <scope>test</scope>
308eb5
     </dependency>
308eb5
-    <dependency>
308eb5
-      <groupId>org.junit-pioneer</groupId>
308eb5
-      <artifactId>junit-pioneer</artifactId>
308eb5
-      <version>1.3.0</version>
308eb5
-      <scope>test</scope>
308eb5
-    </dependency>
308eb5
     <dependency>
308eb5
       <groupId>org.hamcrest</groupId>
308eb5
       <artifactId>hamcrest</artifactId>
308eb5
diff --git a/src/test/java/org/apache/commons/lang3/StringUtilsContainsTest.java b/src/test/java/org/apache/commons/lang3/StringUtilsContainsTest.java
308eb5
index 6ef2732a1..2e9d44f55 100644
308eb5
--- a/src/test/java/org/apache/commons/lang3/StringUtilsContainsTest.java
308eb5
+++ b/src/test/java/org/apache/commons/lang3/StringUtilsContainsTest.java
308eb5
@@ -23,7 +23,6 @@
308eb5
 import java.util.Locale;
308eb5
 
308eb5
 import org.junit.jupiter.api.Test;
308eb5
-import org.junitpioneer.jupiter.DefaultLocale;
308eb5
 
308eb5
 /**
308eb5
  * Unit tests {@link org.apache.commons.lang3.StringUtils} - Contains methods
308eb5
@@ -248,7 +247,7 @@ public void testContainsAny_StringWithSupplementaryChars() {
308eb5
         assertFalse(StringUtils.containsAny(CharU20001, CharU20000));
308eb5
     }
308eb5
 
308eb5
-    @DefaultLocale(language = "de", country = "DE")
308eb5
+    @org.junit.jupiter.api.Disabled("JUnit Pioneer not available")
308eb5
     @Test
308eb5
     public void testContainsIgnoreCase_LocaleIndependence() {
308eb5
         final Locale[] locales = { Locale.ENGLISH, new Locale("tr"), Locale.getDefault() };
308eb5
diff --git a/src/test/java/org/apache/commons/lang3/time/DateFormatUtilsTest.java b/src/test/java/org/apache/commons/lang3/time/DateFormatUtilsTest.java
308eb5
index cff1aac5e..515650a98 100644
308eb5
--- a/src/test/java/org/apache/commons/lang3/time/DateFormatUtilsTest.java
308eb5
+++ b/src/test/java/org/apache/commons/lang3/time/DateFormatUtilsTest.java
308eb5
@@ -30,8 +30,6 @@
308eb5
 import java.util.TimeZone;
308eb5
 
308eb5
 import org.junit.jupiter.api.Test;
308eb5
-import org.junitpioneer.jupiter.DefaultLocale;
308eb5
-import org.junitpioneer.jupiter.DefaultTimeZone;
308eb5
 
308eb5
 /**
308eb5
  * TestCase for DateFormatUtils.
308eb5
@@ -153,7 +151,7 @@ public void testLANG1000() throws Exception {
308eb5
         DateFormatUtils.ISO_DATETIME_TIME_ZONE_FORMAT.parse(date);
308eb5
     }
308eb5
 
308eb5
-    @DefaultTimeZone("UTC")
308eb5
+    @org.junit.jupiter.api.Disabled("JUnit Pioneer not available")
308eb5
     @Test
308eb5
     public void testLang530() throws ParseException {
308eb5
         final Date d = new Date();
308eb5
@@ -205,7 +203,7 @@ public void testLang916() {
308eb5
         }
308eb5
     }
308eb5
 
308eb5
-    @DefaultLocale(language = "en")
308eb5
+    @org.junit.jupiter.api.Disabled("JUnit Pioneer not available")
308eb5
     @Test
308eb5
     public void testSMTP() {
308eb5
         TimeZone timeZone = TimeZone.getTimeZone("GMT-3");
308eb5
diff --git a/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java b/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java
308eb5
index dd6025dce..00a97010e 100644
308eb5
--- a/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java
308eb5
+++ b/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java
308eb5
@@ -39,7 +39,6 @@
308eb5
 import org.junit.jupiter.api.BeforeAll;
308eb5
 import org.junit.jupiter.api.BeforeEach;
308eb5
 import org.junit.jupiter.api.Test;
308eb5
-import org.junitpioneer.jupiter.DefaultLocale;
308eb5
 
308eb5
 /**
308eb5
  * Unit tests {@link org.apache.commons.lang3.time.DateUtils}.
308eb5
@@ -795,13 +794,13 @@ public void testLANG799() throws ParseException {
308eb5
     }
308eb5
 
308eb5
     // Parse English date with German Locale
308eb5
-    @DefaultLocale(language = "de")
308eb5
+    @org.junit.jupiter.api.Disabled("JUnit Pioneer not available")
308eb5
     @Test
308eb5
     public void testLANG799_DE_FAIL() {
308eb5
         assertThrows(ParseException.class, () -> DateUtils.parseDate("Wed, 09 Apr 2008 23:55:38 GMT", "EEE, dd MMM yyyy HH:mm:ss zzz"));
308eb5
     }
308eb5
 
308eb5
-    @DefaultLocale(language = "de")
308eb5
+    @org.junit.jupiter.api.Disabled("JUnit Pioneer not available")
308eb5
     @Test
308eb5
     public void testLANG799_DE_OK() throws ParseException {
308eb5
         DateUtils.parseDate("Mi, 09 Apr 2008 23:55:38 GMT", "EEE, dd MMM yyyy HH:mm:ss zzz");
308eb5
@@ -809,13 +808,13 @@ public void testLANG799_DE_OK() throws ParseException {
308eb5
     }
308eb5
 
308eb5
     // Parse German date with English Locale
308eb5
-    @DefaultLocale(language = "en")
308eb5
+    @org.junit.jupiter.api.Disabled("JUnit Pioneer not available")
308eb5
     @Test
308eb5
     public void testLANG799_EN_FAIL() {
308eb5
         assertThrows(ParseException.class, () -> DateUtils.parseDate("Mi, 09 Apr 2008 23:55:38 GMT", "EEE, dd MMM yyyy HH:mm:ss zzz"));
308eb5
     }
308eb5
 
308eb5
-    @DefaultLocale(language = "en")
308eb5
+    @org.junit.jupiter.api.Disabled("JUnit Pioneer not available")
308eb5
     @Test
308eb5
     public void testLANG799_EN_OK() throws ParseException {
308eb5
         DateUtils.parseDate("Wed, 09 Apr 2008 23:55:38 GMT", "EEE, dd MMM yyyy HH:mm:ss zzz");
308eb5
@@ -823,7 +822,7 @@ public void testLANG799_EN_OK() throws ParseException {
308eb5
     }
308eb5
 
308eb5
     // Parse German date with English Locale, specifying German Locale override
308eb5
-    @DefaultLocale(language = "en")
308eb5
+    @org.junit.jupiter.api.Disabled("JUnit Pioneer not available")
308eb5
     @Test
308eb5
     public void testLANG799_EN_WITH_DE_LOCALE() throws ParseException {
308eb5
         DateUtils.parseDate("Mi, 09 Apr 2008 23:55:38 GMT", Locale.GERMAN, "EEE, dd MMM yyyy HH:mm:ss zzz");
308eb5
diff --git a/src/test/java/org/apache/commons/lang3/time/FastDateFormatTest.java b/src/test/java/org/apache/commons/lang3/time/FastDateFormatTest.java
308eb5
index b945d1748..fcf41956d 100644
308eb5
--- a/src/test/java/org/apache/commons/lang3/time/FastDateFormatTest.java
308eb5
+++ b/src/test/java/org/apache/commons/lang3/time/FastDateFormatTest.java
308eb5
@@ -36,8 +36,6 @@
308eb5
 import java.util.concurrent.atomic.AtomicLongArray;
308eb5
 
308eb5
 import org.junit.jupiter.api.Test;
308eb5
-import org.junitpioneer.jupiter.DefaultLocale;
308eb5
-import org.junitpioneer.jupiter.DefaultTimeZone;
308eb5
 
308eb5
 /**
308eb5
  * Unit tests {@link org.apache.commons.lang3.time.FastDateFormat}.
308eb5
@@ -92,7 +90,7 @@ private AtomicLongArray measureTime(final Format printer, final Format parser) t
308eb5
         return totalElapsed;
308eb5
     }
308eb5
 
308eb5
-    @DefaultLocale(language = "en", country = "US")
308eb5
+    @org.junit.jupiter.api.Disabled("JUnit Pioneer not available")
308eb5
     @Test
308eb5
     public void test_changeDefault_Locale_DateInstance() {
308eb5
         final FastDateFormat format1 = FastDateFormat.getDateInstance(FastDateFormat.FULL, Locale.GERMANY);
308eb5
@@ -107,7 +105,7 @@ public void test_changeDefault_Locale_DateInstance() {
308eb5
         assertNotSame(format2, format3);
308eb5
     }
308eb5
 
308eb5
-    @DefaultLocale(language = "en", country = "US")
308eb5
+    @org.junit.jupiter.api.Disabled("JUnit Pioneer not available")
308eb5
     @Test
308eb5
     public void test_changeDefault_Locale_DateTimeInstance() {
308eb5
         final FastDateFormat format1 = FastDateFormat.getDateTimeInstance(FastDateFormat.FULL, FastDateFormat.FULL, Locale.GERMANY);
308eb5
@@ -147,7 +145,7 @@ public void test_getInstance_String() {
308eb5
         assertEquals(TimeZone.getDefault(), format2.getTimeZone());
308eb5
     }
308eb5
 
308eb5
-    @DefaultLocale(language = "en", country = "US")
308eb5
+    @org.junit.jupiter.api.Disabled("JUnit Pioneer not available")
308eb5
     @Test
308eb5
     public void test_getInstance_String_Locale() {
308eb5
         final FastDateFormat format1 = FastDateFormat.getInstance("MM/DD/yyyy", Locale.GERMANY);
308eb5
@@ -159,8 +157,7 @@ public void test_getInstance_String_Locale() {
308eb5
         assertEquals(Locale.GERMANY, format1.getLocale());
308eb5
     }
308eb5
 
308eb5
-    @DefaultLocale(language = "en", country = "US")
308eb5
-    @DefaultTimeZone("America/New_York")
308eb5
+    @org.junit.jupiter.api.Disabled("JUnit Pioneer not available")
308eb5
     @Test
308eb5
     public void test_getInstance_String_TimeZone() {
308eb5
 
308eb5
@@ -180,8 +177,7 @@ public void test_getInstance_String_TimeZone() {
308eb5
         assertNotSame(format4, format6);
308eb5
     }
308eb5
 
308eb5
-    @DefaultLocale(language = "en", country = "US")
308eb5
-    @DefaultTimeZone("America/New_York")
308eb5
+    @org.junit.jupiter.api.Disabled("JUnit Pioneer not available")
308eb5
     @Test
308eb5
     public void test_getInstance_String_TimeZone_Locale() {
308eb5
         final FastDateFormat format1 = FastDateFormat.getInstance("MM/DD/yyyy",
308eb5
diff --git a/src/test/java/org/apache/commons/lang3/time/FastDatePrinterTest.java b/src/test/java/org/apache/commons/lang3/time/FastDatePrinterTest.java
308eb5
index f3511a51e..d4de29113 100644
308eb5
--- a/src/test/java/org/apache/commons/lang3/time/FastDatePrinterTest.java
308eb5
+++ b/src/test/java/org/apache/commons/lang3/time/FastDatePrinterTest.java
308eb5
@@ -32,8 +32,6 @@
308eb5
 
308eb5
 import org.apache.commons.lang3.SerializationUtils;
308eb5
 import org.junit.jupiter.api.Test;
308eb5
-import org.junitpioneer.jupiter.DefaultLocale;
308eb5
-import org.junitpioneer.jupiter.DefaultTimeZone;
308eb5
 
308eb5
 /**
308eb5
  * Unit tests {@link org.apache.commons.lang3.time.FastDatePrinter}.
308eb5
@@ -166,8 +164,7 @@ public void testEquals() {
308eb5
         assertNotEquals(printer1, new Object());
308eb5
     }
308eb5
 
308eb5
-    @DefaultLocale(language = "en", country = "US")
308eb5
-    @DefaultTimeZone("America/New_York")
308eb5
+    @org.junit.jupiter.api.Disabled("JUnit Pioneer not available")
308eb5
     @Test
308eb5
     public void testFormat() {
308eb5
         final GregorianCalendar cal1 = new GregorianCalendar(2003, 0, 10, 15, 33, 20);
308eb5
@@ -407,7 +404,7 @@ public void testStringBufferOptions() {
308eb5
         assertEquals(expected, format.format(epoch, sb).toString());
308eb5
     }
308eb5
 
308eb5
-    @DefaultTimeZone("UTC")
308eb5
+    @org.junit.jupiter.api.Disabled("JUnit Pioneer not available")
308eb5
     @Test
308eb5
     public void testTimeZoneAsZ() {
308eb5
         final Calendar c = Calendar.getInstance(FastTimeZone.getGmtTimeZone());
308eb5
@@ -433,8 +430,7 @@ public void testToStringContainsName() {
308eb5
         assertTrue(printer.toString().startsWith("FastDate"));
308eb5
     }
308eb5
 
308eb5
-    @DefaultLocale(language = "en", country = "US")
308eb5
-    @DefaultTimeZone("America/New_York")
308eb5
+    @org.junit.jupiter.api.Disabled("JUnit Pioneer not available")
308eb5
     @Test
308eb5
     public void testWeekYear() {
308eb5
         final GregorianCalendar cal = new GregorianCalendar(2020, 12, 31, 0, 0, 0);
308eb5
-- 
308eb5
2.29.2
308eb5