summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolkmar W. Pogatzki <gentoo@pogatzki.net>2023-03-27 20:31:01 +0200
committerMiroslav Šulc <fordfrog@gentoo.org>2023-03-28 07:41:28 +0200
commit1e222c79dacec0c31843d9618830b1e5ee3d654a (patch)
treefb0f454803dcf75f6835bed5bb6a58fc4e9ed0c1 /dev-java/xom
parentdev-python/qtsass: Add GH remote-id (diff)
downloadgentoo-1e222c79dacec0c31843d9618830b1e5ee3d654a.tar.gz
gentoo-1e222c79dacec0c31843d9618830b1e5ee3d654a.tar.bz2
gentoo-1e222c79dacec0c31843d9618830b1e5ee3d654a.zip
dev-java/xom: re-add xom-1.3.7-disable-invalid-test.patch
Signed-off-by: Volkmar W. Pogatzki <gentoo@pogatzki.net> Closes: https://github.com/gentoo/gentoo/pull/30371 Signed-off-by: Miroslav Šulc <fordfrog@gentoo.org>
Diffstat (limited to 'dev-java/xom')
-rw-r--r--dev-java/xom/files/xom-1.3.7-disable-invalid-test.patch13
-rw-r--r--dev-java/xom/xom-1.3.8-r1.ebuild (renamed from dev-java/xom/xom-1.3.8.ebuild)42
2 files changed, 51 insertions, 4 deletions
diff --git a/dev-java/xom/files/xom-1.3.7-disable-invalid-test.patch b/dev-java/xom/files/xom-1.3.7-disable-invalid-test.patch
index ef897ae004c9..6ee097470edc 100644
--- a/dev-java/xom/files/xom-1.3.7-disable-invalid-test.patch
+++ b/dev-java/xom/files/xom-1.3.7-disable-invalid-test.patch
@@ -1,5 +1,14 @@
-diff --git a/XOM/src/nu/xom/tests/XSLTransformTest.java b/XOM/src/nu/xom/tests/XSLTransformTest.java
-index 443c058..56f7b6e 100644
+1) testIllegalTransform(nu.xom.tests.XSLTransformTest)
+nu.xom.xslt.XSLException: Syntax error in stylesheet
+ at nu.xom.xslt.XSLTransform.<init>(XSLTransform.java:181)
+ at nu.xom.xslt.XSLTransform.<init>(XSLTransform.java:226)
+ at nu.xom.xslt.XSLTransform.<init>(XSLTransform.java:201)
+ at nu.xom.tests.XSLTransformTest.testIllegalTransform(XSLTransformTest.java:775)
+ ... 25 trimmed
+Caused by: javax.xml.transform.TransformerConfigurationException: Cannot find external method 'www.example.com.fn' (must be public).
+ at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:990)
+ at nu.xom.xslt.XSLTransform.<init>(XSLTransform.java:173)
+ ... 29 more
--- a/XOM/src/nu/xom/tests/XSLTransformTest.java
+++ b/XOM/src/nu/xom/tests/XSLTransformTest.java
@@ -765,7 +765,7 @@ public class XSLTransformTest extends XOMTestCase {
diff --git a/dev-java/xom/xom-1.3.8.ebuild b/dev-java/xom/xom-1.3.8-r1.ebuild
index d8489ef1cab9..f3124d0ca351 100644
--- a/dev-java/xom/xom-1.3.8.ebuild
+++ b/dev-java/xom/xom-1.3.8-r1.ebuild
@@ -4,7 +4,8 @@
EAPI=8
JAVA_PKG_IUSE="doc source test"
-JAVA_TESTING_FRAMEWORKS="junit"
+JAVA_TESTING_FRAMEWORKS="junit-4"
+MAVEN_ID="xom:xom:${PV}"
inherit java-pkg-2 java-pkg-simple
@@ -29,16 +30,20 @@ DEPEND="
dev-java/junit:0
>=virtual/jdk-1.8:*"
+PATCHES=( "${FILESDIR}/xom-1.3.7-disable-invalid-test.patch" )
+
JAVA_AUTOMATIC_MODULE_NAME="nu.xom"
JAVA_MAIN_CLASS="nu.xom.Info"
JAVA_RESOURCE_DIRS="src/main/resources"
JAVA_SRC_DIR="src/main/java"
-JAVA_TEST_GENTOO_CLASSPATH="junit"
+JAVA_TEST_GENTOO_CLASSPATH="junit-4"
JAVA_TEST_SRC_DIR="src/test/java"
src_prepare() {
java-pkg-2_src_prepare
+ java-pkg_clean
+ default
# removing directories based on build.xml
rm -rv XOM/src/nu/xom/benchmarks/ || die
@@ -59,3 +64,36 @@ src_prepare() {
done
popd
}
+
+src_test() {
+ # These tests need to run separately, otherwise fail
+ # Should pass with "OK (126 tests)"
+ JAVA_TEST_RUN_ONLY=(
+ nu.xom.tests.AttributesTest
+ nu.xom.tests.DocumentTest
+ nu.xom.tests.ElementTest
+ nu.xom.tests.NodesTest
+ nu.xom.tests.ParentNodeTest
+ )
+ java-pkg-simple_src_test
+
+ JAVA_TEST_RUN_ONLY=()
+ pushd src/test/java > /dev/null || die
+ # Exclude EBCDICTest.java
+ # https://github.com/elharo/xom/blob/v1.3.8/src/nu/xom/tests/EBCDICTest.java#L71-L73
+ # And exclude those tests already run before
+ local JAVA_TEST_RUN_ONLY=$(find * \
+ -type f \
+ -name "*Test.java" \
+ ! -name 'EBCDICTest.java' \
+ ! -name 'AttributesTest.java' \
+ ! -name 'DocumentTest.java' \
+ ! -name 'ElementTest.java' \
+ ! -name 'NodesTest.java' \
+ ! -name 'ParentNodeTest.java' \
+ )
+ JAVA_TEST_RUN_ONLY="${JAVA_TEST_RUN_ONLY//.java}"
+ JAVA_TEST_RUN_ONLY="${JAVA_TEST_RUN_ONLY//\//.}"
+ popd > /dev/null || die
+ java-pkg-simple_src_test
+}