diff options
| author | root <root@alpha.trunkmasters.com> | 2026-06-04 16:24:49 -0500 |
|---|---|---|
| committer | root <root@alpha.trunkmasters.com> | 2026-06-04 16:24:49 -0500 |
| commit | a3ceca1b4c0d9bdb550dc23f06ffbb5a8e033bc7 (patch) | |
| tree | 0c52bbae1c242fbc296bd650fcd1167685f81492 /dev-java/junit | |
| parent | bfd9c39e4712ebdb442d4ca0673061faed1e70e1 (diff) | |
| download | baldeagleos-repo-a3ceca1b4c0d9bdb550dc23f06ffbb5a8e033bc7.tar.gz baldeagleos-repo-a3ceca1b4c0d9bdb550dc23f06ffbb5a8e033bc7.tar.xz baldeagleos-repo-a3ceca1b4c0d9bdb550dc23f06ffbb5a8e033bc7.zip | |
Adding metadata
Diffstat (limited to 'dev-java/junit')
| -rw-r--r-- | dev-java/junit/Manifest | 3 | ||||
| -rw-r--r-- | dev-java/junit/files/junit-4.13.2_p20240222-ignore-failing-test.patch | 85 | ||||
| -rw-r--r-- | dev-java/junit/files/junit5-java18-compatibility.patch | 14 | ||||
| -rw-r--r-- | dev-java/junit/junit-3.8.2-r2.ebuild | 37 | ||||
| -rw-r--r-- | dev-java/junit/junit-4.13.2_p20240222.ebuild | 54 | ||||
| -rw-r--r-- | dev-java/junit/junit-5.10.3-r1.ebuild | 349 | ||||
| -rw-r--r-- | dev-java/junit/metadata.xml | 18 |
7 files changed, 0 insertions, 560 deletions
diff --git a/dev-java/junit/Manifest b/dev-java/junit/Manifest deleted file mode 100644 index 93b1c2751094..000000000000 --- a/dev-java/junit/Manifest +++ /dev/null @@ -1,3 +0,0 @@ -DIST junit-4.13.2_p20240222.tar.gz 1007781 BLAKE2B 4eeab59aa7ff3cc65c73318acb562523e6ba781da6a0baf28f8fa82042f1affddb583d188c550207a7e267b3475f4a546e8e25eba61d5ba36d13bd7e277ad156 SHA512 89506413b7aca7c2d0b41c8297dde48c1b90a44133bfb3ebf300247c7837839a3aff2d785d891ddb8762427d718eacf016a1d67e2e24edda05f4eae36ca311f1 -DIST junit-5.10.3.tar.gz 2944861 BLAKE2B 38ca01363ecd1a2bb1b66d93bbc8a6e34c94ee574fd44857239223f6253051c355572ac8ecece21610ea8afeabdc62df30caab1994ae9bbfa9fa9c71097ac956 SHA512 8d3621b6da6e70017957e280fd2848fdc77136497bf4399a1690f2db0f53b1b079f85ec19b6d3115cc01fe24454e118548944d45e1c23f2a404b640e587b0771 -DIST junit3.8.2.zip 461426 BLAKE2B 8fbef1ccdf7f71c611976d63f45838f4cb2564da5f5064e7abc39931a3c99039a40660093aba2cc3c70af761171125f434c16c52021226f2e92fdf23597dbf25 SHA512 f203332ccc2bdc38c683a95bdbe448f38cbfbeea81ecc431bf9ebf0a3292f0150fcfe5cd5dd6da481be034366820f95775a33581931aed9e4cc12a6ff27e3930 diff --git a/dev-java/junit/files/junit-4.13.2_p20240222-ignore-failing-test.patch b/dev-java/junit/files/junit-4.13.2_p20240222-ignore-failing-test.patch deleted file mode 100644 index 512f680c3aaf..000000000000 --- a/dev-java/junit/files/junit-4.13.2_p20240222-ignore-failing-test.patch +++ /dev/null @@ -1,85 +0,0 @@ -1) lookingForStuckThread_threadGroupNotLeaked[lookingForStuckThread = true](org.junit.internal.runners.statements.FailOnTimeoutTest) -java.lang.AssertionError: the 'FailOnTimeoutGroup' thread group should be destroyed after running the test - at org.junit.Assert.fail(Assert.java:89) - at org.junit.Assert.assertTrue(Assert.java:42) - at org.junit.internal.runners.statements.FailOnTimeoutTest.lookingForStuckThread_threadGroupNotLeaked(FailOnTimeoutTest.java:207) - at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) - at java.base/java.lang.reflect.Method.invoke(Method.java:580) - at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59) - at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) - at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:61) - at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) - at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) - at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100) - at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366) - at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103) - at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63) - at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329) - at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293) - at org.junit.runners.ParentRunner.run(ParentRunner.java:413) - at org.junit.runners.Suite.runChild(Suite.java:128) - at org.junit.runners.Suite.runChild(Suite.java:27) - at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329) - at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293) - at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) - at org.junit.runners.ParentRunner.run(ParentRunner.java:413) - at org.junit.runners.Suite.runChild(Suite.java:128) - at org.junit.runners.Suite.runChild(Suite.java:27) - at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329) - at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293) - at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) - at org.junit.runners.ParentRunner.run(ParentRunner.java:413) - at org.junit.runners.Suite.runChild(Suite.java:128) - at org.junit.runners.Suite.runChild(Suite.java:27) - at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329) - at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293) - at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) - at org.junit.runners.ParentRunner.run(ParentRunner.java:413) - at org.junit.runners.Suite.runChild(Suite.java:128) - at org.junit.runners.Suite.runChild(Suite.java:27) - at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329) - at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293) - at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) - at org.junit.runners.ParentRunner.run(ParentRunner.java:413) - at org.junit.runner.JUnitCore.run(JUnitCore.java:141) - at org.junit.runner.JUnitCore.run(JUnitCore.java:119) - at org.junit.runner.JUnitCore.runMain(JUnitCore.java:81) - at org.junit.runner.JUnitCore.runMain(JUnitCore.java:40) - at org.junit.runner.JUnitCore.main(JUnitCore.java:36) - -FAILURES!!! -Tests run: 1106, Failures: 1 ---- a/src/test/java/org/junit/internal/runners/statements/FailOnTimeoutTest.java -+++ b/src/test/java/org/junit/internal/runners/statements/FailOnTimeoutTest.java -@@ -23,6 +23,7 @@ import java.util.concurrent.atomic.AtomicBoolean; - import java.util.concurrent.atomic.AtomicReference; - - import org.junit.Test; -+import org.junit.Ignore; - import org.junit.function.ThrowingRunnable; - import org.junit.runner.RunWith; - import org.junit.runners.Parameterized; -@@ -181,7 +182,7 @@ public class FailOnTimeoutTest { - } - } - -- @Test -+ @Test @Ignore - public void lookingForStuckThread_threadGroupNotLeaked() throws Throwable { - assumeTrue(lookingForStuckThread); - final AtomicReference<ThreadGroup> innerThreadGroup = new AtomicReference<ThreadGroup>(); diff --git a/dev-java/junit/files/junit5-java18-compatibility.patch b/dev-java/junit/files/junit5-java18-compatibility.patch deleted file mode 100644 index 8015d4658b7b..000000000000 --- a/dev-java/junit/files/junit5-java18-compatibility.patch +++ /dev/null @@ -1,14 +0,0 @@ -Description: Fixes the compatibility with the latest version of Java -Author: Emmanuel Bourg <ebourg@apache.org> -Forwarded: no ---- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestIdentifier.java -+++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestIdentifier.java -@@ -316,7 +316,7 @@ - } - - @SuppressWarnings("unchecked") -- private SerializedForm(ObjectInputStream.GetField fields) throws IOException { -+ private SerializedForm(ObjectInputStream.GetField fields) throws ClassNotFoundException, IOException { - this.uniqueId = (String) fields.get("uniqueId", null); - this.parentId = (String) fields.get("parentId", null); - this.displayName = (String) fields.get("displayName", null); diff --git a/dev-java/junit/junit-3.8.2-r2.ebuild b/dev-java/junit/junit-3.8.2-r2.ebuild deleted file mode 100644 index 0c4baf46e39c..000000000000 --- a/dev-java/junit/junit-3.8.2-r2.ebuild +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright 1999-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -JAVA_PKG_IUSE="doc source" -MAVEN_ID="junit:junit:3.8.2" - -inherit java-pkg-2 java-pkg-simple - -DESCRIPTION="Simple framework to write repeatable tests" -HOMEPAGE="https://junit.org/" -SRC_URI="https://downloads.sourceforge.net/project/junit/junit/${PV}/junit${PV}.zip" -S="${WORKDIR}/junit${PV}" - -LICENSE="CPL-1.0" -SLOT="0" -KEYWORDS="amd64 arm64 ppc64 ~x64-macos ~x64-solaris" - -BDEPEND="app-arch/unzip" -DEPEND=">=virtual/jdk-1.8" -RDEPEND=">=virtual/jre-1.8" - -HTML_DOCS=( README.html cpl-v10.html ) - -JAVA_SRC_DIR="${PN}" - -src_unpack() { - unpack ${A} - cd "${S}" || die - unzip src.jar || die -} - -src_prepare() { - java-pkg-2_src_prepare - java-pkg_clean -} diff --git a/dev-java/junit/junit-4.13.2_p20240222.ebuild b/dev-java/junit/junit-4.13.2_p20240222.ebuild deleted file mode 100644 index c8bb1759613c..000000000000 --- a/dev-java/junit/junit-4.13.2_p20240222.ebuild +++ /dev/null @@ -1,54 +0,0 @@ -# Copyright 1999-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -JAVA_PKG_IUSE="doc source test" -MAVEN_ID="junit:junit:${PV}" - -inherit java-pkg-2 java-pkg-simple - -DESCRIPTION="Simple framework to write repeatable tests" -HOMEPAGE="https://junit.org/junit4/" -MY_COMMIT="28fa2cae48b365c949935b28967ffb3f388e77ef" -SRC_URI="https://github.com/${PN}-team/${PN}4/archive/${MY_COMMIT}.tar.gz -> ${P}.tar.gz" -S="${WORKDIR}/${PN}4-${MY_COMMIT}" - -LICENSE="EPL-1.0" -SLOT="4" -KEYWORDS="amd64 arm64 ppc64 ~x64-macos ~x64-solaris" - -CP_DEPEND="dev-java/hamcrest-core:1.3" -DEPEND="${CP_DEPEND} - >=virtual/jdk-1.8:* - test? ( dev-java/hamcrest-library:1.3 )" -RDEPEND="${CP_DEPEND} - >=virtual/jre-1.8:*" - -PATCHES=( "${FILESDIR}/junit-4.13.2_p20240222-ignore-failing-test.patch" ) - -JAVA_AUTOMATIC_MODULE_NAME="junit" -JAVA_ENCODING="ISO-8859-1" -JAVA_RESOURCE_DIRS="src/main/resources" -JAVA_SRC_DIR="src/main/java" - -JAVA_TEST_GENTOO_CLASSPATH="hamcrest-core-1.3,hamcrest-library-1.3" -JAVA_TEST_SRC_DIR="src/test/java" -JAVA_TEST_RESOURCE_DIRS="src/test/resources" - -src_prepare() { - default #780585 - java-pkg-2_src_prepare -} - -src_test() { - cd "${JAVA_TEST_SRC_DIR}" || die - - local CP=".:../resources:${S}/${PN}.jar:$(java-pkg_getjars \ - --build-only ${JAVA_TEST_GENTOO_CLASSPATH})" - - ejavac -cp "${CP}" -d . $(find * -name "*.java") - # pom.xml lines 264-268 - java -cp "${CP}" -Djava.awt.headless=true \ - org.junit.runner.JUnitCore org.junit.tests.AllTests || die "Running junit failed" -} diff --git a/dev-java/junit/junit-5.10.3-r1.ebuild b/dev-java/junit/junit-5.10.3-r1.ebuild deleted file mode 100644 index 133ab09b8476..000000000000 --- a/dev-java/junit/junit-5.10.3-r1.ebuild +++ /dev/null @@ -1,349 +0,0 @@ -# Copyright 1999-2025 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -# Declare the 'doc' USE flag in IUSE -- not JAVA_PKG_IUSE -- to -# prevent java-pkg-simple.eclass from handling Javadoc; instead, -# let this ebuild handle Javadoc generation and installation itself. -# This ebuild invokes java-pkg-simple.eclass's phase functions -# multiple times to build multiple modules, but the eclass always -# installs each module's Javadoc to the same directory, which would -# trigger an error when the second module's Javadoc is installed. -JAVA_PKG_IUSE="source test" - -inherit java-pkg-2 java-pkg-simple - -DESCRIPTION="Simple framework to write repeatable tests" -HOMEPAGE="https://junit.org" -DEB="5.10.1-1" -SRC_URI="https://github.com/junit-team/junit5/archive/r${PV}.tar.gz -> ${P}.tar.gz" -S="${WORKDIR}/junit5-r${PV}" - -LICENSE="EPL-2.0" -SLOT="5" -KEYWORDS="amd64 arm64 ppc64" -IUSE="doc migration-support suite vintage" - -CP_DEPEND=" - dev-java/apiguardian-api:0 - dev-java/opentest4j:0 - <=dev-java/open-test-reporting-events-0.1.0_pre1:0 - dev-java/picocli:0 - dev-java/univocity-parsers:0 -" - -# java-utils-2.eclass does not support -# USE-conditional dependencies in CP_DEPEND -COND_DEPEND=" - migration-support? ( dev-java/junit:4 ) - vintage? ( dev-java/junit:4 ) -" - -# Limiting JDK version to >=11 for module-info.java in this package -# https://bugs.gentoo.org/796875#c3 -DEPEND=" - >=virtual/jdk-11:* - ${CP_DEPEND} - ${COND_DEPEND} - test? ( dev-java/jimfs:0 ) -" - -RDEPEND=" - >=virtual/jre-1.8:* - ${CP_DEPEND} - ${COND_DEPEND} -" - -PATCHES=( - "${FILESDIR}/junit5-java18-compatibility.patch" -) - -src_prepare() { - default #780585 - java-pkg-2_src_prepare -} - -src_configure() { - # Please make sure to declare a module's dependencies before the module itself. - # Useful upstream documentation regarding modules and dependencies: - # https://junit.org/junit5/docs/current/user-guide/index.html#dependency-metadata - # https://junit.org/junit5/docs/current/user-guide/index.html#dependency-diagram - JUNIT5_MODULES=( - junit-platform-commons - junit-platform-engine - junit-platform-launcher - junit-platform-reporting - junit-platform-console # For launching tests from CLI; - # an eclass would need it to support running tests using JUnit 5 - - $(use suite && echo \ - junit-platform-suite-api \ - junit-platform-suite-commons \ - junit-platform-suite-engine \ - ) - - junit-jupiter-api - junit-jupiter-engine # For JUnit Jupiter tests -- the so-called - # "JUnit 5 tests", which cannot run on earlier JUnit versions - junit-jupiter-params # For parameterized tests; the junit-jupiter - # aggregator module includes it, so building it unconditionally - $(usev migration-support junit-jupiter-migrationsupport) - - $(usev vintage junit-vintage-engine) - - # Modules not included: - # - junit-bom: Has no sources; solely for helping Maven and Gradle - # projects that use JUnit 5 manage dependencies easier - # - junit-jupiter: Aggregator; does not have 'src/main/java' - # - junit-platform-console-standalone: Has no sources; solely used - # by the upstream to build a fat JAR that bundles everything, so - # users can use just this single JAR to run JUnit 5 - # - junit-platform-jfr: For an experimental feature - # - junit-platform-runner: Deprecated - # - junit-platform-suite: Aggregator; does not have 'src/main/java' - # - junit-platform-testkit: Requires >=dev-java/assertj-core-3.14.0 - ) - local cp_packages=() - (use migration-support || use vintage) && cp_packages+=( junit-4 ) - local save_IFS="${IFS}" - IFS=',' JAVA_GENTOO_CLASSPATH="${cp_packages[*]}" - IFS="${save_IFS}" - - JUNIT5_VM_VERSION="$(java-config --get-env PROVIDES_VERSION)" -} - -junit5_foreach_module() { - local module - for module in "${JUNIT5_MODULES[@]}"; do - junit5_module_do "${module}" "${@}" - done -} - -junit5_module_do() { - local module="${1}" - # Invocation of the passed function will not be guarded by '|| die'. - # Like the case for multibuild_foreach_variant(), it is recommended - # that the passed function itself calls 'die'. - local func=( "${@:2}" ) - - einfo "Running '${func[@]}' for ${module} ..." - pushd "${module}" > /dev/null || die "Failed to enter directory '${module}'" - - # Set up Java eclass variables that are - # supposed to be set in the ebuild global scope - - local JAVA_JAR_FILENAME="${module}.jar" - - local JAVA_SRC_DIR=( - src/main/java - src/module - ) - - local JAVA_RESOURCE_DIRS=() - local default_resource_dir="src/main/resources" - [[ -d "${default_resource_dir}" ]] && - JAVA_RESOURCE_DIRS+=( "${default_resource_dir}" ) - - if [[ "${module}" == junit-platform-console ]]; then - local JAVA_MAIN_CLASS="org.junit.platform.console.ConsoleLauncher" - local JAVA_LAUNCHER_FILENAME="${module}" - fi - - # Invoke the passed function - "${func[@]}" - local ret="${?}" - - popd > /dev/null || die "Failed to leave directory '${module}'" - return "${ret}" -} - -junit5_gen_cp() { - echo "$(java-pkg_getjars --build-only --with-dependencies \ - "${JAVA_GENTOO_CLASSPATH}"):${JAVA_GENTOO_CLASSPATH_EXTRA}" -} - -junit5_module_compile() { - if [[ "${module}" == junit-platform-console ]]; then - # Unlike other modules that have a src/main/java9 directory, for this - # module, the upstream puts the class files built from src/main/java9 - # in their JAR's top-level directory instead of META-INF/versions/9 - cp -rv src/main/java9/* src/main/java/ || - die "Failed to merge ${module}'s sources for Java 9+" - # Remove for the [[ -d src/main/java9 ]] test - # during versioned directory handling - rm -rv src/main/java9 || - die "Failed to remove ${module}'s Java 9+ source directory" - fi - - java-pkg-simple_src_compile - local sources="sources.lst" - local classes="target/classes" - - # Collect a list of all compiler input files for building Javadoc - local source - while read source; do - echo "${module}/${source}" >> "${all_sources}" - done < "${sources}" || - die "Failed to add ${module}'s sources to Javadoc input list" - - # Handle classes that will go into versioned directories. This will be - # no longer needed after https://bugs.gentoo.org/900433 is implemented. - local vm_ver - for vm_ver in 9 17; do - local versioned_src="src/main/java${vm_ver}" - if [[ -d "${versioned_src}" ]]; then - if ver_test "${JUNIT5_VM_VERSION}" -ge "${vm_ver}"; then - local versioned_classes="target/${vm_ver}/classes" - mkdir -p "${versioned_classes}" || - die "Failed to create directory for ${module}'s Java ${vm_ver}+ classes" - ejavac -d "${versioned_classes}" -encoding "${JAVA_ENCODING}" \ - -classpath "${classes}:$(junit5_gen_cp)" ${JAVAC_ARGS} \ - $(find "${versioned_src}" -type f -name '*.java') - "$(java-config --jar)" -uvf "${JAVA_JAR_FILENAME}" \ - --release "${vm_ver}" -C "${versioned_classes}" . || - die "Failed to add ${module}'s Java ${vm_ver}+ classes to JAR" - else - # Modules that may hit this branch as of 5.9.2: - # - junit-platform-console: - # src/main/java17/.../ConsoleUtils.java tries to use - # java.io.Console.charset() (available since Java 17) to get - # the default output charset. It is fine to not use this - # file, even if the built artifacts will be used on JRE 17+, - # as src/main/java/.../ConsoleUtils.java still gets the - # default from java.nio.charset.Charset.defaultCharset(). - elog "JDK ${JUNIT5_VM_VERSION} used; skipping Java ${vm_ver}-dependent parts in ${module}" - fi - fi - done - - # Add the current module's JAR to classpath - # for the module's reverse dependencies in this package - JAVA_GENTOO_CLASSPATH_EXTRA+=":${S}/${module}/${JAVA_JAR_FILENAME}" -} - -src_compile() { - local all_sources="${S}/all-sources.lst" - junit5_foreach_module junit5_module_compile - - if use doc; then - einfo "Generating Javadoc for all modules ..." - local apidoc="target/api" - mkdir -p "${apidoc}" || die "Failed to create Javadoc directory" - ejavadoc -d "${apidoc}" \ - -encoding "${JAVA_ENCODING}" -docencoding UTF-8 -charset UTF-8 \ - -classpath "$(junit5_gen_cp)" ${JAVADOC_ARGS:- -quiet} \ - -windowtitle "JUnit ${PV} API" \ - "@${all_sources}" - fi -} - -src_test() { - # Running the JUnit 5 modules' tests (located in each module's - # 'src/test/java') has a few obstacles: - # - Some test sources use text blocks -- a feature introduced in Java 15. - # A JDK at a lower version, e.g. 11, cannot compile them. - # - Some test classes depend on JUnit 5 modules that this ebuild does not - # include, like junit-platform-runner and junit-platform-testkit. - # - # Therefore, this ebuild uses a simpler approach to test the artifacts just - # built: it uses the artifacts to run tests in examples under the - # 'documentation/src' directory. The test coverage will not be impressive, - # but at least this approach verifies that the copy of JUnit 5 just built - # is capable of running some simple tests launched from CLI. - - local JUNIT5_TEST_SRC_DIR="documentation/src/test/java" - local JUNIT5_TEST_RESOURCE_DIR="documentation/src/test/resources" - local JUNIT5_TEST_RM=( - $(usev !migration-support example/IgnoredTestsDemo.java) - $(use !suite && echo \ - example/DocumentationTestSuite.java \ - example/SuiteDemo.java \ - ) - $(usev !vintage example/JUnit4Tests.java) - - # Need excluded module junit-platform-runner - example/JUnitPlatformClassDemo.java - example/JUnitPlatformSuiteDemo.java - - # Need excluded module junit-platform-testkit - example/testkit/ - - # Not necessary for the tests; some files even require extra dependency - org/junit/api/tools/ - - # Needs dev-java/hamcrest; no need to pull in extra dependency - # as the examples already provide ample tests to run - example/HamcrestAssertionsDemo.java - - # Makes an HTTP request and expects a certain response - example/session/HttpTests.java - ) - - pushd "${JUNIT5_TEST_SRC_DIR}" > /dev/null || - die "Failed to enter test source directory" - rm -rv "${JUNIT5_TEST_RM[@]}" || - die "Failed to remove unneeded test sources" - # Test sources expect the working directory to be 'documentation' - sed -i -e "s|src/test/resources|${JUNIT5_TEST_RESOURCE_DIR}|g" \ - example/ParameterizedTestDemo.java || - die "Failed to update file paths in test sources" - popd > /dev/null || die "Failed to leave test source directory" - - local test_dir="${T}/junit5_src_test" - local example_classes="${test_dir}/classes" - local test_classes="${test_dir}/test-classes" - mkdir -p "${example_classes}" "${test_classes}" || - die "Failed to create test directories" - - local example_sources="${test_dir}/sources.lst" - local test_sources="${test_dir}/test-sources.lst" - find documentation/src/main/java -type f -name '*.java' > "${example_sources}" || - die "Failed to get a list of example sources" - find documentation/src/test/java -type f -name '*.java' > "${test_sources}" || - die "Failed to get a list of test sources" - - ejavac -d "${example_classes}" -encoding "${JAVA_ENCODING}" \ - -classpath "$(junit5_gen_cp)" ${JAVAC_ARGS} \ - "@${example_sources}" - - local test_cp="${example_classes}:${JUNIT5_TEST_RESOURCE_DIR}:$(junit5_gen_cp)" - test_cp="${test_cp}:$(java-pkg_getjars --build-only --with-dependencies jimfs)" - ejavac -d "${test_classes}" -encoding "${JAVA_ENCODING}" \ - -classpath "${test_cp}" ${JAVAC_ARGS} \ - "@${test_sources}" - - set -- "$(java-config --java)" -classpath "${test_classes}:${test_cp}" \ - org.junit.platform.console.ConsoleLauncher \ - --disable-ansi-colors --fail-if-no-tests --scan-classpath \ - --include-classname='^(Test.*|.+[.$]Test.*|.*Tests?|.*Demo)$' \ - --exclude-tag="exclude" - echo "${@}" >&2 - "${@}" - local status="${?}" - [[ "${status}" -eq 2 ]] && die "JUnit did not discover any tests" - [[ "${status}" -eq 0 ]] || die "ConsoleLauncher failed" -} - -junit5_module_install() { - # It is OK to let java-pkg-simple_src_install call einstalldocs for - # each module as long as each documentation file being installed - # has a unique filename among _all_ modules; otherwise, some files - # would overwrite other ones. - if [[ -f README.md ]]; then - mv -v README.md "README-${module}.md" || - die "Failed to rename ${module}'s README.md" - fi - java-pkg-simple_src_install -} - -src_install() { - junit5_foreach_module junit5_module_install - einstalldocs # For project-global documentation - - if use doc; then - einfo "Installing Javadoc for all modules ..." - local apidoc="target/api" - java-pkg_dojavadoc "${apidoc}" - fi -} diff --git a/dev-java/junit/metadata.xml b/dev-java/junit/metadata.xml deleted file mode 100644 index 5ef6d97cfd14..000000000000 --- a/dev-java/junit/metadata.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> -<pkgmetadata> - <maintainer type="project"> - <email>java@gentoo.org</email> - <name>Java</name> - </maintainer> - <upstream> - <remote-id type="github">junit-team/junit-framework</remote-id> - <remote-id type="github">junit-team/junit4</remote-id> - <remote-id type="sourceforge">junit</remote-id> - </upstream> - <use> - <flag name="migration-support" restrict=">=dev-java/junit-5">Include the junit-jupiter-migrationsupport module, which helps with migration from JUnit 4 to JUnit Jupiter</flag> - <flag name="suite" restrict=">=dev-java/junit-5">Include the JUnit Platform Suite Engine, which adds test suite support</flag> - <flag name="vintage" restrict=">=dev-java/junit-5">Include JUnit Vintage, which allows JUnit 5 to run JUnit 3 and JUnit 4 tests</flag> - </use> -</pkgmetadata> |
