Bug 563458 - Reduce tests from jdt.core.tests.compiler bundle

Configure tests to run based on JRE and corresponding compliances
supplied in test.xml

Change-Id: Iddd6b44c39ae2510756162f94d40f8b5f486784a
Signed-off-by: Jay Arthanareeswaran <jarthana@in.ibm.com>
Reviewed-on: https://git.eclipse.org/r/c/jdt/eclipse.jdt.core/+/184111
Tested-by: JDT Bot <jdt-bot@eclipse.org>
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/AbstractCompilerTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/AbstractCompilerTest.java
index a705a2b..35b6bba 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/AbstractCompilerTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/AbstractCompilerTest.java
@@ -321,7 +321,11 @@
 			isJRE10Plus = isJRE11Plus || CompilerOptions.VERSION_10.equals(specVersion);
 			isJRE9Plus = isJRE10Plus || CompilerOptions.VERSION_9.equals(specVersion);
 			initReflectionVersion();
-			String compliances = System.getProperty("compliance");
+			String key = "compliance.jre." + specVersion;
+			String compliances = System.getProperty(key);
+			if (compliances == null) {
+				compliances = System.getProperty("compliance");
+			}
 			if (compliances != null) {
 				possibleComplianceLevels = 0;
 				for (String compliance : compliances.split(",")) {
diff --git a/org.eclipse.jdt.core.tests.compiler/test.xml b/org.eclipse.jdt.core.tests.compiler/test.xml
index afe7e7c..53a3377 100644
--- a/org.eclipse.jdt.core.tests.compiler/test.xml
+++ b/org.eclipse.jdt.core.tests.compiler/test.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
 <!--
-    Copyright (c) 2002, 2014 IBM Corporation and others.
+    Copyright (c) 2002, 2021 IBM Corporation and others.
 
     This program and the accompanying materials
     are made available under the terms of the Eclipse Public License 2.0
@@ -56,6 +56,9 @@
       <property name="plugin-name" value="${plugin-name}"/>
       <property name="classname" 
                 value="org.eclipse.jdt.core.tests.compiler.regression.TestAll"/>
+      <property name="vmargs" 
+      	value="-Dcompliance.jre.11=1.8,9,10,11 -Dcompliance.jre.16=1.8,11,15,16 -Dcompliance.jre.17=1.8,11,16,17"
+      />
     </ant>
 
 	<antcall target="evaluation_tests"/>