diff options
author | Andy Clement <andrew.clement@gmail.com> | 2012-04-02 14:15:08 -0700 |
---|---|---|
committer | Andy Clement <andrew.clement@gmail.com> | 2012-04-02 14:15:08 -0700 |
commit | 096b004fda4d21cca0e1ee4c776e5824715d0ecd (patch) | |
tree | 1b56bf3e3ba31d909df8822f9ef7093166916c19 /tests/src/org | |
parent | f85631fd2fb2e0f3213abb9c5a7cd86eec2c9ab5 (diff) | |
download | aspectj-096b004fda4d21cca0e1ee4c776e5824715d0ecd.tar.gz aspectj-096b004fda4d21cca0e1ee4c776e5824715d0ecd.zip |
375881
Diffstat (limited to 'tests/src/org')
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc170/Ajc170Tests.java | 38 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc170/ajc170.xml | 100 |
2 files changed, 130 insertions, 8 deletions
diff --git a/tests/src/org/aspectj/systemtest/ajc170/Ajc170Tests.java b/tests/src/org/aspectj/systemtest/ajc170/Ajc170Tests.java index 9ce29a36f..907464990 100644 --- a/tests/src/org/aspectj/systemtest/ajc170/Ajc170Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc170/Ajc170Tests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008 Contributors + * Copyright (c) 2008-2012 Contributors * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -17,20 +17,13 @@ import junit.framework.Test; import org.aspectj.apache.bcel.classfile.Field; import org.aspectj.apache.bcel.classfile.JavaClass; import org.aspectj.testing.XMLBasedAjcTestCase; -import org.aspectj.weaver.ResolvedMember; -import org.aspectj.weaver.ResolvedType; import org.aspectj.weaver.TypeFactory; import org.aspectj.weaver.UnresolvedType; import org.aspectj.weaver.World; import org.aspectj.weaver.internal.tools.StandardPointcutExpressionImpl; -import org.aspectj.weaver.patterns.BasicTokenSource; -import org.aspectj.weaver.patterns.ITokenSource; -import org.aspectj.weaver.patterns.PatternParser; import org.aspectj.weaver.patterns.Pointcut; -import org.aspectj.weaver.patterns.PointcutEvaluationExpenseComparator; import org.aspectj.weaver.patterns.PointcutRewriter; import org.aspectj.weaver.reflect.ReflectionWorld; -import org.aspectj.weaver.tools.StandardPointcutExpression; import org.aspectj.weaver.tools.StandardPointcutParser; /** @@ -38,6 +31,35 @@ import org.aspectj.weaver.tools.StandardPointcutParser; */ public class Ajc170Tests extends org.aspectj.testing.XMLBasedAjcTestCase { + public void testXmlDefsDeclareAnnoMethod() { + runTest("xml defined dec at method"); + } + + // anno not runtime vis + public void testXmlDefsDeclareAnnoMethod2() { + runTest("xml defined dec at method 2"); + } + + public void testXmlDefsDeclareAnnoField() { + runTest("xml defined dec at field"); + } + + public void testXmlDefsDeclareAnnoFieldVariants1() { + runTest("xml defined dec anno - variants 1"); + } + + public void testXmlDefsDeclareAnnoFieldVariants2() { + runTest("xml defined dec anno - variants 2"); + } + + public void testXmlDefsDeclareAnnoFieldMultipleValues() { + runTest("xml defined dec anno - multiple values"); + } + + public void testXmlDefsDeclareAnnoFieldMultipleValuesAndSpaces() { + runTest("xml defined dec anno - multiple values and spaces"); + } + public void testPointcutExpense_374964() { // check a declaring type being specified causes the call() to be considered cheaper than this() diff --git a/tests/src/org/aspectj/systemtest/ajc170/ajc170.xml b/tests/src/org/aspectj/systemtest/ajc170/ajc170.xml index 58c936905..daed3a8e7 100644 --- a/tests/src/org/aspectj/systemtest/ajc170/ajc170.xml +++ b/tests/src/org/aspectj/systemtest/ajc170/ajc170.xml @@ -2,6 +2,106 @@ <suite> + + <ajc-test dir="bugs170/xmldefs" title="xml defined dec at method"> + <compile files="Hello.java Anno.java" options="-1.5"/> + <run class="Hello" ltw="aop.xml"> + <stdout> + <line text="Hello"/> + <line text="World"/> + <line text="Annotations on sayHello? true"/> + <line text="Annotation count is 1"/> + <line text="@Anno"/> + </stdout> + </run> + </ajc-test> + + <ajc-test dir="bugs170/xmldefs" title="xml defined dec at method 2"> + <compile files="Hello.java Anno2.java" options="-1.5"/> + <run class="Hello" ltw="aop2.xml"> + <stdout> + <line text="Hello"/> + <line text="World"/> + <line text="Annotations on sayHello? false"/> + </stdout> + <stderr> + <line text="info AspectJ Weaver"/> + <line text="info register"/> + <line text="info using configuration"/> + <line text="info define aspect ConjuredUp"/> + <line text="error declare is using an annotation type that does not have runtime retention: @Anno2"/> + <line text="info weaver"/> + </stderr> + </run> + </ajc-test> + + <ajc-test dir="bugs170/xmldefs" title="xml defined dec at field"> + <compile files="Hello2.java Anno.java" options="-1.5"/> + <run class="Hello2" ltw="aop3.xml"> + <stdout> + <line text="Annotations on i? true"/> + <line text="Annotation count is 1"/> + <line text="@Anno"/> + </stdout> + </run> + </ajc-test> + + <ajc-test dir="bugs170/xmldefs" title="xml defined dec anno - variants 1"> + <compile files="Hello4.java Anno4.java" options="-1.5"/> + <run class="Hello4" ltw="aop4.xml"> + <stdout> + <line text="Annotations on field1? true"/> + <line text="Annotation count is 4"/> + <line text="@AnnoBoolean(zzz=false, value=true)"/> + <line text="@AnnoClass(value=class java.lang.Integer, ccc=class java.lang.String)"/> + <line text="@AnnoLong(jjj=111, value=999)"/> + <line text="@AnnoString(sss=xyz, value=set from xml)"/> + <line text="Annotations on field2? true"/> + <line text="Annotation count is 1"/> + <line text="@AnnoClass(value=class java.lang.String, ccc=class java.lang.String)"/> + </stdout> + </run> + </ajc-test> + + <ajc-test dir="bugs170/xmldefs" title="xml defined dec anno - variants 2"> + <compile files="Hello5.java Anno5.java" options="-1.5"/> + <run class="Hello5" ltw="aop5.xml"> + <stdout> + <line text="Annotations on field1? true"/> + <line text="Annotation count is 4"/> + <line text="@AnnoChar(value=z, ccc=a)"/> + <line text="@AnnoDouble(ddd=3.0, value=99.0)"/> + <line text="@AnnoFloat(fff=4.0, value=6.0)"/> + <line text="@AnnoShort(sss=3, value=8)"/> + <line text="Annotations on field2? true"/> + <line text="Annotation count is 2"/> + <line text="@AnnoByte(value=88, bbb=66)"/> + <line text="@AnnoInt(value=99, iii=111)"/> + </stdout> + </run> + </ajc-test> + + <ajc-test dir="bugs170/xmldefs" title="xml defined dec anno - multiple values"> + <compile files="Hello6.java Anno6.java" options="-1.5"/> + <run class="Hello6" ltw="aop6.xml"> + <stdout> + <line text="Annotations on field1? true"/> + <line text="Annotation count is 1"/> + <line text="@Annot(a=a, fred=false, value=abc)"/> + </stdout> + </run> + </ajc-test> + + <ajc-test dir="bugs170/xmldefs" title="xml defined dec anno - multiple values and spaces"> + <compile files="Hello6.java Anno6.java" options="-1.5"/> + <run class="Hello6" ltw="aop6a.xml"> + <stdout> + <line text="Annotations on field1? true"/> + <line text="Annotation count is 1"/> + <line text="@Annot(a=a, fred=false, value=abc)"/> + </stdout> + </run> + </ajc-test> <ajc-test dir="bugs170/pr73507" title="public ITDfs - 1"> <compile files="Case1.java" options="-1.5"/> |