From: Andy Clement Date: Fri, 8 Aug 2014 15:34:32 +0000 (-0700) Subject: Tests more reliable on 1.7 and later X-Git-Tag: V1_8_2~11 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=44642d61cce6f3fee45699c821b8da38ddfed642;p=aspectj.git Tests more reliable on 1.7 and later --- diff --git a/testing/newsrc/org/aspectj/testing/AntSpec.java b/testing/newsrc/org/aspectj/testing/AntSpec.java index fe6a961b5..802783684 100644 --- a/testing/newsrc/org/aspectj/testing/AntSpec.java +++ b/testing/newsrc/org/aspectj/testing/AntSpec.java @@ -195,8 +195,9 @@ public class AntSpec implements ITestStep { } if (m_stdErrSpec != null) { String stderr2 = stderr.toString(); + // Working around this rediculous message that still comes out of Java7 builds: if (stderr2.indexOf("Class JavaLaunchHelper is implemented in both")!=-1 && stderr2.indexOf('\n')!=-1) { - stderr2 = stderr2.substring(stderr2.indexOf('\n')+1); + stderr2 = stderr2.replaceAll("objc\\[[0-9]*\\]: Class JavaLaunchHelper is implemented in both [^\n]*\n",""); } m_stdErrSpec.matchAgainst(stderr2); } diff --git a/tests/src/org/aspectj/systemtest/ajc11/Ajc11Tests.java b/tests/src/org/aspectj/systemtest/ajc11/Ajc11Tests.java index 01ea96560..ff19e7954 100644 --- a/tests/src/org/aspectj/systemtest/ajc11/Ajc11Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc11/Ajc11Tests.java @@ -14,6 +14,7 @@ import java.io.File; import junit.framework.Test; import org.aspectj.testing.XMLBasedAjcTestCase; +import org.aspectj.util.LangUtil; public class Ajc11Tests extends org.aspectj.testing.XMLBasedAjcTestCase { @@ -390,7 +391,11 @@ public class Ajc11Tests extends org.aspectj.testing.XMLBasedAjcTestCase { } public void test092() { - runTest("Compiler crash in ajc 1.1 - terrible error for inaccessible constructor"); + if (LangUtil.is17VMOrGreater()) { + runTest("Compiler crash in ajc 1.1 - terrible error for inaccessible constructor - 1.7"); + } else { + runTest("Compiler crash in ajc 1.1 - terrible error for inaccessible constructor"); + } } public void test093() { diff --git a/tests/src/org/aspectj/systemtest/ajc11/ajc11-tests.xml b/tests/src/org/aspectj/systemtest/ajc11/ajc11-tests.xml index 116accbb6..e16c31ab1 100644 --- a/tests/src/org/aspectj/systemtest/ajc11/ajc11-tests.xml +++ b/tests/src/org/aspectj/systemtest/ajc11/ajc11-tests.xml @@ -668,6 +668,19 @@ + + + + + + + + + + + + diff --git a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java index 0c21e3fcc..c9998d6c9 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java @@ -842,7 +842,11 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase { } public void testJava5SpecificFeaturesUsedAtJava14OrLower() { - runTest("java 5 pointcuts and declares at pre-java 5 compliance levels"); + if (LangUtil.is17VMOrGreater()) { + runTest("java 5 pointcuts and declares at pre-java 5 compliance levels - 1.7"); + } else { + runTest("java 5 pointcuts and declares at pre-java 5 compliance levels"); + } } public void testAnonymousTypes() { diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml index 1ee0ee752..c8a068c78 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml +++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml @@ -809,7 +809,7 @@ - + @@ -834,6 +834,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + +