commit:     ff3cc60d536457d31e672f28f5c0a6455ce6c2b0
Author:     Volkmar W. Pogatzki <gentoo <AT> pogatzki <DOT> net>
AuthorDate: Sat Jul 26 15:12:45 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Oct  3 05:08:41 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ff3cc60d

dev-java/commons-text: new package, add 1.14.0

test-dependency of dev-java/commons-lang

Signed-off-by: Volkmar W. Pogatzki <gentoo <AT> pogatzki.net>
Part-of: https://github.com/gentoo/gentoo/pull/42983
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-java/commons-text/Manifest                     |  2 +
 dev-java/commons-text/commons-text-1.14.0.ebuild   | 69 +++++++++++++++++
 ...ext-1.14.0-ResourceBundleStringLookupTest.patch | 34 +++++++++
 ...ommons-text-1.14.0-ScriptStringLookupTest.patch | 86 ++++++++++++++++++++++
 ...bstitutorWithInterpolatorStringLookupTest.patch | 74 +++++++++++++++++++
 ...ns-text-1.14.0-UrlDecoderStringLookupTest.patch | 35 +++++++++
 ...ns-text-1.14.0-UrlEncoderStringLookupTest.patch | 35 +++++++++
 .../commons-text-1.14.0-UrlStringLookupTest.patch  | 56 ++++++++++++++
 dev-java/commons-text/metadata.xml                 | 11 +++
 9 files changed, 402 insertions(+)

diff --git a/dev-java/commons-text/Manifest b/dev-java/commons-text/Manifest
new file mode 100644
index 000000000000..9f998471cd9d
--- /dev/null
+++ b/dev-java/commons-text/Manifest
@@ -0,0 +1,2 @@
+DIST commons-text-1.14.0-src.tar.gz 365401 BLAKE2B 
bde7f76383f967c5d1cfc9dba383d93ec0f9ba37573d9ff7b030c52cd3b88405f73d56576cb151a5625be8922315438141a921ebbc5c5f4376a60a93e7475dfb
 SHA512 
db9369ca5249e447f871b03f826782ff34d55f7f375c6fe9a6e6ffb740124ad38ced4487ea0bd9fafe1603b5dade9ce6fdd7d595af63b6d3a66560de936aa46a
+DIST commons-text-1.14.0-src.tar.gz.asc 488 BLAKE2B 
354170784d3e126633725c384e4fa2f1971adf67dfad5b4e20d215c62a1eafe31abb639a6ecf11d3fc22ce5bf72e521812cee01eef43571229aaab09aa96741c
 SHA512 
9ad22be03e791dab3a1fa66c1781e6d2b2759e0c9ef2ab17bf5d1f83c17943cd5603dd243e9bcec0ae1005f884555969fd0c60ea05709780370d6eafc334b47a

