public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Miroslav Šulc" <fordfrog@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-java/httpcore/, dev-java/httpcore/files/
Date: Sun, 26 May 2024 08:17:20 +0000 (UTC)	[thread overview]
Message-ID: <1716711360.b2d5b0a7b42398ddbe0fbb50c192d70280c049df.fordfrog@gentoo> (raw)

commit:     b2d5b0a7b42398ddbe0fbb50c192d70280c049df
Author:     Volkmar W. Pogatzki <gentoo <AT> pogatzki <DOT> net>
AuthorDate: Sun Feb  4 10:52:34 2024 +0000
Commit:     Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
CommitDate: Sun May 26 08:16:00 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b2d5b0a7

dev-java/httpcore: handle test failures #923603

Closes: https://bugs.gentoo.org/923603
Signed-off-by: Volkmar W. Pogatzki <gentoo <AT> pogatzki.net>
Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org>

 .../files/httpcore-4.4.14-skipFailingTest.patch    | 55 ++++++++++++++++++++++
 dev-java/httpcore/httpcore-4.4.14.ebuild           | 15 ++++--
 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
 }


                 reply	other threads:[~2024-05-26  8:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1716711360.b2d5b0a7b42398ddbe0fbb50c192d70280c049df.fordfrog@gentoo \
    --to=fordfrog@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox