Bug 575146  - fix org.eclipse.ant.tests.core.tests in gerrit / IDE

- fixed JRE version in launch config
- fixed pom setup
- fixed classloading clash if loading classes from
org.eclipse.ant.tests.core.support package. The "support" classes must
be loaded by AntClassLoader, not by EquinoxClassLoader, otherwise they
have parent class loaded by Equinox that can't be casted to same class
loaded by Ant class loader.

Change-Id: Ifdd61241c0bce987598b476863593e459f52ed2c
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
Reviewed-on: https://git.eclipse.org/r/c/platform/eclipse.platform/+/183570
Tested-by: Platform Bot <platform-bot@eclipse.org>
diff --git a/ant/org.eclipse.ant.core/META-INF/MANIFEST.MF b/ant/org.eclipse.ant.core/META-INF/MANIFEST.MF
index 9fb544d..2485ba6 100644
--- a/ant/org.eclipse.ant.core/META-INF/MANIFEST.MF
+++ b/ant/org.eclipse.ant.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.ant.core; singleton:=true
-Bundle-Version: 3.6.0.qualifier
+Bundle-Version: 3.6.100.qualifier
 Bundle-Activator: org.eclipse.ant.core.AntCorePlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
diff --git a/ant/org.eclipse.ant.core/pom.xml b/ant/org.eclipse.ant.core/pom.xml
index 655f7c0..b7165da 100644
--- a/ant/org.eclipse.ant.core/pom.xml
+++ b/ant/org.eclipse.ant.core/pom.xml
@@ -19,7 +19,7 @@
   </parent>
   <groupId>org.eclipse.ant</groupId>
   <artifactId>org.eclipse.ant.core</artifactId>
-  <version>3.6.0-SNAPSHOT</version>
+  <version>3.6.100-SNAPSHOT</version>
   <packaging>eclipse-plugin</packaging>
   <properties>
     <defaultSigning-excludeInnerJars>true</defaultSigning-excludeInnerJars>
diff --git a/ant/org.eclipse.ant.core/src/org/eclipse/ant/internal/core/AntClassLoader.java b/ant/org.eclipse.ant.core/src/org/eclipse/ant/internal/core/AntClassLoader.java
index 0fc7849..f0fc4ee 100644
--- a/ant/org.eclipse.ant.core/src/org/eclipse/ant/internal/core/AntClassLoader.java
+++ b/ant/org.eclipse.ant.core/src/org/eclipse/ant/internal/core/AntClassLoader.java
@@ -23,6 +23,7 @@
 
 public class AntClassLoader extends URLClassLoader {
 
+	private static final String CORE_TESTS_SUPPORT_PREFIX = "org.eclipse.ant.tests.core.support"; //$NON-NLS-1$
 	private static final String ANT_PACKAGES_PREFIX = "org.apache.tools"; //$NON-NLS-1$
 	private static final String ANT_URL_PREFIX = "org/apache/tools"; //$NON-NLS-1$
 
@@ -42,7 +43,7 @@
 		Class<?> result = null;
 		// check whether to load the Apache Ant classes from the plug-in class loaders
 		// or to only load from the URLs specified from the Ant runtime classpath preferences setting
-		if (fAllowPluginLoading || !(name.startsWith(ANT_PACKAGES_PREFIX))) {
+		if (fAllowPluginLoading || !(name.startsWith(ANT_PACKAGES_PREFIX) || name.startsWith(CORE_TESTS_SUPPORT_PREFIX))) {
 			result = loadClassPlugins(name);
 		}
 
diff --git a/ant/org.eclipse.ant.tests.core/Ant Core Test Suite.launch b/ant/org.eclipse.ant.tests.core/Ant Core Test Suite.launch
index 8e06ceb..31fefb7 100644
--- a/ant/org.eclipse.ant.tests.core/Ant Core Test Suite.launch
+++ b/ant/org.eclipse.ant.tests.core/Ant Core Test Suite.launch
@@ -24,7 +24,7 @@
     <stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
     <stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
     <booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
-    <stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+    <stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
     <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.ant.tests.core.AutomatedSuite"/>
     <stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog -console"/>
     <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.ant.tests.core"/>
diff --git a/ant/org.eclipse.ant.tests.core/pom.xml b/ant/org.eclipse.ant.tests.core/pom.xml
index ab7502b..8a76cd5 100644
--- a/ant/org.eclipse.ant.tests.core/pom.xml
+++ b/ant/org.eclipse.ant.tests.core/pom.xml
@@ -20,8 +20,37 @@
   <groupId>org.eclipse.ant</groupId>
   <artifactId>org.eclipse.ant.tests.core</artifactId>
   <version>3.6.100-SNAPSHOT</version>
-  <packaging>eclipse-plugin</packaging>
+  <packaging>eclipse-test-plugin</packaging>
   <properties>
     <code.ignoredWarnings>${tests.ignoredWarnings}</code.ignoredWarnings>
   </properties>
+  <build>
+  	<plugins>
+  	    <plugin>
+			<groupId>org.eclipse.tycho</groupId>
+			<artifactId>target-platform-configuration</artifactId>
+			<configuration>
+				<dependency-resolution>
+					<extraRequirements>
+						<requirement>
+							<type>eclipse-plugin</type>
+							<id>org.eclipse.pde.core</id>
+							<versionRange>0.0.0</versionRange>
+						</requirement>
+					</extraRequirements>
+				</dependency-resolution>
+			</configuration>
+		</plugin>
+  		<plugin>
+  			<groupId>org.eclipse.tycho</groupId>
+  			<artifactId>tycho-surefire-plugin</artifactId>
+			<configuration>
+				<testClass>org.eclipse.ant.tests.core.AutomatedSuite</testClass>
+				<testClassesDirectory>target/anttestscore.jar-classes</testClassesDirectory>
+				<useUIHarness>true</useUIHarness>
+				<useUIThread>true</useUIThread>
+			</configuration>
+  		</plugin>
+  	</plugins>
+  </build>
 </project>
diff --git a/ant/org.eclipse.ant.tests.ui/Ant UI Test Suite.launch b/ant/org.eclipse.ant.tests.ui/Ant UI Test Suite.launch
index bbcae12..b91202c 100644
--- a/ant/org.eclipse.ant.tests.ui/Ant UI Test Suite.launch
+++ b/ant/org.eclipse.ant.tests.ui/Ant UI Test Suite.launch
@@ -23,8 +23,9 @@
     <booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
     <stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
     <stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
+    <booleanAttribute key="org.eclipse.jdt.launching.ATTR_ATTR_USE_ARGFILE" value="false"/>
     <booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
-    <stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+    <stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
     <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.ant.tests.ui.testplugin.AntUITests"/>
     <stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
     <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.ant.tests.ui"/>