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