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