diff --git a/src/etc/poms/ant-junit/pom.xml b/src/etc/poms/ant-junit/pom.xml
index 873339e19..e3efe3d1e 100644
--- a/src/etc/poms/ant-junit/pom.xml
+++ b/src/etc/poms/ant-junit/pom.xml
@@ -94,10 +94,6 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/ma
org/apache/tools/ant/taskdefs/optional/junit/*
-
- org/apache/tools/ant/taskdefs/optional/junit/JUnit4TestMethodAdapter*
- org/apache/tools/ant/taskdefs/optional/junit/CustomJUnit4TestAdapterCache*
-
org/apache/tools/ant/taskdefs/optional/junit/
org/example/junit/
@@ -110,6 +106,11 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/ma
org.apache.maven.plugins
maven-jar-plugin
+
+
+ org/apache/tools/ant/taskdefs/optional/junit/JUnit4TestMethodAdapter*
+ org/apache/tools/ant/taskdefs/optional/junit/CustomJUnit4TestAdapterCache*
+
true
@@ -154,6 +155,21 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/ma
+
+ ../../../../src/etc/testcases
+
+ taskdefs/optional/junit/**
+ taskdefs/optional/junit.xml
+ taskdefs/optional/junitreport.xml
+ buildfiletest-base.xml
+
+
+
+ ../../../../src
+
+ tests/junit/org/apache/tools/ant/taskdefs/optional/junit/*Test.java
+
+
../../../../src/tests/junit
diff --git a/src/etc/poms/ant-junitlauncher/pom.xml b/src/etc/poms/ant-junitlauncher/pom.xml
index 02d5a70aa..40282b7f6 100644
--- a/src/etc/poms/ant-junitlauncher/pom.xml
+++ b/src/etc/poms/ant-junitlauncher/pom.xml
@@ -122,6 +122,15 @@
+
+
+ ../../../../src/etc/testcases
+
+ taskdefs/optional/junitlauncher.xml
+ buildfiletest-base.xml
+
+
+
../../../../src/main
../../../../src/tests/junit
../../../../target/${project.artifactId}/classes
diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junitlauncher/JUnitLauncherTaskTest.java b/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junitlauncher/JUnitLauncherTaskTest.java
index 024a87bb5..6530836ca 100644
--- a/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junitlauncher/JUnitLauncherTaskTest.java
+++ b/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junitlauncher/JUnitLauncherTaskTest.java
@@ -272,12 +272,7 @@ public class JUnitLauncherTaskTest {
public void testAntRuntimeLibsCustomLocation() throws Exception {
final String targetName = "test-ant-runtime-lib-custom-location";
final Path trackerFile = setupTrackerProperty(targetName);
- // setup a property that points to the locations of Ant runtime classes.
- // this path will then be used in target to create a duplicate copied
- // classes and then will be used as a custom location for Ant runtime libraries
- final String projectResourceName = LoaderUtils.classNameToResource(Project.class.getName());
- final File antClassesPath = LoaderUtils.getResourceSource(Project.class.getClassLoader(), projectResourceName);
- buildRule.getProject().setProperty("ant.runtime.classes.original.path", antClassesPath.getAbsolutePath());
+ setupRuntimeClassesProperty();
// run the target
buildRule.executeTarget(targetName);
final String exclusionLogMsg = "Excluding Ant runtime libraries";
@@ -305,12 +300,7 @@ public class JUnitLauncherTaskTest {
public void testAntAndJUnitPlatformLibsCustomLocation() throws Exception {
final String targetName = "test-ant-and-junit-platform-lib-custom-location";
final Path trackerFile = setupTrackerProperty(targetName);
- // setup a property that points to the locations of Ant runtime classes.
- // this path will then be used in target to create a duplicate copied
- // classes and then will be used as a custom location for Ant runtime libraries
- final String projectResourceName = LoaderUtils.classNameToResource(Project.class.getName());
- final File antClassesPath = LoaderUtils.getResourceSource(Project.class.getClassLoader(), projectResourceName);
- buildRule.getProject().setProperty("ant.runtime.classes.original.path", antClassesPath.getAbsolutePath());
+ setupRuntimeClassesProperty();
// run the target
buildRule.executeTarget(targetName);
@@ -329,4 +319,13 @@ public class JUnitLauncherTaskTest {
final String outputDir = buildRule.getProject().getProperty("output.dir");
return Paths.get(outputDir, filename);
}
+
+ private void setupRuntimeClassesProperty() {
+ // setup a property that points to the locations of Ant runtime classes.
+ // this path will then be used in target to create a duplicate copied
+ // classes and then will be used as a custom location for Ant runtime libraries
+ final String projectResourceName = LoaderUtils.classNameToResource(Project.class.getName());
+ final File antClassesPath = LoaderUtils.getResourceSource(Project.class.getClassLoader(), projectResourceName);
+ buildRule.getProject().setProperty("ant.runtime.classes.original.path", antClassesPath.getAbsolutePath());
+ }
}