summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolkmar W. Pogatzki <gentoo@pogatzki.net>2024-02-04 11:52:34 +0100
committerMiroslav Šulc <fordfrog@gentoo.org>2024-05-26 10:16:00 +0200
commitb2d5b0a7b42398ddbe0fbb50c192d70280c049df (patch)
treeafd98eb8550ab4517a643bca236ff30013078913 /dev-java
parentprofiles/package.mask: mask dev-ruby/uconv for removal (diff)
downloadgentoo-b2d5b0a7b42398ddbe0fbb50c192d70280c049df.tar.gz
gentoo-b2d5b0a7b42398ddbe0fbb50c192d70280c049df.tar.bz2
gentoo-b2d5b0a7b42398ddbe0fbb50c192d70280c049df.zip
dev-java/httpcore: handle test failures #923603
Closes: https://bugs.gentoo.org/923603 Signed-off-by: Volkmar W. Pogatzki <gentoo@pogatzki.net> Signed-off-by: Miroslav Šulc <fordfrog@gentoo.org>
Diffstat (limited to 'dev-java')
-rw-r--r--dev-java/httpcore/files/httpcore-4.4.14-skipFailingTest.patch55
-rw-r--r--dev-java/httpcore/httpcore-4.4.14.ebuild15
2 files changed, 66 insertions, 4 deletions
diff --git a/dev-java/httpcore/files/httpcore-4.4.14-skipFailingTest.patch b/dev-java/httpcore/files/httpcore-4.4.14-skipFailingTest.patch
new file mode 100644
index 000000000000..5c722c5e714d
--- /dev/null
+++ b/dev-java/httpcore/files/httpcore-4.4.14-skipFailingTest.patch
@@ -0,0 +1,55 @@
+There was 1 failure:
+1) testRequestTargetHostFallback(org.apache.http.protocol.TestStandardInterceptors)
+org.mockito.exceptions.base.MockitoException:
+Mockito cannot mock this class: class java.net.InetAddress
+Mockito can only mock visible & non-final classes.
+If you're not sure why you're getting this error, please report to the mailing list.
+ at org.apache.http.protocol.TestStandardInterceptors.testRequestTargetHostFallback(TestStandardInterceptors.java:372)
+ ... 31 trimmed
+Caused by: org.mockito.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
+ at org.mockito.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:238)
+ at org.mockito.cglib.proxy.Enhancer.createHelper(Enhancer.java:378)
+ at org.mockito.cglib.proxy.Enhancer.createClass(Enhancer.java:318)
+ at org.mockito.internal.creation.jmock.ClassImposterizer.createProxyClass(ClassImposterizer.java:110)
+ at org.mockito.internal.creation.jmock.ClassImposterizer.imposterise(ClassImposterizer.java:62)
+ at org.mockito.internal.creation.jmock.ClassImposterizer.imposterise(ClassImposterizer.java:56)
+ at org.mockito.internal.creation.CglibMockMaker.createMock(CglibMockMaker.java:23)
+ at org.mockito.internal.util.MockUtil.createMock(MockUtil.java:26)
+ at org.mockito.internal.MockitoCore.mock(MockitoCore.java:51)
+ at org.mockito.Mockito.mock(Mockito.java:1243)
+ at org.mockito.Mockito.mock(Mockito.java:1120)
+ ... 33 more
+Caused by: java.lang.reflect.InvocationTargetException
+ at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:118)
+ at java.base/java.lang.reflect.Method.invoke(Method.java:580)
+ at org.mockito.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:385)
+ at org.mockito.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:220)
+ ... 43 more
+Caused by: java.lang.IncompatibleClassChangeError: class $java.net.InetAddress$$EnhancerByMockitoWithCGLIB$$d2bd6316 cannot inherit from sealed class java.net.InetAddress
+ at java.base/java.lang.ClassLoader.defineClass1(Native Method)
+ at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1027)
+ at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
+ ... 46 more
+
+FAILURES!!!
+Tests run: 665, Failures: 1
+
+--- a/src/test/java/org/apache/http/protocol/TestStandardInterceptors.java
++++ b/src/test/java/org/apache/http/protocol/TestStandardInterceptors.java
+@@ -44,6 +44,7 @@ import org.apache.http.message.BasicHttpRequest;
+ import org.apache.http.message.BasicHttpResponse;
+ import org.junit.Assert;
+ import org.junit.Test;
++import org.junit.Ignore;
+ import org.mockito.Mockito;
+
+ public class TestStandardInterceptors {
+@@ -365,7 +366,7 @@ public class TestStandardInterceptors {
+ Assert.assertEquals("somehost:8080", header.getValue());
+ }
+
+- @Test
++ @Test @Ignore
+ public void testRequestTargetHostFallback() throws Exception {
+ final HttpContext context = new BasicHttpContext(null);
+ final BasicHttpRequest request = new BasicHttpRequest("GET", "/");
diff --git a/dev-java/httpcore/httpcore-4.4.14.ebuild b/dev-java/httpcore/httpcore-4.4.14.ebuild
index ff51d1ba0fdb..f243859d5639 100644
--- a/dev-java/httpcore/httpcore-4.4.14.ebuild
+++ b/dev-java/httpcore/httpcore-4.4.14.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Skeleton command:
@@ -48,7 +48,14 @@ JAVA_TEST_GENTOO_CLASSPATH="commons-logging,junit-4,mockito"
JAVA_TEST_SRC_DIR="src/test/java"
JAVA_TEST_RESOURCE_DIRS="src/test/resources"
-src_install() {
- default
- java-pkg-simple_src_install
+src_test() {
+ # https://bugs.gentoo.org/923603
+ local vm_version="$(java-config -g PROVIDES_VERSION)"
+ if ver_test "${vm_version}" -ge "17" ; then
+ JAVA_TEST_EXTRA_ARGS+=( --add-opens=java.base/java.lang=ALL-UNNAMED )
+ JAVA_TEST_EXTRA_ARGS+=( --add-opens=java.base/java.net=ALL-UNNAMED )
+ JAVA_TEST_EXTRA_ARGS+=( --add-opens=java.base/java.io=ALL-UNNAMED )
+ eapply "${FILESDIR}/httpcore-4.4.14-skipFailingTest.patch"
+ fi
+ java-pkg-simple_src_test
}