From: Andy Clement Date: Thu, 13 Aug 2020 23:06:08 +0000 (-0700) Subject: Making tests behave on 11 X-Git-Tag: V1_9_7M1~25 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7e8259b0d477e65e5f957dd1ee86eba270aca267;p=aspectj.git Making tests behave on 11 --- diff --git a/testing/src/test/java/org/aspectj/testing/OutputSpec.java b/testing/src/test/java/org/aspectj/testing/OutputSpec.java index 62a22cb80..ca7d0f232 100644 --- a/testing/src/test/java/org/aspectj/testing/OutputSpec.java +++ b/testing/src/test/java/org/aspectj/testing/OutputSpec.java @@ -36,7 +36,12 @@ public class OutputSpec { private boolean matchesThisVm(String vm) { // vm might be 1.2, 1.3, 1.4, 1.5 or 1.9 possibly with a '+' in there // For now assume + is attached to there only being one version, like "9+" - if (vm.contains(LangUtil.getVmVersionString())) { + // System.out.println("Checking "+vm+" for "+LangUtil.getVmVersionString()); + String v = LangUtil.getVmVersionString(); + if (v.endsWith(".0")) { + v = v.substring(0,v.length()-2); + } + if (vm.contains(v)) { return true; } if (vm.endsWith("+")) { diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc195/AllTestsAspectJ195.java b/tests/src/test/java/org/aspectj/systemtest/ajc195/AllTestsAspectJ195.java index f8a95a28a..81bba9000 100644 --- a/tests/src/test/java/org/aspectj/systemtest/ajc195/AllTestsAspectJ195.java +++ b/tests/src/test/java/org/aspectj/systemtest/ajc195/AllTestsAspectJ195.java @@ -10,6 +10,8 @@ *******************************************************************************/ package org.aspectj.systemtest.ajc195; +import org.aspectj.util.LangUtil; + import junit.framework.Test; import junit.framework.TestSuite; @@ -18,7 +20,9 @@ public class AllTestsAspectJ195 { public static Test suite() { TestSuite suite = new TestSuite("AspectJ 1.9.5 tests"); suite.addTest(Ajc195Tests.suite()); - suite.addTest(SanityTestsJava13.suite()); + if (LangUtil.is13VMOrGreater()) { + suite.addTest(SanityTestsJava13.suite()); + } return suite; } } diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc196/AllTestsAspectJ196.java b/tests/src/test/java/org/aspectj/systemtest/ajc196/AllTestsAspectJ196.java index 1c8e725f0..0cdfe9290 100644 --- a/tests/src/test/java/org/aspectj/systemtest/ajc196/AllTestsAspectJ196.java +++ b/tests/src/test/java/org/aspectj/systemtest/ajc196/AllTestsAspectJ196.java @@ -7,6 +7,8 @@ *******************************************************************************/ package org.aspectj.systemtest.ajc196; +import org.aspectj.util.LangUtil; + import junit.framework.Test; import junit.framework.TestSuite; @@ -17,8 +19,10 @@ public class AllTestsAspectJ196 { public static Test suite() { TestSuite suite = new TestSuite("AspectJ 1.9.6 tests"); - suite.addTest(Ajc196Tests.suite()); - suite.addTest(SanityTestsJava14.suite()); + if (LangUtil.is14VMOrGreater()) { + suite.addTest(Ajc196Tests.suite()); + suite.addTest(SanityTestsJava14.suite()); + } return suite; } } diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc170/ajc170.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc170/ajc170.xml index f372197c0..dcd08917f 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc170/ajc170.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc170/ajc170.xml @@ -204,7 +204,8 @@ - + +