diff --git a/dev-java/commons-text/commons-text-1.14.0.ebuild 
b/dev-java/commons-text/commons-text-1.14.0.ebuild
new file mode 100644
index 000000000000..bbde4a34286a
--- /dev/null
+++ b/dev-java/commons-text/commons-text-1.14.0.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+JAVA_PKG_IUSE="doc source"
+MAVEN_ID="org.apache.commons:commons-text:${PV}"
+JAVA_TESTING_FRAMEWORKS="junit-jupiter"
+
+inherit java-pkg-2 java-pkg-simple junit5 verify-sig
+
+DESCRIPTION="Apache Commons Text is a library focused on algorithms working on 
strings"
+HOMEPAGE="https://commons.apache.org/proper/commons-text/";
+SRC_URI="mirror://apache//commons/text/source/${P}-src.tar.gz
+       verify-sig? ( 
https://downloads.apache.org/commons/text/source/${P}-src.tar.gz.asc )"
+S="${WORKDIR}/${P}-src"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+
+# Some test dependencies would need version bumps causing circular deps.
+# We'll enable tests later, after updating those test dependencies.
+RESTRICT="test"
+
+BDEPEND="verify-sig? ( sec-keys/openpgp-keys-ggregory )"
+CP_DEPEND=">=dev-java/commons-lang-3.18.0:0"
+
+DEPEND="
+       ${CP_DEPEND}
+       >=virtual/jdk-11:*
+"
+#      test? (
+#              >=dev-java/commons-io-2.20.0:0
+#              >=dev-java/commons-lang-3.18.0:0
+#              dev-java/commons-rng:0
+#              >=dev-java/jmh-core-1.37:0
+#              >=dev-java/jmh-generator-annprocess-1.37:0
+#              dev-java/mockito:4
+#      )
+
+RDEPEND="
+       ${CP_DEPEND}
+       >=virtual/jre-1.8:*
+"
+
+DOCS=( CONTRIBUTING.md NOTICE.txt README.md RELEASE-NOTES.txt )
+PATCHES=(
+       "${FILESDIR}/commons-text-1.14.0-ResourceBundleStringLookupTest.patch"
+       "${FILESDIR}/commons-text-1.14.0-ScriptStringLookupTest.patch"
+       
"${FILESDIR}/commons-text-1.14.0-StringSubstitutorWithInterpolatorStringLookupTest.patch"
+       "${FILESDIR}/commons-text-1.14.0-UrlDecoderStringLookupTest.patch"
+       "${FILESDIR}/commons-text-1.14.0-UrlEncoderStringLookupTest.patch"
+       "${FILESDIR}/commons-text-1.14.0-UrlStringLookupTest.patch"
+)
+
+JAVA_AUTOMATIC_MODULE_NAME="org.apache.commons.text"
+JAVA_INTERMEDIATE_JAR_NAME="org.apache.${PN/-/.}"
+JAVA_MODULE_INFO_OUT="src/main"
+JAVA_SRC_DIR="src/main/java"
+#      JAVA_TEST_GENTOO_CLASSPATH="commons-io commons-lang commons-rng 
jmh-core jmh-generator-annprocess mockito-4"
+#      JAVA_TEST_RESOURCE_DIRS="src/test/resources"
+#      JAVA_TEST_SRC_DIR="src/test/java"
+VERIFY_SIG_OPENPGP_KEY_PATH="/usr/share/openpgp-keys/ggregory.asc"
+
+src_prepare() {
+       default #780585
+       java-pkg-2_src_prepare
+}

diff --git 
a/dev-java/commons-text/files/commons-text-1.14.0-ResourceBundleStringLookupTest.patch
 
b/dev-java/commons-text/files/commons-text-1.14.0-ResourceBundleStringLookupTest.patch
new file mode 100644
index 000000000000..8a008cda3e45
--- /dev/null
+++ 
b/dev-java/commons-text/files/commons-text-1.14.0-ResourceBundleStringLookupTest.patch
@@ -0,0 +1,34 @@
+─ testExceptionGettingString()
+       tags: []
+   uniqueId: 
[engine:junit-jupiter]/[class:org.apache.commons.text.lookup.ResourceBundleStringLookupTest]/[method:testExceptionGettingString()]
+     parent: 
[engine:junit-jupiter]/[class:org.apache.commons.text.lookup.ResourceBundleStringLookupTest]
+     source: MethodSource [className = 
'org.apache.commons.text.lookup.ResourceBundleStringLookupTest', methodName = 
'testExceptionGettingString', methodParameterTypes = '']
+     caught: org.mockito.exceptions.base.MockitoException: 
+               Cannot mock/spy class 
org.apache.commons.text.lookup.ResourceBundleStringLookup
+               Mockito cannot mock/spy because :
+                - final class
+                       at 
org.apache.commons.text.lookup.ResourceBundleStringLookupTest.testExceptionGettingString(ResourceBundleStringLookupTest.java:68)
+                       at 
java.base/java.lang.reflect.Method.invoke(Method.java:565)
+                       at 
java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
+                       at 
java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
+   duration: 204 ms
+     status: ✘ FAILED
+
+--- 
a/src/test/java/org/apache/commons/text/lookup/ResourceBundleStringLookupTest.java
++++ 
b/src/test/java/org/apache/commons/text/lookup/ResourceBundleStringLookupTest.java
+@@ -25,6 +25,7 @@ import static org.mockito.Mockito.when;
+ import java.util.ResourceBundle;
+ 
+ import org.junit.jupiter.api.Assertions;
++import org.junit.jupiter.api.Disabled;
+ import org.junit.jupiter.api.Test;
+ 
+ /**
+@@ -63,6 +64,7 @@ class ResourceBundleStringLookupTest {
+             .apply(AbstractStringLookup.toLookupKey("OtherBundle", KEY)));
+     }
+ 
++    @Disabled
+     @Test
+     void testExceptionGettingString() {
+         final ResourceBundleStringLookup mockLookup = 
spy(ResourceBundleStringLookup.class);

diff --git 
a/dev-java/commons-text/files/commons-text-1.14.0-ScriptStringLookupTest.patch 
b/dev-java/commons-text/files/commons-text-1.14.0-ScriptStringLookupTest.patch
new file mode 100644
index 000000000000..725503e07d62
--- /dev/null
+++ 
b/dev-java/commons-text/files/commons-text-1.14.0-ScriptStringLookupTest.patch
@@ -0,0 +1,86 @@
+─ testOne()
+       tags: []
+   uniqueId: 
[engine:junit-jupiter]/[class:org.apache.commons.text.lookup.ScriptStringLookupTest]/[method:testOne()]
+     parent: 
[engine:junit-jupiter]/[class:org.apache.commons.text.lookup.ScriptStringLookupTest]
+     source: MethodSource [className = 
'org.apache.commons.text.lookup.ScriptStringLookupTest', methodName = 
'testOne', methodParameterTypes = '']
+     caught: java.lang.IllegalArgumentException: Error in script engine 
[JavaScript] evaluating script ["Hello World!"].
+                       at 
org.apache.commons.text.lookup.IllegalArgumentExceptions.format(IllegalArgumentExceptions.java:49)
+                       at 
org.apache.commons.text.lookup.ScriptStringLookup.lookup(ScriptStringLookup.java:88)
+                       at 
org.apache.commons.text.lookup.StringLookup.apply(StringLookup.java:66)
+                       at 
org.apache.commons.text.lookup.ScriptStringLookupTest.testOne(ScriptStringLookupTest.java:56)
+                       at 
java.base/java.lang.reflect.Method.invoke(Method.java:565)
+                       at 
java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
+                       at 
java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
+               Caused by: java.lang.IllegalArgumentException: No script engine 
named JavaScript
+                       at 
org.apache.commons.text.lookup.ScriptStringLookup.lookup(ScriptStringLookup.java:84)
+                       ... 5 more
+   duration: 1 ms
+     status: ✘ FAILED
+─ testScriptUsingMultipleColons()
+       tags: []
+   uniqueId: 
[engine:junit-jupiter]/[class:org.apache.commons.text.lookup.ScriptStringLookupTest]/[method:testScriptUsingMultipleColons()]
+     parent: 
[engine:junit-jupiter]/[class:org.apache.commons.text.lookup.ScriptStringLookupTest]
+     source: MethodSource [className = 
'org.apache.commons.text.lookup.ScriptStringLookupTest', methodName = 
'testScriptUsingMultipleColons', methodParameterTypes = '']
+     caught: java.lang.IllegalArgumentException: Error in script engine 
[JavaScript] evaluating script [true ? "It Works" : "It Does Not Work" ].
+                       at 
org.apache.commons.text.lookup.IllegalArgumentExceptions.format(IllegalArgumentExceptions.java:49)
+                       at 
org.apache.commons.text.lookup.ScriptStringLookup.lookup(ScriptStringLookup.java:88)
+                       at 
org.apache.commons.text.lookup.StringLookup.apply(StringLookup.java:66)
+                       at 
org.apache.commons.text.lookup.ScriptStringLookupTest.testScriptUsingMultipleColons(ScriptStringLookupTest.java:72)
+                       at 
java.base/java.lang.reflect.Method.invoke(Method.java:565)
+                       at 
java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
+                       at 
java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
+               Caused by: java.lang.IllegalArgumentException: No script engine 
named JavaScript
+                       at 
org.apache.commons.text.lookup.ScriptStringLookup.lookup(ScriptStringLookup.java:84)
+                       ... 5 more
+   duration: 1 ms
+     status: ✘ FAILED
+─ testSanityCheck()
+       tags: []
+   uniqueId: 
[engine:junit-jupiter]/[class:org.apache.commons.text.lookup.ScriptStringLookupTest]/[method:testSanityCheck()]
+     parent: 
[engine:junit-jupiter]/[class:org.apache.commons.text.lookup.ScriptStringLookupTest]
+     source: MethodSource [className = 
'org.apache.commons.text.lookup.ScriptStringLookupTest', methodName = 
'testSanityCheck', methodParameterTypes = '']
+     caught: org.opentest4j.AssertionFailedError: JavaScript ==> expected: not 
<null>
+                       at 
org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:152)
+                       at 
org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
+                       at 
org.junit.jupiter.api.AssertNotNull.failNull(AssertNotNull.java:49)
+                       at 
org.junit.jupiter.api.AssertNotNull.assertNotNull(AssertNotNull.java:35)
+                       at 
org.junit.jupiter.api.Assertions.assertNotNull(Assertions.java:312)
+                       at 
org.apache.commons.text.lookup.ScriptStringLookupTest.testSanityCheck(ScriptStringLookupTest.java:61)
+                       at 
java.base/java.lang.reflect.Method.invoke(Method.java:565)
+                       at 
java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
+                       at 
java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
+   duration: 1 ms
+     status: ✘ FAILED
+
+--- a/src/test/java/org/apache/commons/text/lookup/ScriptStringLookupTest.java
++++ b/src/test/java/org/apache/commons/text/lookup/ScriptStringLookupTest.java
+@@ -22,6 +22,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
+ import javax.script.ScriptEngineManager;
+ 
+ import org.junit.jupiter.api.Assertions;
++import org.junit.jupiter.api.Disabled;
+ import org.junit.jupiter.api.Test;
+ 
+ /**
+@@ -51,11 +52,13 @@ class ScriptStringLookupTest {
+         Assertions.assertNull(ScriptStringLookup.INSTANCE.apply(null));
+     }
+ 
++    @Disabled
+     @Test
+     void testOne() {
+         Assertions.assertEquals("Hello World!", 
ScriptStringLookup.INSTANCE.apply(JS_NAME + ":\"Hello World!\""));
+     }
+ 
++    @Disabled
+     @Test
+     void testSanityCheck() {
+         Assertions.assertNotNull(new 
ScriptEngineManager().getEngineByName(JS_NAME), JS_NAME);
+@@ -66,6 +69,7 @@ class ScriptStringLookupTest {
+         assertThrows(IllegalArgumentException.class, () -> 
ScriptStringLookup.INSTANCE.apply("JavaScript=\"test\""));
+     }
+ 
++    @Disabled
+     @Test
+     void testScriptUsingMultipleColons() {
+         Assertions.assertEquals("It Works",

diff --git 
a/dev-java/commons-text/files/commons-text-1.14.0-StringSubstitutorWithInterpolatorStringLookupTest.patch
 
b/dev-java/commons-text/files/commons-text-1.14.0-StringSubstitutorWithInterpolatorStringLookupTest.patch
new file mode 100644
index 000000000000..fb6e5d7e0a96
--- /dev/null
+++ 
b/dev-java/commons-text/files/commons-text-1.14.0-StringSubstitutorWithInterpolatorStringLookupTest.patch
@@ -0,0 +1,74 @@
+
+─ testJavaScript()
+       tags: []
+   uniqueId: 
[engine:junit-jupiter]/[class:org.apache.commons.text.StringSubstitutorWithInterpolatorStringLookupTest]/[method:testJavaScript()]
+     parent: 
[engine:junit-jupiter]/[class:org.apache.commons.text.StringSubstitutorWithInterpolatorStringLookupTest]
+     source: MethodSource [className = 
'org.apache.commons.text.StringSubstitutorWithInterpolatorStringLookupTest', 
methodName = 'testJavaScript', methodParameterTypes = '']
+     caught: java.lang.IllegalArgumentException: Error in script engine 
[javascript] evaluating script ["Hello World!"].
+                       at 
org.apache.commons.text.lookup.IllegalArgumentExceptions.format(IllegalArgumentExceptions.java:49)
+                       at 
org.apache.commons.text.lookup.ScriptStringLookup.lookup(ScriptStringLookup.java:88)
+                       at 
org.apache.commons.text.lookup.StringLookup.apply(StringLookup.java:66)
+                       at 
org.apache.commons.text.lookup.InterpolatorStringLookup.lookup(InterpolatorStringLookup.java:127)
+                       at 
org.apache.commons.text.lookup.StringLookup.apply(StringLookup.java:66)
+                       at 
org.apache.commons.text.StringSubstitutor.resolveVariable(StringSubstitutor.java:1154)
+                       at 
org.apache.commons.text.StringSubstitutor.substitute(StringSubstitutor.java:1520)
+                       at 
org.apache.commons.text.StringSubstitutor.substitute(StringSubstitutor.java:1395)
+                       at 
org.apache.commons.text.StringSubstitutor.replace(StringSubstitutor.java:899)
+                       at 
org.apache.commons.text.StringSubstitutorWithInterpolatorStringLookupTest.testJavaScript(StringSubstitutorWithInterpolatorStringLookupTest.java:206)
+                       at 
java.base/java.lang.reflect.Method.invoke(Method.java:565)
+                       at 
java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
+                       at 
java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
+               Caused by: java.lang.IllegalArgumentException: No script engine 
named javascript
+                       at 
org.apache.commons.text.lookup.ScriptStringLookup.lookup(ScriptStringLookup.java:84)
+                       ... 11 more
+   duration: 1 ms
+     status: ✘ FAILED
+─ testDnsLookupAddress()
+       tags: []
+   uniqueId: 
[engine:junit-jupiter]/[class:org.apache.commons.text.StringSubstitutorWithInterpolatorStringLookupTest]/[method:testDnsLookupAddress()]
+     parent: 
[engine:junit-jupiter]/[class:org.apache.commons.text.StringSubstitutorWithInterpolatorStringLookupTest]
+     source: MethodSource [className = 
'org.apache.commons.text.StringSubstitutorWithInterpolatorStringLookupTest', 
methodName = 'testDnsLookupAddress', methodParameterTypes = '']
+     caught: java.net.UnknownHostException: apache.org: Temporary failure in 
name resolution
+                       at 
java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
+                       at 
java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Inet6AddressImpl.java:52)
+                       at 
java.base/java.net.InetAddress$PlatformResolver.lookupByName(InetAddress.java:1134)
+                       at 
java.base/java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1712)
+                       at 
java.base/java.net.InetAddress$NameServiceAddresses.get(InetAddress.java:1060)
+                       at 
java.base/java.net.InetAddress.getAllByName0(InetAddress.java:1702)
+                       at 
java.base/java.net.InetAddress.getAllByName(InetAddress.java:1582)
+                       at 
java.base/java.net.InetAddress.getByName(InetAddress.java:1492)
+                       at 
org.apache.commons.text.StringSubstitutorWithInterpolatorStringLookupTest.testDnsLookupAddress(StringSubstitutorWithInterpolatorStringLookupTest.java:161)
+                       at 
java.base/java.lang.reflect.Method.invoke(Method.java:565)
+                       at 
java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
+                       at 
java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
+   duration: 1 ms
+     status: ✘ FAILED
+
+--- 
a/src/test/java/org/apache/commons/text/StringSubstitutorWithInterpolatorStringLookupTest.java
++++ 
b/src/test/java/org/apache/commons/text/StringSubstitutorWithInterpolatorStringLookupTest.java
+@@ -28,6 +28,7 @@ import org.apache.commons.text.lookup.DefaultStringLookup;
+ import org.apache.commons.text.lookup.StringLookup;
+ import org.apache.commons.text.lookup.StringLookupFactory;
+ import org.junit.jupiter.api.Assertions;
++import org.junit.jupiter.api.Disabled;
+ import org.junit.jupiter.api.Test;
+ 
+ class StringSubstitutorWithInterpolatorStringLookupTest {
+@@ -154,7 +155,7 @@ class StringSubstitutorWithInterpolatorStringLookupTest {
+         Assertions.assertEquals(input, strSubst.replace(input));
+     }
+ 
+-    @Test
++    @Test @Disabled
+     void testDnsLookupAddress() throws UnknownHostException {
+         final StringSubstitutor strSubst =
+                 new 
StringSubstitutor(createInterpolatorWithLookups(DefaultStringLookup.DNS));
+@@ -198,7 +199,7 @@ class StringSubstitutorWithInterpolatorStringLookupTest {
+         Assertions.assertEquals(unknown, strSubst.replace(unknown));
+     }
+ 
+-    @Test
++    @Test @Disabled
+     void testJavaScript() {
+         final StringSubstitutor strSubst =
+                 new 
StringSubstitutor(createInterpolatorWithLookups(DefaultStringLookup.SCRIPT));

diff --git 
a/dev-java/commons-text/files/commons-text-1.14.0-UrlDecoderStringLookupTest.patch
 
b/dev-java/commons-text/files/commons-text-1.14.0-UrlDecoderStringLookupTest.patch
new file mode 100644
index 000000000000..f1c40eafb764
--- /dev/null
+++ 
b/dev-java/commons-text/files/commons-text-1.14.0-UrlDecoderStringLookupTest.patch
@@ -0,0 +1,35 @@
+
+─ testExceptionGettingString()
+       tags: []
+   uniqueId: 
[engine:junit-jupiter]/[class:org.apache.commons.text.lookup.UrlDecoderStringLookupTest]/[method:testExceptionGettingString()]
+     parent: 
[engine:junit-jupiter]/[class:org.apache.commons.text.lookup.UrlDecoderStringLookupTest]
+     source: MethodSource [className = 
'org.apache.commons.text.lookup.UrlDecoderStringLookupTest', methodName = 
'testExceptionGettingString', methodParameterTypes = '']
+     caught: org.mockito.exceptions.base.MockitoException: 
+               Cannot mock/spy class 
org.apache.commons.text.lookup.UrlDecoderStringLookup
+               Mockito cannot mock/spy because :
+                - final class
+                       at 
org.apache.commons.text.lookup.UrlDecoderStringLookupTest.testExceptionGettingString(UrlDecoderStringLookupTest.java:44)
+                       at 
java.base/java.lang.reflect.Method.invoke(Method.java:565)
+                       at 
java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
+                       at 
java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
+   duration: 188 ms
+     status: ✘ FAILED
+
+--- 
a/src/test/java/org/apache/commons/text/lookup/UrlDecoderStringLookupTest.java
++++ 
b/src/test/java/org/apache/commons/text/lookup/UrlDecoderStringLookupTest.java
+@@ -25,6 +25,7 @@ import java.io.UnsupportedEncodingException;
+ import java.nio.charset.StandardCharsets;
+ 
+ import org.junit.jupiter.api.Assertions;
++import org.junit.jupiter.api.Disabled;
+ import org.junit.jupiter.api.Test;
+ 
+ /**
+@@ -39,6 +40,7 @@ class UrlDecoderStringLookupTest {
+         Assertions.assertEquals(DATA, 
UrlDecoderStringLookup.INSTANCE.apply("Hello%20World%21"));
+     }
+ 
++    @Disabled
+     @Test
+     void testExceptionGettingString() throws UnsupportedEncodingException {
+         final UrlDecoderStringLookup mockLookup = 
spy(UrlDecoderStringLookup.class);

diff --git 
a/dev-java/commons-text/files/commons-text-1.14.0-UrlEncoderStringLookupTest.patch
 
b/dev-java/commons-text/files/commons-text-1.14.0-UrlEncoderStringLookupTest.patch
new file mode 100644
index 000000000000..bea9a0404bdf
--- /dev/null
+++ 
b/dev-java/commons-text/files/commons-text-1.14.0-UrlEncoderStringLookupTest.patch
@@ -0,0 +1,35 @@
+
+─ testExceptionGettingString()
+       tags: []
+   uniqueId: 
[engine:junit-jupiter]/[class:org.apache.commons.text.lookup.UrlEncoderStringLookupTest]/[method:testExceptionGettingString()]
+     parent: 
[engine:junit-jupiter]/[class:org.apache.commons.text.lookup.UrlEncoderStringLookupTest]
+     source: MethodSource [className = 
'org.apache.commons.text.lookup.UrlEncoderStringLookupTest', methodName = 
'testExceptionGettingString', methodParameterTypes = '']
+     caught: org.mockito.exceptions.base.MockitoException: 
+               Cannot mock/spy class 
org.apache.commons.text.lookup.UrlEncoderStringLookup
+               Mockito cannot mock/spy because :
+                - final class
+                       at 
org.apache.commons.text.lookup.UrlEncoderStringLookupTest.testExceptionGettingString(UrlEncoderStringLookupTest.java:44)
+                       at 
java.base/java.lang.reflect.Method.invoke(Method.java:565)
+                       at 
java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
+                       at 
java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
+   duration: 196 ms
+     status: ✘ FAILED
+
+--- 
a/src/test/java/org/apache/commons/text/lookup/UrlEncoderStringLookupTest.java
++++ 
b/src/test/java/org/apache/commons/text/lookup/UrlEncoderStringLookupTest.java
+@@ -25,6 +25,7 @@ import java.io.UnsupportedEncodingException;
+ import java.nio.charset.StandardCharsets;
+ 
+ import org.junit.jupiter.api.Assertions;
++import org.junit.jupiter.api.Disabled;
+ import org.junit.jupiter.api.Test;
+ 
+ /**
+@@ -39,6 +40,7 @@ class UrlEncoderStringLookupTest {
+         Assertions.assertEquals(DATA, 
UrlEncoderStringLookup.INSTANCE.apply("Hello World!"));
+     }
+ 
++    @Disabled
+     @Test
+     void testExceptionGettingString() throws UnsupportedEncodingException {
+         final UrlEncoderStringLookup mockLookup = 
spy(UrlEncoderStringLookup.class);

diff --git 
a/dev-java/commons-text/files/commons-text-1.14.0-UrlStringLookupTest.patch 
b/dev-java/commons-text/files/commons-text-1.14.0-UrlStringLookupTest.patch
new file mode 100644
index 000000000000..99f3b51efa4b
--- /dev/null
+++ b/dev-java/commons-text/files/commons-text-1.14.0-UrlStringLookupTest.patch
@@ -0,0 +1,56 @@
+
+testHttpScheme()
+     tags: []
+ uniqueId: 
[engine:junit-jupiter]/[class:org.apache.commons.text.lookup.UrlStringLookupTest]/[method:testHttpScheme()]
+   parent: 
[engine:junit-jupiter]/[class:org.apache.commons.text.lookup.UrlStringLookupTest]
+   source: MethodSource [className = 
'org.apache.commons.text.lookup.UrlStringLookupTest', methodName = 
'testHttpScheme', methodParameterTypes = '']
+   caught: java.lang.IllegalArgumentException: Error looking up URL 
[https://www.apache.org] with Charset [UTF-8].
+               at 
org.apache.commons.text.lookup.IllegalArgumentExceptions.format(IllegalArgumentExceptions.java:49)
+               at 
org.apache.commons.text.lookup.UrlStringLookup.lookup(UrlStringLookup.java:88)
+               at 
org.apache.commons.text.lookup.StringLookup.apply(StringLookup.java:66)
+               at 
org.apache.commons.text.lookup.UrlStringLookupTest.testHttpScheme(UrlStringLookupTest.java:63)
+               at java.base/java.lang.reflect.Method.invoke(Method.java:565)
+               at java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
+               at java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
+             Caused by: java.net.UnknownHostException: www.apache.org
+               at 
java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:569)
+               at 
java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:284)
+               at java.base/java.net.Socket.connect(Socket.java:666)
+               at 
java.base/sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:304)
+               at 
java.base/sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:181)
+               at 
java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:166)
+               at 
java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:516)
+               at 
java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:604)
+               at 
java.base/sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:206)
+               at 
java.base/sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:288)
+               at 
java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:193)
+               at 
java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:963)
+               at 
java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:899)
+               at 
java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:179)
+               at 
java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1377)
+               at 
java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1302)
+               at 
java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:223)
+               at java.base/java.net.URL.openStream(URL.java:1263)
+               at 
org.apache.commons.text.lookup.UrlStringLookup.lookup(UrlStringLookup.java:79)
+               ... 5 more
+ duration: 2 ms
+   status: ✘ FAILED
+
+--- a/src/test/java/org/apache/commons/text/lookup/UrlStringLookupTest.java
++++ b/src/test/java/org/apache/commons/text/lookup/UrlStringLookupTest.java
+@@ -26,6 +26,7 @@ import java.nio.file.Path;
+ import java.nio.file.Paths;
+ 
+ import org.junit.jupiter.api.Assertions;
++import org.junit.jupiter.api.Disabled;
+ import org.junit.jupiter.api.Test;
+ 
+ /**
+@@ -58,6 +59,7 @@ class UrlStringLookupTest {
+         Assertions.assertEquals(expectedString, 
UrlStringLookup.INSTANCE.apply("UTF-8:" + uri.toString()));
+     }
+ 
++    @Disabled
+     @Test
+     void testHttpScheme() {
+         
Assertions.assertNotNull(UrlStringLookup.INSTANCE.apply("UTF-8:https://www.apache.org";));

diff --git a/dev-java/commons-text/metadata.xml 
b/dev-java/commons-text/metadata.xml
new file mode 100644
index 000000000000..2b0182720f86
--- /dev/null
+++ b/dev-java/commons-text/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer type="project">
+               <email>[email protected]</email>
+               <name>Java</name>
+       </maintainer>
+       <upstream>
+               <remote-id type="github">apache/commons-text</remote-id>
+       </upstream>
+</pkgmetadata>

Reply via email to