diff options
author | acolyer <acolyer> | 2005-01-17 11:05:53 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2005-01-17 11:05:53 +0000 |
commit | 35cab775d1ac2fc45f614b4659047b2f291dcd96 (patch) | |
tree | d416d7bc3c066995ea8bcb704aedeb086cd40f1f /tests | |
parent | 767d730c50fd21915fed0dd64ad9f40500be0a6b (diff) | |
download | aspectj-35cab775d1ac2fc45f614b4659047b2f291dcd96.tar.gz aspectj-35cab775d1ac2fc45f614b4659047b2f291dcd96.zip |
java 5 support
Diffstat (limited to 'tests')
8 files changed, 34 insertions, 16 deletions
diff --git a/tests/java5/annotations/AnnotationAspect04.aj b/tests/java5/annotations/AnnotationAspect04.aj index 62466ae1c..7c1632f7b 100644 --- a/tests/java5/annotations/AnnotationAspect04.aj +++ b/tests/java5/annotations/AnnotationAspect04.aj @@ -3,9 +3,11 @@ import java.lang.annotation.Annotation; public aspect AnnotationAspect04 {
declare parents: SimpleAnnotation implements java.io.Serializable;
- class C extends Annotation { }
+ class C {}
declare parents: SimpleAnnotation extends C;
class D {}
declare parents: D extends Annotation;
}
+
+
diff --git a/tests/pureJava/KeywordAspect.java b/tests/pureJava/KeywordAspect.java index 9fcf0c446..b08fc41a3 100644 --- a/tests/pureJava/KeywordAspect.java +++ b/tests/pureJava/KeywordAspect.java @@ -8,7 +8,7 @@ public class KeywordAspect { public void realMain(String[] args) { int aspect = 0; - aspect += 10; + aspect += 10; Tester.checkEqual(aspect, 10); Tester.checkEqual(pointcut, "hi-bye"); diff --git a/tests/src/org/aspectj/systemtest/ajc11/ajc11-tests.xml b/tests/src/org/aspectj/systemtest/ajc11/ajc11-tests.xml index db8c780ac..d9849ceb3 100644 --- a/tests/src/org/aspectj/systemtest/ajc11/ajc11-tests.xml +++ b/tests/src/org/aspectj/systemtest/ajc11/ajc11-tests.xml @@ -671,7 +671,8 @@ <ajc-test dir="bugs" pr="39460" title="Missing import crashes compiler"> <compile files="MissingImport.java"> - <message kind="error" line="13"/> + <message kind="error" line="13"/> + <message kind="error" line="14"/> </compile> </ajc-test> diff --git a/tests/src/org/aspectj/systemtest/ajc121/ajc121-tests.xml b/tests/src/org/aspectj/systemtest/ajc121/ajc121-tests.xml index 9089289e9..64e966c94 100644 --- a/tests/src/org/aspectj/systemtest/ajc121/ajc121-tests.xml +++ b/tests/src/org/aspectj/systemtest/ajc121/ajc121-tests.xml @@ -347,7 +347,7 @@ <message kind="error" line="9" text="The method ancientI() from the type Foo is not visible"/> <message kind="error" line="10" text="The method ancientJ() from the type AncientFoo is not visible"/> <message kind="error" line="11" text="The method clone() from the type Object is not visible"/> - <message kind="error" line="12" text="The method clone() from the type Object is not static"/> + <message kind="error" line="12" text="Cannot make a static reference to the non-static method clone() from the type Object"/> </compile> </ajc-test> diff --git a/tests/src/org/aspectj/systemtest/ajc150/Annotations.java b/tests/src/org/aspectj/systemtest/ajc150/Annotations.java index 94760cc4f..1a8b83cc9 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/Annotations.java +++ b/tests/src/org/aspectj/systemtest/ajc150/Annotations.java @@ -54,7 +54,7 @@ public class Annotations extends TestUtils { // Deals with the cases where an explicit type is specified and it is an annotation type public void test002_decpOnAnnotationNotAllowed_errors() { - CompilationResult cR = binaryWeave("testcode.jar","AnnotationAspect04.aj",3,0,true); + CompilationResult cR = binaryWeave("testcode.jar","AnnotationAspect04.aj",3,0,true,new String[]{"-source","1.5"}); IMessage msg = (IMessage)cR.getErrorMessages().get(1); assertTrue("Expected a message about can't use decp to alter supertype of an annotation: "+msg, msg.toString().indexOf("to alter supertype of annotation type")!=-1); diff --git a/tests/src/org/aspectj/systemtest/ajc150/Enums.java b/tests/src/org/aspectj/systemtest/ajc150/Enums.java index ff0ba4167..20bd6ef77 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/Enums.java +++ b/tests/src/org/aspectj/systemtest/ajc150/Enums.java @@ -59,7 +59,7 @@ public class Enums extends TestUtils { // Deals with the cases where an explicit type is specified and it is an enum type public void test003_decpOnEnumNotAllowed_errors() { - CompilationResult cR = binaryWeave("testcode.jar","EnumAspect03.aj",3,0,true); + CompilationResult cR = binaryWeave("testcode.jar","EnumAspect03.aj",4,0,true); // THE ORDERING CAN BE SENSITIVE HERE... OUGHT TO FIX IT PROPERLY AND ALLOW FOR THEM // IN ANY POSITION IMessage msg = (IMessage)cR.getErrorMessages().get(1); @@ -71,6 +71,9 @@ public class Enums extends TestUtils { msg = (IMessage)cR.getErrorMessages().get(0); assertTrue("Expected a message about can't use decp to make Enum parent of another type: "+msg, msg.toString().indexOf("the parent of type")!=-1); + msg = (IMessage)cR.getErrorMessages().get(3); + assertTrue("Excpected message about not subclassing Enum: "+msg, + msg.toString().indexOf("The type C may not subclass Enum explicitly")!=-1); verifyWeavingMessagesOutput(cR,new String[]{}); } diff --git a/tests/src/org/aspectj/systemtest/ajc150/TestUtils.java b/tests/src/org/aspectj/systemtest/ajc150/TestUtils.java index dbaf6917d..180f9a7c7 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/TestUtils.java +++ b/tests/src/org/aspectj/systemtest/ajc150/TestUtils.java @@ -29,23 +29,35 @@ public abstract class TestUtils extends AjcTestCase { } protected CompilationResult binaryWeave(String inpath, String insource,int expErrors,int expWarnings,boolean xlinterror) { - return binaryWeave(inpath,insource,expErrors,expWarnings,xlinterror,""); + return binaryWeave(inpath,insource,expErrors,expWarnings,xlinterror,(String[])null); } protected CompilationResult binaryWeave(String inpath, String insource,int expErrors,int expWarnings,String extraOption) { return binaryWeave(inpath,insource,expErrors,expWarnings,false,extraOption); } - + protected CompilationResult binaryWeave(String inpath, String insource,int expErrors,int expWarnings,boolean xlinterror,String extraOption) { + return binaryWeave(inpath, insource, expErrors, expWarnings,xlinterror,new String[] {extraOption}); + } + + protected CompilationResult binaryWeave(String inpath, String insource,int expErrors,int expWarnings,boolean xlinterror,String[] extraOptions) { String[] args = null; if (xlinterror) { - if (extraOption!=null && extraOption.length()>0) - args = new String[] {"-inpath",inpath,insource,"-showWeaveInfo","-proceedOnError","-Xlint:warning",extraOption}; + if (extraOptions!=null && extraOptions.length > 0) { + String[] firstargs = new String[] {"-inpath",inpath,insource,"-showWeaveInfo","-proceedOnError","-Xlint:warning"}; + args = new String[firstargs.length + extraOptions.length]; + System.arraycopy(firstargs,0,args,0,firstargs.length); + System.arraycopy(extraOptions,0,args,firstargs.length,extraOptions.length); + } else args = new String[] {"-inpath",inpath,insource,"-showWeaveInfo","-proceedOnError","-Xlint:warning"}; } else { - if (extraOption!=null && extraOption.length()>0) - args = new String[] {"-inpath",inpath,insource,"-showWeaveInfo","-proceedOnError",extraOption}; + if (extraOptions!=null && extraOptions.length>0) { + String[] firstargs = new String[] {"-inpath",inpath,insource,"-showWeaveInfo","-proceedOnError"}; + args = new String[firstargs.length + extraOptions.length]; + System.arraycopy(firstargs,0,args,0,firstargs.length); + System.arraycopy(extraOptions,0,args,firstargs.length,extraOptions.length); + } else args = new String[] {"-inpath",inpath,insource,"-showWeaveInfo","-proceedOnError"}; } diff --git a/tests/src/org/aspectj/systemtest/pre10x/pre10x-tests.xml b/tests/src/org/aspectj/systemtest/pre10x/pre10x-tests.xml index d96bc3e4b..4d4cb999d 100644 --- a/tests/src/org/aspectj/systemtest/pre10x/pre10x-tests.xml +++ b/tests/src/org/aspectj/systemtest/pre10x/pre10x-tests.xml @@ -286,7 +286,7 @@ title="pre 0.7 introduction form outside aspect body causes an EmptyStackException" keywords="from-errors"> <compile files="BadIntroduction.java"> - <message kind="error" line="3"/> + <message kind="error" line="1" /> </compile> </ajc-test> @@ -301,7 +301,7 @@ title="a before() clause at the class-level causes an EmptyStackException" keywords="from-errors"> <compile files="TopLevelBefore.java"> - <message kind="error" line="3"/> + <message kind="error" line="1"/> </compile> </ajc-test> @@ -309,7 +309,7 @@ title="an after() clause at the class-level causes an EmptyStackException" keywords="from-errors"> <compile files="TopLevelAfter.java"> - <message kind="error" line="3"/> + <message kind="error" line="1"/> </compile> </ajc-test> @@ -317,7 +317,7 @@ title="an around() clause at the class-level causes an EmptyStackException" keywords="from-errors"> <compile files="TopLevelAround.java"> - <message kind="error" line="3"/> + <message kind="error" line="1"/> </compile> </ajc-test> |