diff options
author | Stephan Herrmann | 2018-08-14 16:19:22 +0000 |
---|---|---|
committer | Stephan Herrmann | 2018-08-14 16:19:22 +0000 |
commit | 092e038e3ed378d80c1b5abeb77e16a533a9fa75 (patch) | |
tree | 4445f7c8f6c3ed106126d8344cd56a29d7a71514 | |
parent | 64a4230ba343028e55ac0adb1bdb5ba92cc9bb8a (diff) | |
download | eclipse.jdt.core-092e038e3ed378d80c1b5abeb77e16a533a9fa75.tar.gz eclipse.jdt.core-092e038e3ed378d80c1b5abeb77e16a533a9fa75.tar.xz eclipse.jdt.core-092e038e3ed378d80c1b5abeb77e16a533a9fa75.zip |
Bug 536706 - [tests] Failures in mac after moving to new test machineI20180815-1250I20180814-2000
- try another hook to be initialized from TestAll, too
Change-Id: I55980402298e7cf08457272728fa81e1bab3cc18
2 files changed, 22 insertions, 23 deletions
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java index d73df43e0a..db4ba3c422 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java @@ -38,23 +38,6 @@ import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; @SuppressWarnings({ "unchecked", "rawtypes" }) public class GenericTypeTest extends AbstractComparableTest { - static boolean NESTED_CLASS_USE_DOLLAR; - - static void init() { - if (isJRE9Plus) { - NESTED_CLASS_USE_DOLLAR = true; - } else { - String version = System.getProperty("java.version"); - if (version.startsWith("1.8.0_")) { - int build = Integer.parseInt(version.substring("1.8.0_".length())); - NESTED_CLASS_USE_DOLLAR = build >= 171; - } else { - throw new IllegalStateException("Unrecognized Java version: "+version); - } - System.out.println("NESTED_CLASS_USE_DOLLAR="+NESTED_CLASS_USE_DOLLAR+" based on version="+version); - } - } - public GenericTypeTest(String name) { super(name); } @@ -67,9 +50,7 @@ public class GenericTypeTest extends AbstractComparableTest { // TESTS_RANGE = new int[] { 1097, -1 }; } public static Test suite() { - Test suite = buildComparableTestSuite(testClass()); - init(); - return suite; + return buildComparableTestSuite(testClass()); } public static Class testClass() { @@ -40294,7 +40275,7 @@ public void test1151() throws Exception { "}\n" }, //"java.lang.ref.Reference<X<java.lang.String>.Other<java.lang.Thread>.Deeply>##java.lang.ref.Reference<X<java.lang.String>.Other<java.lang.Thread>.Deeply$Inside<java.lang.Number>>" - (NESTED_CLASS_USE_DOLLAR + (reflectNestedClassUseDollar ? "java.lang.ref.Reference<X<java.lang.String>$Other<java.lang.Thread>$Deeply>" : "java.lang.ref.Reference<X<java.lang.String>.Other<java.lang.Thread>.Deeply>") ); @@ -40410,7 +40391,7 @@ public void test1153() { "}\n" }, "java.lang.ref.Reference<p.X$Rather$Deeply>##java.lang.ref.Reference<p.X$Rather>##java.lang.ref.Reference<p.X$Rather$Deeply$Inside>##"+ - (NESTED_CLASS_USE_DOLLAR + (reflectNestedClassUseDollar ? "java.lang.ref.Reference<p.X<java.lang.String>$Other<java.lang.Thread>$Deeply>" : "java.lang.ref.Reference<p.X<java.lang.String>.Other<java.lang.Thread>.Deeply>"), null, @@ -40492,7 +40473,7 @@ public void test1155() throws Exception { " }\n" + "}\n" }, - (NESTED_CLASS_USE_DOLLAR + (reflectNestedClassUseDollar ? "java.lang.ref.Reference<X<java.lang.String>$Other<java.lang.Thread>$Deeply>" : "java.lang.ref.Reference<X<java.lang.String>.Other<java.lang.Thread>.Deeply>") ); 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 9b2ec42f50..fd6ba16390 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 @@ -48,6 +48,7 @@ public class AbstractCompilerTest extends TestCase { protected long complianceLevel; protected boolean enableAPT = false; protected static boolean isJRE9Plus = false; // Stop gap, so tests need not be run at 9, but some tests can be adjusted for JRE 9 + protected static boolean reflectNestedClassUseDollar; /** * Build a test suite made of test suites for all possible running VM compliances . @@ -342,6 +343,22 @@ public class AbstractCompilerTest extends TestCase { return ClassFileConstants.JDK1_3; } + static void initReflectionVersion() { + if (isJRE9Plus) { + reflectNestedClassUseDollar = true; + System.out.println("reflectNestedClassUseDollar="+reflectNestedClassUseDollar+" due to isJRE9Plus"); + } else { + String version = System.getProperty("java.version"); + if (version.startsWith("1.8.0_")) { + int build = Integer.parseInt(version.substring("1.8.0_".length())); + reflectNestedClassUseDollar = build >= 171; + } else { + throw new IllegalStateException("Unrecognized Java version: "+version); + } + System.out.println("reflectNestedClassUseDollar="+reflectNestedClassUseDollar+" based on version="+version); + } + } + /* * Returns the possible compliance levels this VM instance can run. */ @@ -349,6 +366,7 @@ public class AbstractCompilerTest extends TestCase { if (possibleComplianceLevels == UNINITIALIZED) { String specVersion = System.getProperty("java.specification.version"); isJRE9Plus = CompilerOptions.VERSION_9.equals(specVersion) || CompilerOptions.VERSION_10.equals(specVersion); + initReflectionVersion(); String compliances = System.getProperty("compliance"); if (compliances != null) { possibleComplianceLevels = 0; |