Skip to content

Commit

Permalink
dev-java/jakarta-mail: skip a test which fails with jdk:21
Browse files Browse the repository at this point in the history
Signed-off-by: Volkmar W. Pogatzki <[email protected]>
Closes: gentoo#35067
Signed-off-by: Miroslav Šulc <[email protected]>
  • Loading branch information
vaukai authored and fordfrog committed Jan 30, 2024
1 parent 9719fa0 commit 52356a0
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/src/test/java/com/sun/mail/util/logging/LogManagerPropertiesTest.java b/src/test/java/com/sun/mail/util/logging/LogManagerPropertiesTest.java
index 4581777..3d41b2d 100644
--- a/src/test/java/com/sun/mail/util/logging/LogManagerPropertiesTest.java
+++ b/src/test/java/com/sun/mail/util/logging/LogManagerPropertiesTest.java
@@ -78,7 +78,7 @@ public class LogManagerPropertiesTest extends AbstractLogging {
assertEquals(Arrays.toString(declared), 0, declared.length);
}

- @Test
+ @Test @Ignore
public void testCheckAccessPresent() {
LogManager m = LogManager.getLogManager();
m.checkAccess();
42 changes: 20 additions & 22 deletions dev-java/jakarta-mail/jakarta-mail-2.0.1.ebuild
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# Copyright 1999-2022 Gentoo Authors
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

# Skeleton command:
# java-ebuilder --generate-ebuild --workdir . --pom pom.xml --download-uri https://github.com/jakartaee/mail-api/archive/2.0.1.tar.gz --slot 0 --keywords "~amd64" --ebuild jakarta-mail-2.0.1.ebuild

EAPI=8

JAVA_PKG_IUSE="doc source test"
Expand All @@ -15,31 +12,22 @@ inherit java-pkg-2 java-pkg-simple
DESCRIPTION="Implementation of the Jakarta Mail API"
HOMEPAGE="https://github.com/jakartaee/mail-api"
SRC_URI="https://github.com/jakartaee/mail-api/archive/${PV}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/mail-api-${PV}/mail"

LICENSE="EPL-1.0 EPL-2.0 GPL-2-with-classpath-exception"
SLOT="0"
KEYWORDS="amd64 ~arm arm64 ppc64 x86"

# Common dependencies
# POM: pom.xml
# com.sun.activation:jakarta.activation:2.0.1 -> >=dev-java/jakarta-activation-2.0.1:2

CP_DEPEND="dev-java/jakarta-activation:2"

DEPEND="
>=virtual/jdk-11:*
${CP_DEPEND}
"
DEPEND="${CP_DEPEND}
>=virtual/jdk-11:*"

RDEPEND="
>=virtual/jre-1.8:*
${CP_DEPEND}
"
RDEPEND="${CP_DEPEND}
>=virtual/jre-1.8:*"

DOCS=( ../{CONTRIBUTING,NOTICE,README}.md )

S="${WORKDIR}/mail-api-${PV}/mail"

JAVA_ENCODING="iso-8859-1"

JAVA_SRC_DIR="src/main/java"
Expand All @@ -56,15 +44,25 @@ src_prepare() {
}

src_test() {
# test failure with jdk:21
# 1) testCheckAccessPresent(com.sun.mail.util.logging.LogManagerPropertiesTest)
# java.lang.UnsupportedOperationException:
# The Security Manager is deprecated and will be removed in a future release
# at java.base/java.lang.System.setSecurityManager(System.java:429)
# at com.sun.mail.util.logging.LogManagerPropertiesTest.testCheckAccessPresent(LogManagerPropertiesTest.java:89)
# https://github.com/jakartaee/mail-api/pull/704#issuecomment-1911924741
local vm_version="$(java-config -g PROVIDES_VERSION)"
if ver_test "${vm_version}" -ge 21; then
eapply "${FILESDIR}/jakarta-mail-2.0.1-LogManagerPropertiesTest.patch"
fi
pushd src/test/java || die
# Selection according to 137,138 pom.xml
# This one does not run because of
# MailHandlerTest does not run because of
# "java.io.IOException: Permission denied"
# excluding it costs 141 tests.
# 1) com.sun.mail.util.logging.MailHandlerTest
local JAVA_TEST_RUN_ONLY=$(find * \
\( -wholename "**/*TestSuite.java" \
-o -wholename "**/*Test.java" \) \
\( -path "**/*TestSuite.java" \
-o -path "**/*Test.java" \) \
! -name "MailHandlerTest.java" \
)
JAVA_TEST_RUN_ONLY="${JAVA_TEST_RUN_ONLY//.java}"
Expand Down

0 comments on commit 52356a0

Please sign in to comment.