From 16c2ce232fb5ad1a9c19c718ba466151b963a01a Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Mon, 13 May 2019 20:05:23 +0200 Subject: [PATCH 01/11] Update to upstream version 3.9 --- .gitignore | 1 + apache-commons-lang3.spec | 7 +++++-- sources | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 441ce00..0340e34 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ /commons-lang3-3.5-src.tar.gz /commons-lang3-3.6-src.tar.gz /commons-lang3-3.7-src.tar.gz +/commons-lang3-3.9-src.tar.gz diff --git a/apache-commons-lang3.spec b/apache-commons-lang3.spec index 1d684ea..4949887 100644 --- a/apache-commons-lang3.spec +++ b/apache-commons-lang3.spec @@ -1,6 +1,6 @@ Name: apache-commons-lang3 -Version: 3.7 -Release: 3%{?dist} +Version: 3.9 +Release: 1%{?dist} Summary: Provides a host of helper utilities for the java.lang API License: ASL 2.0 URL: http://commons.apache.org/lang @@ -55,6 +55,9 @@ rm src/test/java/org/apache/commons/lang3/RandomStringUtilsTest.java %doc RELEASE-NOTES.txt %changelog +* Mon May 13 2019 Mikolaj Izdebski - 3.9-1 +- Update to upstream version 3.9 + * Wed Feb 07 2018 Fedora Release Engineering - 3.7-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild diff --git a/sources b/sources index a00bba5..aaa8c8f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (commons-lang3-3.7-src.tar.gz) = 12d7fb1694ec8fdc85f4c222e4218949d9a5c06cb6ad34763a7a32457b125551cac3ad3631ed299479b86e46a9e769095e96d6fd6799d8a522facc77b1ef02ef +SHA512 (commons-lang3-3.9-src.tar.gz) = bf69e747a2ed1a0a1b67e5c0e7bdb2344f7d8b0a88e0b535d8bdee627cbdc7be769593b58b76c84149acbb6f284f9b125095ba5a9d222413c033d1b72e07ac98 From 4efc86632829df110a2eb1ec0634a17afcce36fb Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Fri, 24 May 2019 17:00:19 +0200 Subject: [PATCH 02/11] Mass rebuild for javapackages-tools 201901 --- apache-commons-lang3.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apache-commons-lang3.spec b/apache-commons-lang3.spec index 4949887..b69d726 100644 --- a/apache-commons-lang3.spec +++ b/apache-commons-lang3.spec @@ -1,6 +1,6 @@ Name: apache-commons-lang3 Version: 3.9 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Provides a host of helper utilities for the java.lang API License: ASL 2.0 URL: http://commons.apache.org/lang @@ -55,6 +55,9 @@ rm src/test/java/org/apache/commons/lang3/RandomStringUtilsTest.java %doc RELEASE-NOTES.txt %changelog +* Fri May 24 2019 Mikolaj Izdebski - 3.9-2 +- Mass rebuild for javapackages-tools 201901 + * Mon May 13 2019 Mikolaj Izdebski - 3.9-1 - Update to upstream version 3.9 From d69b5c446f567b9f067d50956d1e4ec5f066348d Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Tue, 25 Jun 2019 08:54:17 +0200 Subject: [PATCH 03/11] Declare module package --- apache-commons-lang3.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apache-commons-lang3.spec b/apache-commons-lang3.spec index b69d726..04c2222 100644 --- a/apache-commons-lang3.spec +++ b/apache-commons-lang3.spec @@ -29,6 +29,7 @@ therefore created differently named artifact and jar files. This is the new version, while apache-commons-lang is the compatibility package. +%{?module_package} %{?javadoc_package} %prep @@ -50,7 +51,7 @@ rm src/test/java/org/apache/commons/lang3/RandomStringUtilsTest.java %install %mvn_install -%files -f .mfiles +%files -n %{?module_prefix}%{name} -f .mfiles %license LICENSE.txt NOTICE.txt %doc RELEASE-NOTES.txt From 651e12974285aed3dedf7dc060ea54b721cbabbe Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Tue, 25 Jun 2019 09:17:59 +0200 Subject: [PATCH 04/11] Use standard artifact installation location --- apache-commons-lang3.spec | 2 -- 1 file changed, 2 deletions(-) diff --git a/apache-commons-lang3.spec b/apache-commons-lang3.spec index 04c2222..626e8ef 100644 --- a/apache-commons-lang3.spec +++ b/apache-commons-lang3.spec @@ -35,8 +35,6 @@ package. %prep %autosetup -n commons-lang3-%{version}-src -%mvn_file : %{name} commons-lang3 - # testParseSync() test fails on ARM and PPC64LE for unknown reason sed -i 's/\s*public void testParseSync().*/@org.junit.Ignore\n&/' \ src/test/java/org/apache/commons/lang3/time/FastDateFormatTest.java From 1daf25644e50344b5c7089b4a34f906e3f75dab2 Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Thu, 27 Jun 2019 14:36:48 +0200 Subject: [PATCH 05/11] Revert "Use standard artifact installation location" This reverts commit 651e12974285aed3dedf7dc060ea54b721cbabbe. --- apache-commons-lang3.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apache-commons-lang3.spec b/apache-commons-lang3.spec index 626e8ef..04c2222 100644 --- a/apache-commons-lang3.spec +++ b/apache-commons-lang3.spec @@ -35,6 +35,8 @@ package. %prep %autosetup -n commons-lang3-%{version}-src +%mvn_file : %{name} commons-lang3 + # testParseSync() test fails on ARM and PPC64LE for unknown reason sed -i 's/\s*public void testParseSync().*/@org.junit.Ignore\n&/' \ src/test/java/org/apache/commons/lang3/time/FastDateFormatTest.java From 0bd4038650166e2a03750025c4236d57486c4dd5 Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Tue, 5 Nov 2019 17:29:27 +0100 Subject: [PATCH 06/11] Mass rebuild for javapackages-tools 201902 --- apache-commons-lang3.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apache-commons-lang3.spec b/apache-commons-lang3.spec index 04c2222..35f0a5a 100644 --- a/apache-commons-lang3.spec +++ b/apache-commons-lang3.spec @@ -1,6 +1,6 @@ Name: apache-commons-lang3 Version: 3.9 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Provides a host of helper utilities for the java.lang API License: ASL 2.0 URL: http://commons.apache.org/lang @@ -56,6 +56,9 @@ rm src/test/java/org/apache/commons/lang3/RandomStringUtilsTest.java %doc RELEASE-NOTES.txt %changelog +* Tue Nov 05 2019 Mikolaj Izdebski - 3.9-3 +- Mass rebuild for javapackages-tools 201902 + * Fri May 24 2019 Mikolaj Izdebski - 3.9-2 - Mass rebuild for javapackages-tools 201901 From af870ea82ac258d89c17e3c03b16dd1380249c45 Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Sat, 25 Jan 2020 14:40:08 +0100 Subject: [PATCH 07/11] Build with OpenJDK 8 --- apache-commons-lang3.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apache-commons-lang3.spec b/apache-commons-lang3.spec index 35f0a5a..bbee318 100644 --- a/apache-commons-lang3.spec +++ b/apache-commons-lang3.spec @@ -1,6 +1,6 @@ Name: apache-commons-lang3 Version: 3.9 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Provides a host of helper utilities for the java.lang API License: ASL 2.0 URL: http://commons.apache.org/lang @@ -8,7 +8,7 @@ BuildArch: noarch Source0: http://archive.apache.org/dist/commons/lang/source/commons-lang3-%{version}-src.tar.gz -BuildRequires: maven-local +BuildRequires: maven-local-openjdk8 BuildRequires: mvn(org.apache.commons:commons-parent:pom:) BuildRequires: mvn(org.apache.maven.plugins:maven-antrun-plugin) @@ -56,6 +56,9 @@ rm src/test/java/org/apache/commons/lang3/RandomStringUtilsTest.java %doc RELEASE-NOTES.txt %changelog +* Sat Jan 25 2020 Mikolaj Izdebski - 3.9-4 +- Build with OpenJDK 8 + * Tue Nov 05 2019 Mikolaj Izdebski - 3.9-3 - Mass rebuild for javapackages-tools 201902 From 06b5a2eafd8c423bb64da16f7313cdc7a503d965 Mon Sep 17 00:00:00 2001 From: Marian Koncek Date: Wed, 15 Apr 2020 12:53:39 +0200 Subject: [PATCH 08/11] Update to upstream version 3.10 --- .gitignore | 1 + apache-commons-lang3.spec | 13 +++++++++---- sources | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 0340e34..0cd7d2b 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ /commons-lang3-3.6-src.tar.gz /commons-lang3-3.7-src.tar.gz /commons-lang3-3.9-src.tar.gz +/commons-lang3-3.10-src.tar.gz diff --git a/apache-commons-lang3.spec b/apache-commons-lang3.spec index bbee318..4fa6e0b 100644 --- a/apache-commons-lang3.spec +++ b/apache-commons-lang3.spec @@ -1,12 +1,12 @@ Name: apache-commons-lang3 -Version: 3.9 -Release: 4%{?dist} +Version: 3.10 +Release: 1%{?dist} Summary: Provides a host of helper utilities for the java.lang API License: ASL 2.0 -URL: http://commons.apache.org/lang +URL: https://commons.apache.org/lang BuildArch: noarch -Source0: http://archive.apache.org/dist/commons/lang/source/commons-lang3-%{version}-src.tar.gz +Source0: https://archive.apache.org/dist/commons/lang/source/commons-lang3-%{version}-src.tar.gz BuildRequires: maven-local-openjdk8 BuildRequires: mvn(org.apache.commons:commons-parent:pom:) @@ -35,6 +35,8 @@ package. %prep %autosetup -n commons-lang3-%{version}-src +%pom_remove_plugin :maven-javadoc-plugin + %mvn_file : %{name} commons-lang3 # testParseSync() test fails on ARM and PPC64LE for unknown reason @@ -56,6 +58,9 @@ rm src/test/java/org/apache/commons/lang3/RandomStringUtilsTest.java %doc RELEASE-NOTES.txt %changelog +* Wed Apr 15 2020 Marian Koncek - 3.10-1 +- Update to upstream version 3.10 + * Sat Jan 25 2020 Mikolaj Izdebski - 3.9-4 - Build with OpenJDK 8 diff --git a/sources b/sources index aaa8c8f..d5219bd 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (commons-lang3-3.9-src.tar.gz) = bf69e747a2ed1a0a1b67e5c0e7bdb2344f7d8b0a88e0b535d8bdee627cbdc7be769593b58b76c84149acbb6f284f9b125095ba5a9d222413c033d1b72e07ac98 +SHA512 (commons-lang3-3.10-src.tar.gz) = 8c3e90e60bbb0b83c8e5e8d173d5a982d6f5bf3d2392e11cd17b153484a87c42f3003a7ae84ff3c34a11c16df61d7a4fb8e902b31e0e9c2cef2a17115c0c468b From 888738d97522fd7c9d73b7bd8a07ffc6341c54e8 Mon Sep 17 00:00:00 2001 From: Marian Koncek Date: Tue, 4 Aug 2020 15:51:48 +0200 Subject: [PATCH 09/11] Update to upstream version 3.11, enable tests --- .gitignore | 1 + 0001-Remove-usage-of-junit-pioneer.patch | 325 +++++++++++++++++++++++ apache-commons-lang3.spec | 30 ++- sources | 2 +- 4 files changed, 352 insertions(+), 6 deletions(-) create mode 100644 0001-Remove-usage-of-junit-pioneer.patch diff --git a/.gitignore b/.gitignore index 0cd7d2b..8ceb589 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ /commons-lang3-3.7-src.tar.gz /commons-lang3-3.9-src.tar.gz /commons-lang3-3.10-src.tar.gz +/commons-lang3-3.11-src.tar.gz diff --git a/0001-Remove-usage-of-junit-pioneer.patch b/0001-Remove-usage-of-junit-pioneer.patch new file mode 100644 index 0000000..96cd659 --- /dev/null +++ b/0001-Remove-usage-of-junit-pioneer.patch @@ -0,0 +1,325 @@ +From 5f6b1a0420d0a95826ccd73e53a4840e9df70cee Mon Sep 17 00:00:00 2001 +From: Marian Koncek +Date: Tue, 4 Aug 2020 14:49:48 +0200 +Subject: [PATCH] Remove usage of junit pioneer + +--- + .../lang3/StringUtilsContainsTest.java | 5 ++-- + .../lang3/time/DateFormatUtilsTest.java | 10 ++++--- + .../commons/lang3/time/DateUtilsTest.java | 21 +++++++++---- + .../lang3/time/FastDateFormatTest.java | 30 +++++++++++++------ + .../lang3/time/FastDatePrinterTest.java | 14 +++++---- + 5 files changed, 54 insertions(+), 26 deletions(-) + +diff --git a/src/test/java/org/apache/commons/lang3/StringUtilsContainsTest.java b/src/test/java/org/apache/commons/lang3/StringUtilsContainsTest.java +index 4a0a4cc..3fd6d99 100644 +--- a/src/test/java/org/apache/commons/lang3/StringUtilsContainsTest.java ++++ b/src/test/java/org/apache/commons/lang3/StringUtilsContainsTest.java +@@ -23,7 +23,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue; + import java.util.Locale; + + import org.junit.jupiter.api.Test; +-import org.junitpioneer.jupiter.DefaultLocale; + + /** + * Unit tests {@link org.apache.commons.lang3.StringUtils} - Contains methods +@@ -227,9 +226,10 @@ public class StringUtilsContainsTest { + assertTrue(StringUtils.containsAny("abc", "d", "abc")); + } + +- @DefaultLocale(language = "de", country = "DE") + @Test + public void testContainsIgnoreCase_LocaleIndependence() { ++ Locale current_locale = Locale.getDefault(); ++ Locale.setDefault(new Locale("de", "DE")); + final Locale[] locales = { Locale.ENGLISH, new Locale("tr"), Locale.getDefault() }; + + final String[][] tdata = { { "i", "I" }, { "I", "i" }, { "\u03C2", "\u03C3" }, { "\u03A3", "\u03C2" }, +@@ -248,6 +248,7 @@ public class StringUtilsContainsTest { + Locale.getDefault() + ": " + j + " " + fdata[j][0] + " " + fdata[j][1]); + } + } ++ Locale.setDefault(current_locale); + } + + @Test +diff --git a/src/test/java/org/apache/commons/lang3/time/DateFormatUtilsTest.java b/src/test/java/org/apache/commons/lang3/time/DateFormatUtilsTest.java +index 31679de..20155e8 100644 +--- a/src/test/java/org/apache/commons/lang3/time/DateFormatUtilsTest.java ++++ b/src/test/java/org/apache/commons/lang3/time/DateFormatUtilsTest.java +@@ -30,8 +30,6 @@ import java.util.Locale; + import java.util.TimeZone; + + import org.junit.jupiter.api.Test; +-import org.junitpioneer.jupiter.DefaultLocale; +-import org.junitpioneer.jupiter.DefaultTimeZone; + + /** + * TestCase for DateFormatUtils. +@@ -166,9 +164,10 @@ public class DateFormatUtilsTest { + testUTC("09:11:12Z", DateFormatUtils.ISO_TIME_NO_T_TIME_ZONE_FORMAT.getPattern()); + } + +- @DefaultLocale(language = "en") + @Test + public void testSMTP() { ++ Locale current_locale = Locale.getDefault(); ++ Locale.setDefault(new Locale("en")); + TimeZone timeZone = TimeZone.getTimeZone("GMT-3"); + Calendar june = createJuneTestDate(timeZone); + +@@ -179,6 +178,7 @@ public class DateFormatUtilsTest { + june = createJuneTestDate(timeZone); + assertFormats("Sun, 08 Jun 2003 10:11:12 +0000", DateFormatUtils.SMTP_DATETIME_FORMAT.getPattern(), + timeZone, june); ++ Locale.setDefault(current_locale); + } + + @Test +@@ -187,14 +187,16 @@ public class DateFormatUtilsTest { + DateFormatUtils.ISO_DATETIME_TIME_ZONE_FORMAT.parse(date); + } + +- @DefaultTimeZone("UTC") + @Test + public void testLang530() throws ParseException { ++ TimeZone current_time_zone = TimeZone.getDefault(); ++ TimeZone.setDefault(TimeZone.getTimeZone("UTC")); + final Date d = new Date(); + final String isoDateStr = DateFormatUtils.ISO_DATETIME_TIME_ZONE_FORMAT.format(d); + final Date d2 = DateUtils.parseDate(isoDateStr, DateFormatUtils.ISO_DATETIME_TIME_ZONE_FORMAT.getPattern()); + // the format loses milliseconds so have to reintroduce them + assertEquals(d.getTime(), d2.getTime() + d.getTime() % 1000, "Date not equal to itself ISO formatted and parsed"); ++ TimeZone.setDefault(current_time_zone); + } + + /** +diff --git a/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java b/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java +index 14dbf89..db0a51a 100644 +--- a/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java ++++ b/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java +@@ -39,7 +39,6 @@ import java.util.TimeZone; + import org.junit.jupiter.api.BeforeAll; + import org.junit.jupiter.api.BeforeEach; + import org.junit.jupiter.api.Test; +-import org.junitpioneer.jupiter.DefaultLocale; + + /** + * Unit tests {@link org.apache.commons.lang3.time.DateUtils}. +@@ -1553,39 +1552,49 @@ public class DateUtilsTest { + dateParser.parse("December 2, 2001")); + } + +- @DefaultLocale(language = "en") + @Test + public void testLANG799_EN_OK() throws ParseException { ++ Locale current_locale = Locale.getDefault(); ++ Locale.setDefault(new Locale("en")); + DateUtils.parseDate("Wed, 09 Apr 2008 23:55:38 GMT", "EEE, dd MMM yyyy HH:mm:ss zzz"); + DateUtils.parseDateStrictly("Wed, 09 Apr 2008 23:55:38 GMT", "EEE, dd MMM yyyy HH:mm:ss zzz"); ++ Locale.setDefault(current_locale); + } + + // Parse German date with English Locale +- @DefaultLocale(language = "en") + @Test + public void testLANG799_EN_FAIL() { ++ Locale current_locale = Locale.getDefault(); ++ Locale.setDefault(new Locale("en")); + assertThrows(ParseException.class, () -> DateUtils.parseDate("Mi, 09 Apr 2008 23:55:38 GMT", "EEE, dd MMM yyyy HH:mm:ss zzz")); ++ Locale.setDefault(current_locale); + } + +- @DefaultLocale(language = "de") + @Test + public void testLANG799_DE_OK() throws ParseException { ++ Locale current_locale = Locale.getDefault(); ++ Locale.setDefault(new Locale("de")); + DateUtils.parseDate("Mi, 09 Apr 2008 23:55:38 GMT", "EEE, dd MMM yyyy HH:mm:ss zzz"); + DateUtils.parseDateStrictly("Mi, 09 Apr 2008 23:55:38 GMT", "EEE, dd MMM yyyy HH:mm:ss zzz"); ++ Locale.setDefault(current_locale); + } + + // Parse English date with German Locale +- @DefaultLocale(language = "de") + @Test + public void testLANG799_DE_FAIL() { ++ Locale current_locale = Locale.getDefault(); ++ Locale.setDefault(new Locale("de")); + assertThrows(ParseException.class, () -> DateUtils.parseDate("Wed, 09 Apr 2008 23:55:38 GMT", "EEE, dd MMM yyyy HH:mm:ss zzz")); ++ Locale.setDefault(current_locale); + } + + // Parse German date with English Locale, specifying German Locale override +- @DefaultLocale(language = "en") + @Test + public void testLANG799_EN_WITH_DE_LOCALE() throws ParseException { ++ Locale current_locale = Locale.getDefault(); ++ Locale.setDefault(new Locale("en")); + DateUtils.parseDate("Mi, 09 Apr 2008 23:55:38 GMT", Locale.GERMAN, "EEE, dd MMM yyyy HH:mm:ss zzz"); ++ Locale.setDefault(current_locale); + } + + /** +diff --git a/src/test/java/org/apache/commons/lang3/time/FastDateFormatTest.java b/src/test/java/org/apache/commons/lang3/time/FastDateFormatTest.java +index 31c4ea8..f96da11 100644 +--- a/src/test/java/org/apache/commons/lang3/time/FastDateFormatTest.java ++++ b/src/test/java/org/apache/commons/lang3/time/FastDateFormatTest.java +@@ -36,8 +36,6 @@ import java.util.concurrent.atomic.AtomicInteger; + import java.util.concurrent.atomic.AtomicLongArray; + + import org.junit.jupiter.api.Test; +-import org.junitpioneer.jupiter.DefaultLocale; +-import org.junitpioneer.jupiter.DefaultTimeZone; + + /** + * Unit tests {@link org.apache.commons.lang3.time.FastDateFormat}. +@@ -70,11 +68,13 @@ public class FastDateFormatTest { + assertEquals(TimeZone.getDefault(), format2.getTimeZone()); + } + +- @DefaultLocale(language = "en", country = "US") +- @DefaultTimeZone("America/New_York") + @Test + public void test_getInstance_String_TimeZone() { + ++ Locale current_locale = Locale.getDefault(); ++ Locale.setDefault(new Locale("en", "US")); ++ TimeZone current_time_zone = TimeZone.getDefault(); ++ TimeZone.setDefault(TimeZone.getTimeZone("America/New_York")); + final FastDateFormat format1 = FastDateFormat.getInstance("MM/DD/yyyy", + TimeZone.getTimeZone("Atlantic/Reykjavik")); + final FastDateFormat format2 = FastDateFormat.getInstance("MM/DD/yyyy"); +@@ -89,11 +89,14 @@ public class FastDateFormatTest { + assertSame(format3, format4); + assertNotSame(format3, format5); + assertNotSame(format4, format6); ++ Locale.setDefault(current_locale); ++ TimeZone.setDefault(current_time_zone); + } + +- @DefaultLocale(language = "en", country = "US") + @Test + public void test_getInstance_String_Locale() { ++ Locale current_locale = Locale.getDefault(); ++ Locale.setDefault(new Locale("en", "US")); + final FastDateFormat format1 = FastDateFormat.getInstance("MM/DD/yyyy", Locale.GERMANY); + final FastDateFormat format2 = FastDateFormat.getInstance("MM/DD/yyyy"); + final FastDateFormat format3 = FastDateFormat.getInstance("MM/DD/yyyy", Locale.GERMANY); +@@ -101,11 +104,13 @@ public class FastDateFormatTest { + assertNotSame(format1, format2); + assertSame(format1, format3); + assertEquals(Locale.GERMANY, format1.getLocale()); ++ Locale.setDefault(current_locale); + } + +- @DefaultLocale(language = "en", country = "US") + @Test + public void test_changeDefault_Locale_DateInstance() { ++ Locale current_locale = Locale.getDefault(); ++ Locale.setDefault(new Locale("en", "US")); + final FastDateFormat format1 = FastDateFormat.getDateInstance(FastDateFormat.FULL, Locale.GERMANY); + final FastDateFormat format2 = FastDateFormat.getDateInstance(FastDateFormat.FULL); + Locale.setDefault(Locale.GERMANY); +@@ -116,11 +121,13 @@ public class FastDateFormatTest { + assertSame(Locale.GERMANY, format3.getLocale()); + assertNotSame(format1, format2); + assertNotSame(format2, format3); ++ Locale.setDefault(current_locale); + } + +- @DefaultLocale(language = "en", country = "US") + @Test + public void test_changeDefault_Locale_DateTimeInstance() { ++ Locale current_locale = Locale.getDefault(); ++ Locale.setDefault(new Locale("en", "US")); + final FastDateFormat format1 = FastDateFormat.getDateTimeInstance(FastDateFormat.FULL, FastDateFormat.FULL, Locale.GERMANY); + final FastDateFormat format2 = FastDateFormat.getDateTimeInstance(FastDateFormat.FULL, FastDateFormat.FULL); + Locale.setDefault(Locale.GERMANY); +@@ -131,12 +138,15 @@ public class FastDateFormatTest { + assertSame(Locale.GERMANY, format3.getLocale()); + assertNotSame(format1, format2); + assertNotSame(format2, format3); ++ Locale.setDefault(current_locale); + } + +- @DefaultLocale(language = "en", country = "US") +- @DefaultTimeZone("America/New_York") + @Test + public void test_getInstance_String_TimeZone_Locale() { ++ Locale current_locale = Locale.getDefault(); ++ Locale.setDefault(new Locale("en", "US")); ++ TimeZone current_time_zone = TimeZone.getDefault(); ++ TimeZone.setDefault(TimeZone.getTimeZone("America/New_York")); + final FastDateFormat format1 = FastDateFormat.getInstance("MM/DD/yyyy", + TimeZone.getTimeZone("Atlantic/Reykjavik"), Locale.GERMANY); + final FastDateFormat format2 = FastDateFormat.getInstance("MM/DD/yyyy", Locale.GERMANY); +@@ -150,6 +160,8 @@ public class FastDateFormatTest { + assertEquals(Locale.GERMANY, format1.getLocale()); + assertEquals(Locale.GERMANY, format2.getLocale()); + assertEquals(Locale.GERMANY, format3.getLocale()); ++ Locale.setDefault(current_locale); ++ TimeZone.setDefault(current_time_zone); + } + + @Test +diff --git a/src/test/java/org/apache/commons/lang3/time/FastDatePrinterTest.java b/src/test/java/org/apache/commons/lang3/time/FastDatePrinterTest.java +index 096cbbb..32dcf6f 100644 +--- a/src/test/java/org/apache/commons/lang3/time/FastDatePrinterTest.java ++++ b/src/test/java/org/apache/commons/lang3/time/FastDatePrinterTest.java +@@ -32,8 +32,6 @@ import java.util.TimeZone; + + import org.apache.commons.lang3.SerializationUtils; + import org.junit.jupiter.api.Test; +-import org.junitpioneer.jupiter.DefaultLocale; +-import org.junitpioneer.jupiter.DefaultTimeZone; + + /** + * Unit tests {@link org.apache.commons.lang3.time.FastDatePrinter}. +@@ -75,10 +73,12 @@ public class FastDatePrinterTest { + return new FastDatePrinter(format, timeZone, locale); + } + +- @DefaultLocale(language = "en", country = "US") +- @DefaultTimeZone("America/New_York") + @Test + public void testFormat() { ++ Locale current_locale = Locale.getDefault(); ++ Locale.setDefault(new Locale("en", "US")); ++ TimeZone current_time_zone = TimeZone.getDefault(); ++ TimeZone.setDefault(TimeZone.getTimeZone("America/New_York")); + final GregorianCalendar cal1 = new GregorianCalendar(2003, 0, 10, 15, 33, 20); + final GregorianCalendar cal2 = new GregorianCalendar(2003, 6, 10, 9, 0, 0); + final Date date1 = cal1.getTime(); +@@ -121,6 +121,8 @@ public class FastDatePrinterTest { + // SDF bug fix starting with Java 7 + assertEquals(sdf.format(date1).replaceAll("2003 03 03 03", "2003 2003 03 2003"), fdf.format(date1)); + assertEquals(sdf.format(date2).replaceAll("2003 03 03 03", "2003 2003 03 2003"), fdf.format(date2)); ++ Locale.setDefault(current_locale); ++ TimeZone.setDefault(current_time_zone); + } + + /** +@@ -259,9 +261,10 @@ public class FastDatePrinterTest { + assertEquals(NEW_YORK, printer.getTimeZone()); + } + +- @DefaultTimeZone("UTC") + @Test + public void testTimeZoneAsZ() { ++ TimeZone current_time_zone = TimeZone.getDefault(); ++ TimeZone.setDefault(TimeZone.getTimeZone("UTC")); + final Calendar c = Calendar.getInstance(FastTimeZone.getGmtTimeZone()); + final FastDateFormat noColonFormat = FastDateFormat.getInstance("Z"); + assertEquals("+0000", noColonFormat.format(c)); +@@ -271,6 +274,7 @@ public class FastDatePrinterTest { + + final FastDateFormat colonFormat = FastDateFormat.getInstance("ZZZ"); + assertEquals("+00:00", colonFormat.format(c)); ++ TimeZone.setDefault(current_time_zone); + } + + private static Calendar initializeCalendar(final TimeZone tz) { +-- +2.25.4 + diff --git a/apache-commons-lang3.spec b/apache-commons-lang3.spec index 4fa6e0b..fc6496f 100644 --- a/apache-commons-lang3.spec +++ b/apache-commons-lang3.spec @@ -1,5 +1,5 @@ Name: apache-commons-lang3 -Version: 3.10 +Version: 3.11 Release: 1%{?dist} Summary: Provides a host of helper utilities for the java.lang API License: ASL 2.0 @@ -7,10 +7,16 @@ URL: https://commons.apache.org/lang BuildArch: noarch Source0: https://archive.apache.org/dist/commons/lang/source/commons-lang3-%{version}-src.tar.gz +Patch1: 0001-Remove-usage-of-junit-pioneer.patch BuildRequires: maven-local-openjdk8 +BuildRequires: mvn(biz.aQute.bnd:biz.aQute.bndlib) BuildRequires: mvn(org.apache.commons:commons-parent:pom:) +BuildRequires: mvn(org.apache.felix:maven-bundle-plugin) BuildRequires: mvn(org.apache.maven.plugins:maven-antrun-plugin) +BuildRequires: mvn(org.easymock:easymock) +BuildRequires: mvn(org.hamcrest:hamcrest) +BuildRequires: mvn(org.junit.jupiter:junit-jupiter) %description The standard Java libraries fail to provide enough methods for @@ -33,22 +39,33 @@ package. %{?javadoc_package} %prep -%autosetup -n commons-lang3-%{version}-src +%setup -n commons-lang3-%{version}-src + +%patch1 -p1 %pom_remove_plugin :maven-javadoc-plugin +%pom_remove_dep org.junit-pioneer:junit-pioneer +%pom_remove_dep org.openjdk.jmh:jmh-core +%pom_remove_dep org.openjdk.jmh:jmh-generator-annprocess %mvn_file : %{name} commons-lang3 # testParseSync() test fails on ARM and PPC64LE for unknown reason -sed -i 's/\s*public void testParseSync().*/@org.junit.Ignore\n&/' \ +sed -i 's/\s*public void testParseSync().*/@org.junit.jupiter.api.Disabled\n&/' \ src/test/java/org/apache/commons/lang3/time/FastDateFormatTest.java # non-deterministic tests fail randomly rm src/test/java/org/apache/commons/lang3/RandomStringUtilsTest.java +# Missing dependencies +rm src/test/java/org/apache/commons/lang3/HashSetvBitSetTest.java + +# Remove limits and Java 11 options +sed -i '//d' pom.xml + %build -# FIXME tests run against current system version of commons-lang3, not the one being built -%mvn_build -f +# See "-DcommonsLang3Version" in maven-surefire for the tested version +%mvn_build %install %mvn_install @@ -58,6 +75,9 @@ rm src/test/java/org/apache/commons/lang3/RandomStringUtilsTest.java %doc RELEASE-NOTES.txt %changelog +* Tue Aug 04 2020 Marian Koncek - 3.11-1 +- Update to upstream version 3.11 + * Wed Apr 15 2020 Marian Koncek - 3.10-1 - Update to upstream version 3.10 diff --git a/sources b/sources index d5219bd..99ba852 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (commons-lang3-3.10-src.tar.gz) = 8c3e90e60bbb0b83c8e5e8d173d5a982d6f5bf3d2392e11cd17b153484a87c42f3003a7ae84ff3c34a11c16df61d7a4fb8e902b31e0e9c2cef2a17115c0c468b +SHA512 (commons-lang3-3.11-src.tar.gz) = ebcb13e47c24e6984835d9d6904fe33077aa3ba781cd61db109fa7005517e4e74cf086c4789a1d65cf3d6c4924b32337c98827a75f91aab908d8e8b9d3b92087 From 0d0e9dc490920589f773fe0759a468ebf3a6c65b Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Thu, 11 Mar 2021 13:26:15 +0100 Subject: [PATCH 10/11] Update to upstream version 3.12.0 --- .gitignore | 1 + ...ove-test-dependency-on-JUnit-Pioneer.patch | 255 ++++++++++++++ 0001-Remove-usage-of-junit-pioneer.patch | 325 ------------------ apache-commons-lang3.spec | 10 +- sources | 2 +- 5 files changed, 264 insertions(+), 329 deletions(-) create mode 100644 0001-Remove-test-dependency-on-JUnit-Pioneer.patch delete mode 100644 0001-Remove-usage-of-junit-pioneer.patch diff --git a/.gitignore b/.gitignore index 8ceb589..92fe47c 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ /commons-lang3-3.9-src.tar.gz /commons-lang3-3.10-src.tar.gz /commons-lang3-3.11-src.tar.gz +/commons-lang3-3.12.0-src.tar.gz diff --git a/0001-Remove-test-dependency-on-JUnit-Pioneer.patch b/0001-Remove-test-dependency-on-JUnit-Pioneer.patch new file mode 100644 index 0000000..9492ec0 --- /dev/null +++ b/0001-Remove-test-dependency-on-JUnit-Pioneer.patch @@ -0,0 +1,255 @@ +From 98753efcb2ff4d531a1eca08ded5c227ae6149b6 Mon Sep 17 00:00:00 2001 +From: Mikolaj Izdebski +Date: Thu, 11 Mar 2021 13:14:20 +0100 +Subject: [PATCH] Remove test dependency on JUnit Pioneer + +sed -i '/org.junit-pioneer/,//d' pom.xml + +sed -i '/^import org.junitpioneer/ d + /@Default\(Locale\|TimeZone\)([^)]*)/ { + h + d + } + /@Test/ { + x + s/\( *\)..*/\1@org.junit.jupiter.api.Disabled("JUnit Pioneer not available")/ + /./p + s/.*// + x + }' $(grep org.junitpioneer -rl src/test/java/) +--- + pom.xml | 6 ------ + .../commons/lang3/StringUtilsContainsTest.java | 3 +-- + .../commons/lang3/time/DateFormatUtilsTest.java | 6 ++---- + .../apache/commons/lang3/time/DateUtilsTest.java | 11 +++++------ + .../commons/lang3/time/FastDateFormatTest.java | 14 +++++--------- + .../commons/lang3/time/FastDatePrinterTest.java | 10 +++------- + 6 files changed, 16 insertions(+), 34 deletions(-) + +diff --git a/pom.xml b/pom.xml +index 167a85a47..d08c66336 100644 +--- a/pom.xml ++++ b/pom.xml +@@ -533,12 +533,6 @@ + junit-jupiter + test + +- +- org.junit-pioneer +- junit-pioneer +- 1.3.0 +- test +- + + org.hamcrest + hamcrest +diff --git a/src/test/java/org/apache/commons/lang3/StringUtilsContainsTest.java b/src/test/java/org/apache/commons/lang3/StringUtilsContainsTest.java +index 6ef2732a1..2e9d44f55 100644 +--- a/src/test/java/org/apache/commons/lang3/StringUtilsContainsTest.java ++++ b/src/test/java/org/apache/commons/lang3/StringUtilsContainsTest.java +@@ -23,7 +23,6 @@ + import java.util.Locale; + + import org.junit.jupiter.api.Test; +-import org.junitpioneer.jupiter.DefaultLocale; + + /** + * Unit tests {@link org.apache.commons.lang3.StringUtils} - Contains methods +@@ -248,7 +247,7 @@ public void testContainsAny_StringWithSupplementaryChars() { + assertFalse(StringUtils.containsAny(CharU20001, CharU20000)); + } + +- @DefaultLocale(language = "de", country = "DE") ++ @org.junit.jupiter.api.Disabled("JUnit Pioneer not available") + @Test + public void testContainsIgnoreCase_LocaleIndependence() { + final Locale[] locales = { Locale.ENGLISH, new Locale("tr"), Locale.getDefault() }; +diff --git a/src/test/java/org/apache/commons/lang3/time/DateFormatUtilsTest.java b/src/test/java/org/apache/commons/lang3/time/DateFormatUtilsTest.java +index cff1aac5e..515650a98 100644 +--- a/src/test/java/org/apache/commons/lang3/time/DateFormatUtilsTest.java ++++ b/src/test/java/org/apache/commons/lang3/time/DateFormatUtilsTest.java +@@ -30,8 +30,6 @@ + import java.util.TimeZone; + + import org.junit.jupiter.api.Test; +-import org.junitpioneer.jupiter.DefaultLocale; +-import org.junitpioneer.jupiter.DefaultTimeZone; + + /** + * TestCase for DateFormatUtils. +@@ -153,7 +151,7 @@ public void testLANG1000() throws Exception { + DateFormatUtils.ISO_DATETIME_TIME_ZONE_FORMAT.parse(date); + } + +- @DefaultTimeZone("UTC") ++ @org.junit.jupiter.api.Disabled("JUnit Pioneer not available") + @Test + public void testLang530() throws ParseException { + final Date d = new Date(); +@@ -205,7 +203,7 @@ public void testLang916() { + } + } + +- @DefaultLocale(language = "en") ++ @org.junit.jupiter.api.Disabled("JUnit Pioneer not available") + @Test + public void testSMTP() { + TimeZone timeZone = TimeZone.getTimeZone("GMT-3"); +diff --git a/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java b/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java +index dd6025dce..00a97010e 100644 +--- a/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java ++++ b/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java +@@ -39,7 +39,6 @@ + import org.junit.jupiter.api.BeforeAll; + import org.junit.jupiter.api.BeforeEach; + import org.junit.jupiter.api.Test; +-import org.junitpioneer.jupiter.DefaultLocale; + + /** + * Unit tests {@link org.apache.commons.lang3.time.DateUtils}. +@@ -795,13 +794,13 @@ public void testLANG799() throws ParseException { + } + + // Parse English date with German Locale +- @DefaultLocale(language = "de") ++ @org.junit.jupiter.api.Disabled("JUnit Pioneer not available") + @Test + public void testLANG799_DE_FAIL() { + assertThrows(ParseException.class, () -> DateUtils.parseDate("Wed, 09 Apr 2008 23:55:38 GMT", "EEE, dd MMM yyyy HH:mm:ss zzz")); + } + +- @DefaultLocale(language = "de") ++ @org.junit.jupiter.api.Disabled("JUnit Pioneer not available") + @Test + public void testLANG799_DE_OK() throws ParseException { + DateUtils.parseDate("Mi, 09 Apr 2008 23:55:38 GMT", "EEE, dd MMM yyyy HH:mm:ss zzz"); +@@ -809,13 +808,13 @@ public void testLANG799_DE_OK() throws ParseException { + } + + // Parse German date with English Locale +- @DefaultLocale(language = "en") ++ @org.junit.jupiter.api.Disabled("JUnit Pioneer not available") + @Test + public void testLANG799_EN_FAIL() { + assertThrows(ParseException.class, () -> DateUtils.parseDate("Mi, 09 Apr 2008 23:55:38 GMT", "EEE, dd MMM yyyy HH:mm:ss zzz")); + } + +- @DefaultLocale(language = "en") ++ @org.junit.jupiter.api.Disabled("JUnit Pioneer not available") + @Test + public void testLANG799_EN_OK() throws ParseException { + DateUtils.parseDate("Wed, 09 Apr 2008 23:55:38 GMT", "EEE, dd MMM yyyy HH:mm:ss zzz"); +@@ -823,7 +822,7 @@ public void testLANG799_EN_OK() throws ParseException { + } + + // Parse German date with English Locale, specifying German Locale override +- @DefaultLocale(language = "en") ++ @org.junit.jupiter.api.Disabled("JUnit Pioneer not available") + @Test + public void testLANG799_EN_WITH_DE_LOCALE() throws ParseException { + DateUtils.parseDate("Mi, 09 Apr 2008 23:55:38 GMT", Locale.GERMAN, "EEE, dd MMM yyyy HH:mm:ss zzz"); +diff --git a/src/test/java/org/apache/commons/lang3/time/FastDateFormatTest.java b/src/test/java/org/apache/commons/lang3/time/FastDateFormatTest.java +index b945d1748..fcf41956d 100644 +--- a/src/test/java/org/apache/commons/lang3/time/FastDateFormatTest.java ++++ b/src/test/java/org/apache/commons/lang3/time/FastDateFormatTest.java +@@ -36,8 +36,6 @@ + import java.util.concurrent.atomic.AtomicLongArray; + + import org.junit.jupiter.api.Test; +-import org.junitpioneer.jupiter.DefaultLocale; +-import org.junitpioneer.jupiter.DefaultTimeZone; + + /** + * Unit tests {@link org.apache.commons.lang3.time.FastDateFormat}. +@@ -92,7 +90,7 @@ private AtomicLongArray measureTime(final Format printer, final Format parser) t + return totalElapsed; + } + +- @DefaultLocale(language = "en", country = "US") ++ @org.junit.jupiter.api.Disabled("JUnit Pioneer not available") + @Test + public void test_changeDefault_Locale_DateInstance() { + final FastDateFormat format1 = FastDateFormat.getDateInstance(FastDateFormat.FULL, Locale.GERMANY); +@@ -107,7 +105,7 @@ public void test_changeDefault_Locale_DateInstance() { + assertNotSame(format2, format3); + } + +- @DefaultLocale(language = "en", country = "US") ++ @org.junit.jupiter.api.Disabled("JUnit Pioneer not available") + @Test + public void test_changeDefault_Locale_DateTimeInstance() { + final FastDateFormat format1 = FastDateFormat.getDateTimeInstance(FastDateFormat.FULL, FastDateFormat.FULL, Locale.GERMANY); +@@ -147,7 +145,7 @@ public void test_getInstance_String() { + assertEquals(TimeZone.getDefault(), format2.getTimeZone()); + } + +- @DefaultLocale(language = "en", country = "US") ++ @org.junit.jupiter.api.Disabled("JUnit Pioneer not available") + @Test + public void test_getInstance_String_Locale() { + final FastDateFormat format1 = FastDateFormat.getInstance("MM/DD/yyyy", Locale.GERMANY); +@@ -159,8 +157,7 @@ public void test_getInstance_String_Locale() { + assertEquals(Locale.GERMANY, format1.getLocale()); + } + +- @DefaultLocale(language = "en", country = "US") +- @DefaultTimeZone("America/New_York") ++ @org.junit.jupiter.api.Disabled("JUnit Pioneer not available") + @Test + public void test_getInstance_String_TimeZone() { + +@@ -180,8 +177,7 @@ public void test_getInstance_String_TimeZone() { + assertNotSame(format4, format6); + } + +- @DefaultLocale(language = "en", country = "US") +- @DefaultTimeZone("America/New_York") ++ @org.junit.jupiter.api.Disabled("JUnit Pioneer not available") + @Test + public void test_getInstance_String_TimeZone_Locale() { + final FastDateFormat format1 = FastDateFormat.getInstance("MM/DD/yyyy", +diff --git a/src/test/java/org/apache/commons/lang3/time/FastDatePrinterTest.java b/src/test/java/org/apache/commons/lang3/time/FastDatePrinterTest.java +index f3511a51e..d4de29113 100644 +--- a/src/test/java/org/apache/commons/lang3/time/FastDatePrinterTest.java ++++ b/src/test/java/org/apache/commons/lang3/time/FastDatePrinterTest.java +@@ -32,8 +32,6 @@ + + import org.apache.commons.lang3.SerializationUtils; + import org.junit.jupiter.api.Test; +-import org.junitpioneer.jupiter.DefaultLocale; +-import org.junitpioneer.jupiter.DefaultTimeZone; + + /** + * Unit tests {@link org.apache.commons.lang3.time.FastDatePrinter}. +@@ -166,8 +164,7 @@ public void testEquals() { + assertNotEquals(printer1, new Object()); + } + +- @DefaultLocale(language = "en", country = "US") +- @DefaultTimeZone("America/New_York") ++ @org.junit.jupiter.api.Disabled("JUnit Pioneer not available") + @Test + public void testFormat() { + final GregorianCalendar cal1 = new GregorianCalendar(2003, 0, 10, 15, 33, 20); +@@ -407,7 +404,7 @@ public void testStringBufferOptions() { + assertEquals(expected, format.format(epoch, sb).toString()); + } + +- @DefaultTimeZone("UTC") ++ @org.junit.jupiter.api.Disabled("JUnit Pioneer not available") + @Test + public void testTimeZoneAsZ() { + final Calendar c = Calendar.getInstance(FastTimeZone.getGmtTimeZone()); +@@ -433,8 +430,7 @@ public void testToStringContainsName() { + assertTrue(printer.toString().startsWith("FastDate")); + } + +- @DefaultLocale(language = "en", country = "US") +- @DefaultTimeZone("America/New_York") ++ @org.junit.jupiter.api.Disabled("JUnit Pioneer not available") + @Test + public void testWeekYear() { + final GregorianCalendar cal = new GregorianCalendar(2020, 12, 31, 0, 0, 0); +-- +2.29.2 + diff --git a/0001-Remove-usage-of-junit-pioneer.patch b/0001-Remove-usage-of-junit-pioneer.patch deleted file mode 100644 index 96cd659..0000000 --- a/0001-Remove-usage-of-junit-pioneer.patch +++ /dev/null @@ -1,325 +0,0 @@ -From 5f6b1a0420d0a95826ccd73e53a4840e9df70cee Mon Sep 17 00:00:00 2001 -From: Marian Koncek -Date: Tue, 4 Aug 2020 14:49:48 +0200 -Subject: [PATCH] Remove usage of junit pioneer - ---- - .../lang3/StringUtilsContainsTest.java | 5 ++-- - .../lang3/time/DateFormatUtilsTest.java | 10 ++++--- - .../commons/lang3/time/DateUtilsTest.java | 21 +++++++++---- - .../lang3/time/FastDateFormatTest.java | 30 +++++++++++++------ - .../lang3/time/FastDatePrinterTest.java | 14 +++++---- - 5 files changed, 54 insertions(+), 26 deletions(-) - -diff --git a/src/test/java/org/apache/commons/lang3/StringUtilsContainsTest.java b/src/test/java/org/apache/commons/lang3/StringUtilsContainsTest.java -index 4a0a4cc..3fd6d99 100644 ---- a/src/test/java/org/apache/commons/lang3/StringUtilsContainsTest.java -+++ b/src/test/java/org/apache/commons/lang3/StringUtilsContainsTest.java -@@ -23,7 +23,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue; - import java.util.Locale; - - import org.junit.jupiter.api.Test; --import org.junitpioneer.jupiter.DefaultLocale; - - /** - * Unit tests {@link org.apache.commons.lang3.StringUtils} - Contains methods -@@ -227,9 +226,10 @@ public class StringUtilsContainsTest { - assertTrue(StringUtils.containsAny("abc", "d", "abc")); - } - -- @DefaultLocale(language = "de", country = "DE") - @Test - public void testContainsIgnoreCase_LocaleIndependence() { -+ Locale current_locale = Locale.getDefault(); -+ Locale.setDefault(new Locale("de", "DE")); - final Locale[] locales = { Locale.ENGLISH, new Locale("tr"), Locale.getDefault() }; - - final String[][] tdata = { { "i", "I" }, { "I", "i" }, { "\u03C2", "\u03C3" }, { "\u03A3", "\u03C2" }, -@@ -248,6 +248,7 @@ public class StringUtilsContainsTest { - Locale.getDefault() + ": " + j + " " + fdata[j][0] + " " + fdata[j][1]); - } - } -+ Locale.setDefault(current_locale); - } - - @Test -diff --git a/src/test/java/org/apache/commons/lang3/time/DateFormatUtilsTest.java b/src/test/java/org/apache/commons/lang3/time/DateFormatUtilsTest.java -index 31679de..20155e8 100644 ---- a/src/test/java/org/apache/commons/lang3/time/DateFormatUtilsTest.java -+++ b/src/test/java/org/apache/commons/lang3/time/DateFormatUtilsTest.java -@@ -30,8 +30,6 @@ import java.util.Locale; - import java.util.TimeZone; - - import org.junit.jupiter.api.Test; --import org.junitpioneer.jupiter.DefaultLocale; --import org.junitpioneer.jupiter.DefaultTimeZone; - - /** - * TestCase for DateFormatUtils. -@@ -166,9 +164,10 @@ public class DateFormatUtilsTest { - testUTC("09:11:12Z", DateFormatUtils.ISO_TIME_NO_T_TIME_ZONE_FORMAT.getPattern()); - } - -- @DefaultLocale(language = "en") - @Test - public void testSMTP() { -+ Locale current_locale = Locale.getDefault(); -+ Locale.setDefault(new Locale("en")); - TimeZone timeZone = TimeZone.getTimeZone("GMT-3"); - Calendar june = createJuneTestDate(timeZone); - -@@ -179,6 +178,7 @@ public class DateFormatUtilsTest { - june = createJuneTestDate(timeZone); - assertFormats("Sun, 08 Jun 2003 10:11:12 +0000", DateFormatUtils.SMTP_DATETIME_FORMAT.getPattern(), - timeZone, june); -+ Locale.setDefault(current_locale); - } - - @Test -@@ -187,14 +187,16 @@ public class DateFormatUtilsTest { - DateFormatUtils.ISO_DATETIME_TIME_ZONE_FORMAT.parse(date); - } - -- @DefaultTimeZone("UTC") - @Test - public void testLang530() throws ParseException { -+ TimeZone current_time_zone = TimeZone.getDefault(); -+ TimeZone.setDefault(TimeZone.getTimeZone("UTC")); - final Date d = new Date(); - final String isoDateStr = DateFormatUtils.ISO_DATETIME_TIME_ZONE_FORMAT.format(d); - final Date d2 = DateUtils.parseDate(isoDateStr, DateFormatUtils.ISO_DATETIME_TIME_ZONE_FORMAT.getPattern()); - // the format loses milliseconds so have to reintroduce them - assertEquals(d.getTime(), d2.getTime() + d.getTime() % 1000, "Date not equal to itself ISO formatted and parsed"); -+ TimeZone.setDefault(current_time_zone); - } - - /** -diff --git a/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java b/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java -index 14dbf89..db0a51a 100644 ---- a/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java -+++ b/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java -@@ -39,7 +39,6 @@ import java.util.TimeZone; - import org.junit.jupiter.api.BeforeAll; - import org.junit.jupiter.api.BeforeEach; - import org.junit.jupiter.api.Test; --import org.junitpioneer.jupiter.DefaultLocale; - - /** - * Unit tests {@link org.apache.commons.lang3.time.DateUtils}. -@@ -1553,39 +1552,49 @@ public class DateUtilsTest { - dateParser.parse("December 2, 2001")); - } - -- @DefaultLocale(language = "en") - @Test - public void testLANG799_EN_OK() throws ParseException { -+ Locale current_locale = Locale.getDefault(); -+ Locale.setDefault(new Locale("en")); - DateUtils.parseDate("Wed, 09 Apr 2008 23:55:38 GMT", "EEE, dd MMM yyyy HH:mm:ss zzz"); - DateUtils.parseDateStrictly("Wed, 09 Apr 2008 23:55:38 GMT", "EEE, dd MMM yyyy HH:mm:ss zzz"); -+ Locale.setDefault(current_locale); - } - - // Parse German date with English Locale -- @DefaultLocale(language = "en") - @Test - public void testLANG799_EN_FAIL() { -+ Locale current_locale = Locale.getDefault(); -+ Locale.setDefault(new Locale("en")); - assertThrows(ParseException.class, () -> DateUtils.parseDate("Mi, 09 Apr 2008 23:55:38 GMT", "EEE, dd MMM yyyy HH:mm:ss zzz")); -+ Locale.setDefault(current_locale); - } - -- @DefaultLocale(language = "de") - @Test - public void testLANG799_DE_OK() throws ParseException { -+ Locale current_locale = Locale.getDefault(); -+ Locale.setDefault(new Locale("de")); - DateUtils.parseDate("Mi, 09 Apr 2008 23:55:38 GMT", "EEE, dd MMM yyyy HH:mm:ss zzz"); - DateUtils.parseDateStrictly("Mi, 09 Apr 2008 23:55:38 GMT", "EEE, dd MMM yyyy HH:mm:ss zzz"); -+ Locale.setDefault(current_locale); - } - - // Parse English date with German Locale -- @DefaultLocale(language = "de") - @Test - public void testLANG799_DE_FAIL() { -+ Locale current_locale = Locale.getDefault(); -+ Locale.setDefault(new Locale("de")); - assertThrows(ParseException.class, () -> DateUtils.parseDate("Wed, 09 Apr 2008 23:55:38 GMT", "EEE, dd MMM yyyy HH:mm:ss zzz")); -+ Locale.setDefault(current_locale); - } - - // Parse German date with English Locale, specifying German Locale override -- @DefaultLocale(language = "en") - @Test - public void testLANG799_EN_WITH_DE_LOCALE() throws ParseException { -+ Locale current_locale = Locale.getDefault(); -+ Locale.setDefault(new Locale("en")); - DateUtils.parseDate("Mi, 09 Apr 2008 23:55:38 GMT", Locale.GERMAN, "EEE, dd MMM yyyy HH:mm:ss zzz"); -+ Locale.setDefault(current_locale); - } - - /** -diff --git a/src/test/java/org/apache/commons/lang3/time/FastDateFormatTest.java b/src/test/java/org/apache/commons/lang3/time/FastDateFormatTest.java -index 31c4ea8..f96da11 100644 ---- a/src/test/java/org/apache/commons/lang3/time/FastDateFormatTest.java -+++ b/src/test/java/org/apache/commons/lang3/time/FastDateFormatTest.java -@@ -36,8 +36,6 @@ import java.util.concurrent.atomic.AtomicInteger; - import java.util.concurrent.atomic.AtomicLongArray; - - import org.junit.jupiter.api.Test; --import org.junitpioneer.jupiter.DefaultLocale; --import org.junitpioneer.jupiter.DefaultTimeZone; - - /** - * Unit tests {@link org.apache.commons.lang3.time.FastDateFormat}. -@@ -70,11 +68,13 @@ public class FastDateFormatTest { - assertEquals(TimeZone.getDefault(), format2.getTimeZone()); - } - -- @DefaultLocale(language = "en", country = "US") -- @DefaultTimeZone("America/New_York") - @Test - public void test_getInstance_String_TimeZone() { - -+ Locale current_locale = Locale.getDefault(); -+ Locale.setDefault(new Locale("en", "US")); -+ TimeZone current_time_zone = TimeZone.getDefault(); -+ TimeZone.setDefault(TimeZone.getTimeZone("America/New_York")); - final FastDateFormat format1 = FastDateFormat.getInstance("MM/DD/yyyy", - TimeZone.getTimeZone("Atlantic/Reykjavik")); - final FastDateFormat format2 = FastDateFormat.getInstance("MM/DD/yyyy"); -@@ -89,11 +89,14 @@ public class FastDateFormatTest { - assertSame(format3, format4); - assertNotSame(format3, format5); - assertNotSame(format4, format6); -+ Locale.setDefault(current_locale); -+ TimeZone.setDefault(current_time_zone); - } - -- @DefaultLocale(language = "en", country = "US") - @Test - public void test_getInstance_String_Locale() { -+ Locale current_locale = Locale.getDefault(); -+ Locale.setDefault(new Locale("en", "US")); - final FastDateFormat format1 = FastDateFormat.getInstance("MM/DD/yyyy", Locale.GERMANY); - final FastDateFormat format2 = FastDateFormat.getInstance("MM/DD/yyyy"); - final FastDateFormat format3 = FastDateFormat.getInstance("MM/DD/yyyy", Locale.GERMANY); -@@ -101,11 +104,13 @@ public class FastDateFormatTest { - assertNotSame(format1, format2); - assertSame(format1, format3); - assertEquals(Locale.GERMANY, format1.getLocale()); -+ Locale.setDefault(current_locale); - } - -- @DefaultLocale(language = "en", country = "US") - @Test - public void test_changeDefault_Locale_DateInstance() { -+ Locale current_locale = Locale.getDefault(); -+ Locale.setDefault(new Locale("en", "US")); - final FastDateFormat format1 = FastDateFormat.getDateInstance(FastDateFormat.FULL, Locale.GERMANY); - final FastDateFormat format2 = FastDateFormat.getDateInstance(FastDateFormat.FULL); - Locale.setDefault(Locale.GERMANY); -@@ -116,11 +121,13 @@ public class FastDateFormatTest { - assertSame(Locale.GERMANY, format3.getLocale()); - assertNotSame(format1, format2); - assertNotSame(format2, format3); -+ Locale.setDefault(current_locale); - } - -- @DefaultLocale(language = "en", country = "US") - @Test - public void test_changeDefault_Locale_DateTimeInstance() { -+ Locale current_locale = Locale.getDefault(); -+ Locale.setDefault(new Locale("en", "US")); - final FastDateFormat format1 = FastDateFormat.getDateTimeInstance(FastDateFormat.FULL, FastDateFormat.FULL, Locale.GERMANY); - final FastDateFormat format2 = FastDateFormat.getDateTimeInstance(FastDateFormat.FULL, FastDateFormat.FULL); - Locale.setDefault(Locale.GERMANY); -@@ -131,12 +138,15 @@ public class FastDateFormatTest { - assertSame(Locale.GERMANY, format3.getLocale()); - assertNotSame(format1, format2); - assertNotSame(format2, format3); -+ Locale.setDefault(current_locale); - } - -- @DefaultLocale(language = "en", country = "US") -- @DefaultTimeZone("America/New_York") - @Test - public void test_getInstance_String_TimeZone_Locale() { -+ Locale current_locale = Locale.getDefault(); -+ Locale.setDefault(new Locale("en", "US")); -+ TimeZone current_time_zone = TimeZone.getDefault(); -+ TimeZone.setDefault(TimeZone.getTimeZone("America/New_York")); - final FastDateFormat format1 = FastDateFormat.getInstance("MM/DD/yyyy", - TimeZone.getTimeZone("Atlantic/Reykjavik"), Locale.GERMANY); - final FastDateFormat format2 = FastDateFormat.getInstance("MM/DD/yyyy", Locale.GERMANY); -@@ -150,6 +160,8 @@ public class FastDateFormatTest { - assertEquals(Locale.GERMANY, format1.getLocale()); - assertEquals(Locale.GERMANY, format2.getLocale()); - assertEquals(Locale.GERMANY, format3.getLocale()); -+ Locale.setDefault(current_locale); -+ TimeZone.setDefault(current_time_zone); - } - - @Test -diff --git a/src/test/java/org/apache/commons/lang3/time/FastDatePrinterTest.java b/src/test/java/org/apache/commons/lang3/time/FastDatePrinterTest.java -index 096cbbb..32dcf6f 100644 ---- a/src/test/java/org/apache/commons/lang3/time/FastDatePrinterTest.java -+++ b/src/test/java/org/apache/commons/lang3/time/FastDatePrinterTest.java -@@ -32,8 +32,6 @@ import java.util.TimeZone; - - import org.apache.commons.lang3.SerializationUtils; - import org.junit.jupiter.api.Test; --import org.junitpioneer.jupiter.DefaultLocale; --import org.junitpioneer.jupiter.DefaultTimeZone; - - /** - * Unit tests {@link org.apache.commons.lang3.time.FastDatePrinter}. -@@ -75,10 +73,12 @@ public class FastDatePrinterTest { - return new FastDatePrinter(format, timeZone, locale); - } - -- @DefaultLocale(language = "en", country = "US") -- @DefaultTimeZone("America/New_York") - @Test - public void testFormat() { -+ Locale current_locale = Locale.getDefault(); -+ Locale.setDefault(new Locale("en", "US")); -+ TimeZone current_time_zone = TimeZone.getDefault(); -+ TimeZone.setDefault(TimeZone.getTimeZone("America/New_York")); - final GregorianCalendar cal1 = new GregorianCalendar(2003, 0, 10, 15, 33, 20); - final GregorianCalendar cal2 = new GregorianCalendar(2003, 6, 10, 9, 0, 0); - final Date date1 = cal1.getTime(); -@@ -121,6 +121,8 @@ public class FastDatePrinterTest { - // SDF bug fix starting with Java 7 - assertEquals(sdf.format(date1).replaceAll("2003 03 03 03", "2003 2003 03 2003"), fdf.format(date1)); - assertEquals(sdf.format(date2).replaceAll("2003 03 03 03", "2003 2003 03 2003"), fdf.format(date2)); -+ Locale.setDefault(current_locale); -+ TimeZone.setDefault(current_time_zone); - } - - /** -@@ -259,9 +261,10 @@ public class FastDatePrinterTest { - assertEquals(NEW_YORK, printer.getTimeZone()); - } - -- @DefaultTimeZone("UTC") - @Test - public void testTimeZoneAsZ() { -+ TimeZone current_time_zone = TimeZone.getDefault(); -+ TimeZone.setDefault(TimeZone.getTimeZone("UTC")); - final Calendar c = Calendar.getInstance(FastTimeZone.getGmtTimeZone()); - final FastDateFormat noColonFormat = FastDateFormat.getInstance("Z"); - assertEquals("+0000", noColonFormat.format(c)); -@@ -271,6 +274,7 @@ public class FastDatePrinterTest { - - final FastDateFormat colonFormat = FastDateFormat.getInstance("ZZZ"); - assertEquals("+00:00", colonFormat.format(c)); -+ TimeZone.setDefault(current_time_zone); - } - - private static Calendar initializeCalendar(final TimeZone tz) { --- -2.25.4 - diff --git a/apache-commons-lang3.spec b/apache-commons-lang3.spec index fc6496f..b4b5b30 100644 --- a/apache-commons-lang3.spec +++ b/apache-commons-lang3.spec @@ -1,5 +1,5 @@ Name: apache-commons-lang3 -Version: 3.11 +Version: 3.12.0 Release: 1%{?dist} Summary: Provides a host of helper utilities for the java.lang API License: ASL 2.0 @@ -7,10 +7,11 @@ URL: https://commons.apache.org/lang BuildArch: noarch Source0: https://archive.apache.org/dist/commons/lang/source/commons-lang3-%{version}-src.tar.gz -Patch1: 0001-Remove-usage-of-junit-pioneer.patch +Patch1: 0001-Remove-test-dependency-on-JUnit-Pioneer.patch BuildRequires: maven-local-openjdk8 BuildRequires: mvn(biz.aQute.bnd:biz.aQute.bndlib) +BuildRequires: mvn(com.google.code.findbugs:jsr305) BuildRequires: mvn(org.apache.commons:commons-parent:pom:) BuildRequires: mvn(org.apache.felix:maven-bundle-plugin) BuildRequires: mvn(org.apache.maven.plugins:maven-antrun-plugin) @@ -44,9 +45,9 @@ package. %patch1 -p1 %pom_remove_plugin :maven-javadoc-plugin -%pom_remove_dep org.junit-pioneer:junit-pioneer %pom_remove_dep org.openjdk.jmh:jmh-core %pom_remove_dep org.openjdk.jmh:jmh-generator-annprocess +%pom_remove_dep :junit-bom %mvn_file : %{name} commons-lang3 @@ -75,6 +76,9 @@ sed -i '//d' pom.xml %doc RELEASE-NOTES.txt %changelog +* Wed Mar 10 2021 Mikolaj Izdebski - 3.12.0-1 +- Update to upstream version 3.12.0 + * Tue Aug 04 2020 Marian Koncek - 3.11-1 - Update to upstream version 3.11 diff --git a/sources b/sources index 99ba852..1233e7b 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (commons-lang3-3.11-src.tar.gz) = ebcb13e47c24e6984835d9d6904fe33077aa3ba781cd61db109fa7005517e4e74cf086c4789a1d65cf3d6c4924b32337c98827a75f91aab908d8e8b9d3b92087 +SHA512 (commons-lang3-3.12.0-src.tar.gz) = 80d1b960ae0b02859be329ea60d68cef33f3c7be7ec19752b3c9cfef442adef480878317ce2cfa309a27e662e2c72cab22023eaa3702e27970a1e5d55ca43f57 From 34e3cb417e0cf368690f7e7e566e13f245bfe1bd Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Fri, 16 Apr 2021 15:33:12 +0200 Subject: [PATCH 11/11] Conditionalize buildrequires in bootstrap mode --- apache-commons-lang3.spec | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apache-commons-lang3.spec b/apache-commons-lang3.spec index b4b5b30..f1d2a45 100644 --- a/apache-commons-lang3.spec +++ b/apache-commons-lang3.spec @@ -1,3 +1,5 @@ +%bcond_without bootstrap + Name: apache-commons-lang3 Version: 3.12.0 Release: 1%{?dist} @@ -10,6 +12,9 @@ Source0: https://archive.apache.org/dist/commons/lang/source/commons-lang Patch1: 0001-Remove-test-dependency-on-JUnit-Pioneer.patch BuildRequires: maven-local-openjdk8 +%if %{with bootstrap} +BuildRequires: javapackages-bootstrap +%else BuildRequires: mvn(biz.aQute.bnd:biz.aQute.bndlib) BuildRequires: mvn(com.google.code.findbugs:jsr305) BuildRequires: mvn(org.apache.commons:commons-parent:pom:) @@ -18,6 +23,7 @@ BuildRequires: mvn(org.apache.maven.plugins:maven-antrun-plugin) BuildRequires: mvn(org.easymock:easymock) BuildRequires: mvn(org.hamcrest:hamcrest) BuildRequires: mvn(org.junit.jupiter:junit-jupiter) +%endif %description The standard Java libraries fail to provide enough methods for