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