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