]> source.dussan.org Git - aspectj.git/commitdiff
Making tests behave on 11
authorAndy Clement <aclement@pivotal.io>
Thu, 13 Aug 2020 23:06:08 +0000 (16:06 -0700)
committerAndy Clement <aclement@pivotal.io>
Thu, 13 Aug 2020 23:06:08 +0000 (16:06 -0700)
testing/src/test/java/org/aspectj/testing/OutputSpec.java
tests/src/test/java/org/aspectj/systemtest/ajc195/AllTestsAspectJ195.java
tests/src/test/java/org/aspectj/systemtest/ajc196/AllTestsAspectJ196.java
tests/src/test/resources/org/aspectj/systemtest/ajc170/ajc170.xml

index 62a22cb800e6a7a54f4ca9a0e45b2d1e0e5a3b12..ca7d0f23284d29c96450635c87f681f3d113d290 100644 (file)
@@ -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("+")) {
index f8a95a28ac1e6fa76f88544223793af8a7d158e3..81bba9000daf4c5b3ffcfb305851d22b1bd548e0 100644 (file)
@@ -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;
        }
 }
index 1c8e725f0714136fbb0238c58d7c29bddfdfd89b..0cdfe92904f4d580356b7202f34deca0489f7a21 100644 (file)
@@ -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;
        }
 }
index f372197c07f8d3908e2de73dc615e24bcdbbd48e..dcd08917f4dcadee26244a96548f8f2667ddf152 100644 (file)
            <line text="Annotation count is 4"/>
            <line text="@AnnoChar(value=z, ccc=a)" vm="1.2,1.3,1.4,1.5,1.6,1.7,1.8"/>
            <line text="@AnnoChar(value='z', ccc='a')" vm="9+"/>
-           <line text="@AnnoDouble(value=99.0, ddd=3.0)"/>
+           <line text="@AnnoDouble(ddd=3.0, value=99.0)" vm="1.2,1.3,1.4,1.5,1.6,1.7,1.8"/>
+           <line text="@AnnoDouble(value=99.0, ddd=3.0)" vm="11,12,13,14+"/>
            <line text="@AnnoFloat(value=6.0, fff=4.0)" vm="1.2,1.3,1.4,1.5,1.6,1.7,1.8"/>
            <line text="@AnnoFloat(value=6.0f, fff=4.0f)" vm="9+"/>
            <line text="@AnnoShort(value=8, sss=3)"/>