diff options
author | Andy Clement <aclement@gopivotal.com> | 2014-08-08 08:34:32 -0700 |
---|---|---|
committer | Andy Clement <aclement@gopivotal.com> | 2014-08-08 08:34:32 -0700 |
commit | 44642d61cce6f3fee45699c821b8da38ddfed642 (patch) | |
tree | b2505e3aae6d3c023fa014ff9a60532c15d1e631 | |
parent | 277634685030ee9d6bc12262da06144cf64a7c9a (diff) | |
download | aspectj-44642d61cce6f3fee45699c821b8da38ddfed642.tar.gz aspectj-44642d61cce6f3fee45699c821b8da38ddfed642.zip |
Tests more reliable on 1.7 and later
5 files changed, 52 insertions, 4 deletions
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 @@ </compile> </ajc-test> + <ajc-test dir="bugs" pr="39458" + title="Compiler crash in ajc 1.1 - terrible error for inaccessible constructor - 1.7"> + <compile files="NewVoid.java"> + <message kind="error" line="17"/> + <message kind="error" line="20"/> + <message kind="error" line="21"/> + + <message kind="error" line="28"/> + <message kind="warning" line="29"/> + <message kind="error" line="30"/> + </compile> + </ajc-test> + <ajc-test dir="bugs" pr="39460" title="Missing import crashes compiler"> <compile files="MissingImport.java"> 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 @@ </run> </ajc-test> - <ajc-test dir="java5/compliance" title="java 5 pointcuts and declares at pre-java 5 compliance levels"> + <ajc-test dir="java5/compliance" title="java 5 pointcuts and declares at pre-java 5 compliance levels"> <compile files="AJ5FeaturesAtJ14.aj" options="-1.4"> <message kind="error" line="3" text="the @annotation pointcut expression is only supported at Java 5 compliance level or above"/> <message kind="error" line="11" text="the @within pointcut expression is only supported at Java 5 compliance level or above"/> @@ -834,6 +834,31 @@ </compile> </ajc-test> + <ajc-test dir="java5/compliance" title="java 5 pointcuts and declares at pre-java 5 compliance levels - 1.7"> + <compile files="AJ5FeaturesAtJ14.aj" options="-1.4"> + <message kind="error" line="3" text="the @annotation pointcut expression is only supported at Java 5 compliance level or above"/> + <message kind="error" line="11" text="the @within pointcut expression is only supported at Java 5 compliance level or above"/> + <message kind="error" line="13" text="the @withincode pointcut expression is only supported at Java 5 compliance level or above"/> + <message kind="error" line="5" text="the @this pointcut expression is only supported at Java 5 compliance level or above"/> + <message kind="error" line="7" text="the @target pointcut expression is only supported at Java 5 compliance level or above"/> + <message kind="error" line="9" text="the @args pointcut expression is only supported at Java 5 compliance level or above"/> + <message kind="error" line="15" text="declare @type is only supported at Java 5 compliance level or above"/> + <message kind="error" line="15" text="annotations are only available if source level is 1.5 or greater"/> + <message kind="error" line="15" text="Foo is not an annotation type"/> + <message kind="error" line="17" text="declare @method is only supported at Java 5 compliance level or above"/> + <message kind="error" line="17" text="annotations are only available if source level is 1.5 or greater"/> + <message kind="error" line="17" text="Foo is not an annotation type"/> + <message kind="error" line="19" text="declare @field is only supported at Java 5 compliance level or above"/> + <message kind="error" line="19" text="annotations are only available if source level is 1.5 or greater"/> + <message kind="error" line="19" text="Foo is not an annotation type"/> + <message kind="error" line="21" text="declare @constructor is only supported at Java 5 compliance level or above"/> + <message kind="error" line="21" text="annotations are only available if source level is 1.5 or greater"/> + <message kind="error" line="21" text="Foo is not an annotation type"/> + <message kind="error" line="25" text="annotation type patterns are only supported at Java 5 compliance level or above"/> + <message kind="error" line="27" text="annotation type patterns are only supported at Java 5 compliance level or above"/> + </compile> + </ajc-test> + <ajc-test dir="bugs150" pr="91114" title="before and after are valid identifiers in classes, part 2"> <compile files="pr91114.aj"> |