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