diff options
author | Andy Clement <aclement@pivotal.io> | 2019-01-30 16:55:38 -0800 |
---|---|---|
committer | Andy Clement <aclement@pivotal.io> | 2019-01-30 16:55:38 -0800 |
commit | 2b24e7377da7c849fe7f9f4fa06a701664f9d27d (patch) | |
tree | 64c36c8fcf29633af7a5e2f7405b94cbec629ca8 /tests/src/test/java/org/aspectj/systemtest/ajc1612 | |
parent | d60de8d0b3e62eb36b612a824bb9345d865c0155 (diff) | |
download | aspectj-2b24e7377da7c849fe7f9f4fa06a701664f9d27d.tar.gz aspectj-2b24e7377da7c849fe7f9f4fa06a701664f9d27d.zip |
mavenizing tests - wip
Diffstat (limited to 'tests/src/test/java/org/aspectj/systemtest/ajc1612')
3 files changed, 1200 insertions, 0 deletions
diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc1612/Ajc1612Tests.java b/tests/src/test/java/org/aspectj/systemtest/ajc1612/Ajc1612Tests.java new file mode 100644 index 000000000..347b63e17 --- /dev/null +++ b/tests/src/test/java/org/aspectj/systemtest/ajc1612/Ajc1612Tests.java @@ -0,0 +1,420 @@ +/******************************************************************************* + * Copyright (c) 2008 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 + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Andy Clement - initial API and implementation + *******************************************************************************/ +package org.aspectj.systemtest.ajc1612; + +import java.io.File; + +import junit.framework.Test; + +import org.aspectj.apache.bcel.classfile.JavaClass; +import org.aspectj.apache.bcel.classfile.Method; +import org.aspectj.asm.internal.ProgramElement; +import org.aspectj.testing.XMLBasedAjcTestCase; + +/** + * @author Andy Clement + */ +public class Ajc1612Tests extends org.aspectj.testing.XMLBasedAjcTestCase { + + // public void testAnnoCopying_345515() { + // runTest("anno copying"); + // } + + // public void testDoubleITDF() throws Exception { + // runTest("double itdf"); + // } + + // public void testItdSplitCompilation_354683() throws Exception { + // runTest("itd split compilation"); + // } + + public void testClassCast_327141() { + runTest("classcast"); + } + + public void testXmlDefs() { + runTest("xml defined advice"); + } + + public void testXmlDefs2() { + runTest("xml defined advice 2"); + } + + // using a parameter + public void testXmlDefs3() { + runTest("xml defined advice 3"); + } + + // using bad parameters + public void testXmlDefs4() { + runTest("xml defined advice 4"); + } + + // binding + public void testXmlDefs5() { + runTest("xml defined advice 5"); + } + + // before and after advice + public void testXmlDefs6() { + runTest("xml defined advice 6"); + } + + // thisJoinPoint + public void testXmlDefs7() { + runTest("xml defined advice 7"); + } + + // thisJoinPointStaticPart + public void testXmlDefs8() { + runTest("xml defined advice 8"); + } + + // void around advice + public void testXmlDefs9() { + runTest("xml defined advice 9"); + } + + // non-void around advice + public void testXmlDefs10() { + runTest("xml defined advice 10"); + } + + // non-void around advice with proceed + public void testXmlDefs11() { + runTest("xml defined advice 11"); + } + + // non primitive return (that is actually used) and proceed + public void testXmlDefs12() { + runTest("xml defined advice 12"); + } + + // delegate type in package + public void testXmlDefs13() { + runTest("xml defined advice 13"); + } + + public void testCorrespondingType_357582() { + for (int i = 0; i < 100000; i++) { + assertEquals("AAA", convert("AAA")); + assertEquals("AAA", convert("a.b.c.AAA")); + assertEquals("A", convert("aa.ba.ca.A")); + assertEquals("AAA<>", convert("a.b.c.AAA<>")); + assertEquals("AAA<A>", convert("a.b.c.AAA<A>")); + assertEquals("AAA<A>", convert("a.b.c.AAA<aa.A>")); + assertEquals("AAA<A,B>", convert("a.b.c.AAA<aa.A,bb.B>")); + assertEquals("AAA<A<B>>", convert("a.b.c.AAA<aa.A<bb.B>>")); + assertEquals("AAA<A<B>,AA<GG<KK>>>", convert("a.b.c.AAA<aa.A<bb.B>,a.b.c.AA<GG<KK>>>")); + } + long time = System.currentTimeMillis(); + for (int i = 0; i < 1000000; i++) { + assertEquals("AAA", convert("AAA")); + assertEquals("AAA", convert("a.b.c.AAA")); + assertEquals("A", convert("aa.ba.ca.A")); + assertEquals("AAA<>", convert("a.b.c.AAA<>")); + assertEquals("AAA<A>", convert("a.b.c.AAA<A>")); + assertEquals("AAA<A>", convert("a.b.c.AAA<aa.A>")); + assertEquals("AAA<A,B>", convert("a.b.c.AAA<aa.A,bb.B>")); + assertEquals("AAA<A<B>>", convert("a.b.c.AAA<aa.A<bb.B>>")); + assertEquals("AAA<A<B>,AA<GG<KK>>>", convert("a.b.c.AAA<aa.A<bb.B>,a.b.c.AA<GG<KK>>>")); + } + System.out.println(System.currentTimeMillis() - time); + } + + private String convert(String totrim) { + return ProgramElement.trim(totrim); + } + + public void testPervasivePerthis_354470() throws Exception { + runTest("perthis too pervasive"); + } + + public void testPervasivePerthis_354470_2() throws Exception { + runTest("perthis too pervasive 2"); + } + + public void testPervasivePerthis_354470_3() throws Exception { + runTest("perthis too pervasive 3"); + } + + public void testNotEqualWithAnnotationValues_357013() throws Exception { + runTest("annotation values not equal"); + } + + public void testNotEqualWithAnnotationValues_357013_2() throws Exception { + runTest("annotation values not equal 2"); + } + + public void testClassRef_357012() throws Exception { + runTest("class reference in annotation value"); + } + + public void testClassRefInvalidName_357012_2() throws Exception { + runTest("class reference in annotation value - invalid typename"); + } + + public void testClassRef_357012_3() throws Exception { + runTest("class reference in annotation value 3"); + } + + public void testAnnotationFieldBindingOptimization_356612() throws Exception { + runTest("annotation field binding optimization"); + } + + public void testAnnotationFieldBindingOptimization_356612_2() throws Exception { + runTest("annotation field binding optimization - 2"); + } + + public void testThisAspectInstance_239649_1() throws Exception { + // simple case + runTest("thisAspectInstance - 1"); + } + + public void testThisAspectInstance_239649_2() throws Exception { + // before advice toggling on/off through if called method + runTest("thisAspectInstance - 2"); + } + + public void testThisAspectInstance_239649_3() throws Exception { + // after advice toggling on/off through if called method + runTest("thisAspectInstance - 3"); + } + + public void testThisAspectInstance_239649_4() throws Exception { + // before advice, also using thisJoinPointStaticPart + runTest("thisAspectInstance - 4"); + } + + public void testThisAspectInstance_239649_5() throws Exception { + // before advice, also using thisJoinPoint + runTest("thisAspectInstance - 5"); + } + + public void testThisAspectInstance_239649_6() throws Exception { + // before advice, also using thisEnclosingJoinPointStaticPart + runTest("thisAspectInstance - 6"); + } + + public void testThisAspectInstance_239649_7() throws Exception { + // before advice, also using thisJoinPoint and thisJoinPointStaticPart + runTest("thisAspectInstance - 7"); + } + + public void testThisAspectInstance_239649_8() throws Exception { + // before advice, also using abstract aspects + runTest("thisAspectInstance - 8"); + } + + public void testThisAspectInstance_239649_9() throws Exception { + // before advice, also using abstract aspects 2 + runTest("thisAspectInstance - 9"); + } + + public void testThisAspectInstance_239649_10() throws Exception { + // aspects in a package + runTest("thisAspectInstance - 10"); + } + + public void testThisAspectInstance_239649_11() throws Exception { + // non-singleton aspect - should be an error for now + runTest("thisAspectInstance - 11"); + } + + public void testThisAspectInstance_239649_12() throws Exception { + // arg binding and tjpsp + runTest("thisAspectInstance - 12"); + } + + public void testThisAspectInstance_239649_13() throws Exception { + // pass instance + runTest("thisAspectInstance - 13"); + } + + public void testThisAspectInstance_239649_14() throws Exception { + // multiple ifs + runTest("thisAspectInstance - 14"); + } + + public void testThisAspectInstance_239649_15() throws Exception { + // abstract aspects + runTest("thisAspectInstance - 15"); + } + + // public void testVerifyPerthis() throws Exception { + // runTest("verify perthis"); + // } + + public void testRangeForLocalVariables_353936() throws ClassNotFoundException { + runTest("local variable tables"); + JavaClass jc = getClassFrom(ajc.getSandboxDirectory(), "X"); + Method[] meths = jc.getMethods(); + boolean checked = false; + for (int i = 0; i < meths.length; i++) { + Method method = meths[i]; + if (method.getName().equals("ajc$before$X$2$3444dde4")) { + System.out.println(method.getName()); + System.out.println(stringify(method.getLocalVariableTable())); + System.out.println(method.getCode().getLength()); + checked = true; + assertEquals("LX; this(0) start=0 len=48", stringify(method.getLocalVariableTable(), 0)); + assertEquals("Lorg/aspectj/lang/JoinPoint; thisJoinPoint(1) start=0 len=48", + stringify(method.getLocalVariableTable(), 1)); + assertEquals("I i(2) start=8 len=22", stringify(method.getLocalVariableTable(), 2)); + } + } + assertTrue(checked); + } + + public void testEmptyPattern_pr352363() { + runTest("empty pattern"); + } + + public void testGenericsIssue_pr351592() { + runTest("generics issue"); + } + + public void testGenericsIssue_pr351592_2() { + runTest("generics issue - 2"); + } + + public void testGenericsNpe_pr350800() { + runTest("generics npe"); + } + + public void testGenericsNpe_pr350800_code() { + runTest("generics npe - code"); + } + + public void testGenericsNpe_pr350800_3() { + runTest("generics npe - 3"); + } + + public void testOrdering_pr349961() { + runTest("ordering"); + } + + public void testOrdering_pr349961_2() { + runTest("ordering - 2"); + } + + /* + * public void testVerifyError_pr347395() { runTest("verifyerror - inline"); } + */ + + public void testDuplicateMethods_349398() { + runTest("duplicate methods"); + } + + public void testBindingInts_347684() { + runTest("binding ints"); + } + + public void testBindingInts_347684_2() { + runTest("binding ints - 2"); + } + + public void testBindingInts_347684_3() { + runTest("binding ints - 3"); + } + + public void testBindingInts_347684_4() { + runTest("binding ints - 4"); + } + + public void testBindingInts_347684_5() { + runTest("binding ints - 5"); + } + + public void testBindingInts_347684_6() { + runTest("binding ints - 6"); + } + + public void testIncorrectAnnos_345172() { + runTest("incorrect annos"); + } + + public void testIncorrectAnnos_345172_2() { + runTest("incorrect annos 2"); + } + + public void testIncorrectAnnos_345172_3() { + runTest("incorrect annos 3"); + } + + public void testSyntheticMethods_327867() { + runTest("synthetic methods"); + } + + // public void testSignedJarLtw_328099() { + // runTest("signed jar ltw"); + // } + + public void testVerifyError_315398() { + runTest("verifyerror"); + } + + public void testVerifyError_315398_2() { + runTest("verifyerror - 2"); + } + + public void testRawTypePointcut_327134() { + runTest("rawtype pointcut"); + } + + public void testRawTypeWarning_335810() { + runTest("rawtype warning"); + } + + // public void testDecpGenerics_344005() { + // runTest("decp generics"); + // } + + public void testIllegalAccessError_343051() { + runTest("illegalaccesserror"); + } + + public void testItitNpe_339974() { + runTest("itit npe"); + } + + // public void testNoImportError_342605() { + // runTest("noimporterror"); + // } + + public void testClashingLocalTypes_342323() { + runTest("clashing local types"); + } + + public void testITIT_338175() { + runTest("itit"); + } + + public void testThrowsClause_292239() { + runTest("throws clause"); + } + + public void testThrowsClause_292239_2() { + runTest("throws clause - 2"); + } + + // --- + + public static Test suite() { + return XMLBasedAjcTestCase.loadSuite(Ajc1612Tests.class); + } + + @Override + protected File getSpecFile() { + return getClassResource("ajc1612.xml"); + } + +}
\ No newline at end of file diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc1612/AllTestsAspectJ1612.java b/tests/src/test/java/org/aspectj/systemtest/ajc1612/AllTestsAspectJ1612.java new file mode 100644 index 000000000..702cfdc39 --- /dev/null +++ b/tests/src/test/java/org/aspectj/systemtest/ajc1612/AllTestsAspectJ1612.java @@ -0,0 +1,25 @@ +/******************************************************************************* + * Copyright (c) 2008 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 + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Andy Clement - initial API and implementation + *******************************************************************************/ +package org.aspectj.systemtest.ajc1612; + +import junit.framework.Test; +import junit.framework.TestSuite; + +public class AllTestsAspectJ1612 { + + public static Test suite() { + TestSuite suite = new TestSuite("AspectJ 1.6.12 tests"); + // $JUnit-BEGIN$ + suite.addTest(Ajc1612Tests.suite()); + // $JUnit-END$ + return suite; + } +} diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc1612/ajc1612.xml b/tests/src/test/java/org/aspectj/systemtest/ajc1612/ajc1612.xml new file mode 100644 index 000000000..38f46c7d6 --- /dev/null +++ b/tests/src/test/java/org/aspectj/systemtest/ajc1612/ajc1612.xml @@ -0,0 +1,755 @@ +<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]> + +<suite> + + <ajc-test dir="bugs1612/pr327141" title="classcast"> + <compile files="AspectWithConstant.aj" options="-1.5"/> + <run class="AspectWithConstant"> + <stdout> + <line text="MAX=9"/> + <line text="@AspectWithConstant$Loggable()"/> + </stdout></run> + </ajc-test> + + <ajc-test dir="bugs1612/xmldefs" title="xml defined advice"> + <compile files="Hello.java JavaHelper.java"/> + <run class="Hello" ltw="aop.xml"> + <stdout> + <line text="Hello"/> + <line text="in advice"/> + <line text="World"/> + </stdout> + </run> + </ajc-test> + + <ajc-test dir="bugs1612/xmldefs" title="xml defined advice 2"> + <compile files="Hello.java JavaHelper.java"/> + <run class="Hello" ltw="aop2.xml"> + <stdout> + <line text="Hello"/> + <line text="World"/> + </stdout> + <stderr> + <line text="info AspectJ Weaver"/> + <line text="info register classloader"/> + <line text="info using config"/> + <line text="info define aspect"/> + <line text="error Class to invoke cannot be found: 'com.DoesNotExist'"/> + <line text="info weaver operating"/> + </stderr> + </run> + </ajc-test> + + <ajc-test dir="bugs1612/xmldefs" title="xml defined advice 3"> + <compile files="Hello.java JavaHelper.java"/> + <run class="Hello" ltw="aop3.xml"> + <stdout> + <line text="Hello"/> + <line text="World"/> + </stdout> + <stderr> + <line text="info AspectJ Weaver"/> + <line text="info register classloader"/> + <line text="info using config"/> + <line text="info define aspect"/> + <line text="error Cannot find type specified as parameter: 'String' from signature '(String)'"/> + <line text="info weaver operating"/> + </stderr> + </run> + </ajc-test> + + <ajc-test dir="bugs1612/xmldefs" title="xml defined advice 4"> + <compile files="Hello.java JavaHelper.java"/> + <run class="Hello" ltw="aop4.xml"> + <stdout> + <line text="Hello"/> + <line text="World"/> + </stdout> + <stderr> + <line text="info AspectJ Weaver"/> + <line text="info register classloader"/> + <line text="info using config"/> + <line text="info define aspect"/> + <line text="error Cannot find type specified as parameter: 'java.lang.String:List' from signature '(java.lang.String:List)'"/> + <line text="info weaver operating"/> + </stderr> + </run> + </ajc-test> + + + <ajc-test dir="bugs1612/xmldefs" title="xml defined advice 5"> + <compile files="Hello2.java JavaHelper.java"/> + <run class="Hello2" ltw="aop5.xml"> + <stdout> + <line text="hello"/> + <line text="in advice: s=world"/> + <line text="world"/> + </stdout> + </run> + </ajc-test> + + + <ajc-test dir="bugs1612/xmldefs" title="xml defined advice 6"> + <compile files="Hello2.java JavaHelper.java"/> + <run class="Hello2" ltw="aop6.xml"> + <stdout> + <line text="hello"/> + <line text="in advice: s=world"/> + <line text="world"/> + <line text="in advice3: s=world"/> + </stdout> + </run> + </ajc-test> + + <ajc-test dir="bugs1612/xmldefs" title="xml defined advice 7"> + <compile files="Hello2.java JavaHelper.java"/> + <run class="Hello2" ltw="aop7.xml"> + <stdout> + <line text="hello"/> + <line text="in advice4: s=world at execution(int Hello2.say2(String))"/> + <line text="world"/> + <line text="in advice5: s=world at execution(int Hello2.say2(String))"/> + </stdout> + </run> + </ajc-test> + + <ajc-test dir="bugs1612/xmldefs" title="xml defined advice 8"> + <compile files="Hello2.java JavaHelper.java"/> + <run class="Hello2" ltw="aop8.xml"> + <stdout> + <line text="hello"/> + <line text="in advice6: s=world at execution(int Hello2.say2(String))"/> + <line text="world"/> + <line text="in advice7: s=world at execution(int Hello2.say2(String))"/> + </stdout> + </run> + </ajc-test> + + <ajc-test dir="bugs1612/xmldefs" title="xml defined advice 9"> + <compile files="Hello2.java JavaHelper.java"/> + <run class="Hello2" ltw="aop9.xml"> + <stdout> + <line text="in around advice: s=hello at execution(void Hello2.say1(String))"/> + </stdout> + </run> + </ajc-test> + + <ajc-test dir="bugs1612/xmldefs" title="xml defined advice 10"> + <compile files="Hello2.java JavaHelper.java"/> + <run class="Hello2" ltw="aop10.xml"> + <stdout> + <line text="hello"/> + <line text="in around2 advice: s=world at execution(int Hello2.say2(String))"/> + </stdout> + </run> + </ajc-test> + + <ajc-test dir="bugs1612/xmldefs" title="xml defined advice 11"> + <compile files="Hello2.java JavaHelper.java"/> + <run class="Hello2" ltw="aop11.xml"> + <stdout> + <line text="hello"/> + <line text="abcde"/> + </stdout> + </run> + </ajc-test> + + <ajc-test dir="bugs1612/xmldefs" title="xml defined advice 12"> + <compile files="Hello3.java JavaHelper.java"/> + <run class="Hello3" ltw="aop12.xml"> + <stdout> + <line text="hello"/> + <line text="around4 running"/> + <line text="abcde"/> + <line text="from say2=xyz"/> + </stdout> + </run> + </ajc-test> + + <ajc-test dir="bugs1612/xmldefs" title="xml defined advice 13"> + <compile files="Hello2.java JavaHelper2.java"/> + <run class="Hello2" ltw="aop13.xml"> + <stdout> + <line text="in advice"/> + <line text="hello"/> + <line text="in advice"/> + <line text="world"/> + </stdout> + </run> + </ajc-test> + +<ajc-test dir="bugs1612/pr354470" title="perthis too pervasive"> +<compile files="Code.java" options="-1.5"/> +<run class="Code"> +<stdout> + <line text="AAA"/> + <line text="BBB"/> + <line text="CCC"/> + <line text="interface Code$ajcMightHaveAspect"/> + <line text="private transient Code CCC.ajc$Code$perObjectField"/> +</stdout></run> +</ajc-test> + +<ajc-test dir="bugs1612/pr354470" title="perthis too pervasive 2"> +<compile files="Code2.java" options="-1.5"/> +<run class="Code2"> +<stdout> + <line text="execution(void CCC.m())"/> +</stdout></run> +</ajc-test> + +<ajc-test dir="bugs1612/pr354470" title="perthis too pervasive 3"> +<compile files="Code3.java" options="-1.5"/> +<run class="Code3"> +<stdout> + <line text="execution(void CCC.m())"/> +</stdout></run> +</ajc-test> + +<ajc-test dir="bugs1612/prx" title="class reference in annotation value"> +<compile files="C.java" options="-1.5 -showWeaveInfo"> +<message kind="weave" text="Join point 'field-get(int C.i)' in Type 'C' (C.java:17) advised by before advice from 'X' (C.java:22)"/> +</compile> +<run class="C"> +</run> +</ajc-test> + +<ajc-test dir="bugs1612/prx" title="annotation values not equal"> +<compile files="D.java" options="-1.5 -showWeaveInfo"> +<message kind="weave" text="Join point 'field-get(int D.i)' in Type 'D' (D.java:20) advised by before advice from 'X' (D.java:26)"/> +<message kind="weave" text="Join point 'field-get(int D.j)' in Type 'D' (D.java:21) advised by before advice from 'X' (D.java:26)"/> +</compile> +<run class="D"> +</run> +</ajc-test> + +<ajc-test dir="bugs1612/prx" title="class reference in annotation value 3"> +<compile files="E.java" options="-1.5 -showWeaveInfo"> +<message kind="weave" text="Join point 'field-get(int E.i)' in Type 'E' (E.java:17) advised by before advice from 'X' (E.java:22)"/> +</compile> +<run class="E"> +</run> +</ajc-test> + +<ajc-test dir="bugs1612/prx" title="annotation values not equal 2"> +<compile files="F.java" options="-1.5 -showWeaveInfo"> +<message kind="weave" text="Join point 'field-get(int F.i)' in Type 'F' (F.java:20) advised by before advice from 'X' (F.java:26)"/> +<message kind="weave" text="Join point 'field-get(int F.j)' in Type 'F' (F.java:21) advised by before advice from 'X' (F.java:26)"/> +</compile> +<run class="F"> +</run> +</ajc-test> + + +<ajc-test dir="bugs1612/prx" title="class reference in annotation value - invalid typename"> +<compile files="G.java" options="-1.5"> +<message kind="error" text="Unable to resolve type 'Foo.class' specified for value 'value'"/> +</compile> +</ajc-test> + +<ajc-test dir="bugs1612/pr356612" title="annotation field binding optimization"> +<compile files="AnnoBinding.java" options="-1.5"/> +<run class="AnnoBinding"> +</run> +</ajc-test> + +<ajc-test dir="bugs1612/pr356612" title="annotation field binding optimization - 2"> +<compile files="AnnoBinding2.java" options="-1.5"/> +<run class="AnnoBinding2"> +<stdout> +<line text="get(int AnnoBinding2.field1) @Marker(message=foo)" vm="1.2,1.3,1.4,1.5,1.6,1.7,1.8"/> +<line text="get(int AnnoBinding2.field1) @Marker(message="foo")" vm="9+"/> +<line text="get(int AnnoBinding2.field2) @Marker(message=bar)" vm="1.2,1.3,1.4,1.5,1.6,1.7,1.8"/> +<line text="get(int AnnoBinding2.field2) @Marker(message="bar")" vm="9+"/> +<line text="2 ajc$anno$NNN fields"/> +</stdout> +</run> +</ajc-test> + +<ajc-test dir="bugs1612/pr354683" title="itd split compilation"> +<compile files="util/CommonData.java util/CommonDataImpl.java util/CommonDataImplementation.aj util/DerivedCommonDataInterface.java util/DerivedCommonDataInterfaceImpl.java util/DerivedCommonDataInterfaceImplementation.aj" options="-1.5" outjar="code.jar"/> +<compile files="main/AbstractBaseClass.java main/DerivedClass.java main/Whatever.java " options="-1.5" aspectpath="code.jar"/> +</ajc-test> + +<ajc-test dir="bugs1612/pr239649" title="thisAspectInstance - 1"> +<compile files="One.java" options="-1.5"/> +<run class="One"> + <stdout> + <line text="In instance check method doit()"/> + <line text="In advice()"/> + <line text="Method m() running"/> + </stdout> +</run> +</ajc-test> + +<ajc-test dir="bugs1612/pr239649" title="thisAspectInstance - 2"> +<compile files="Two.java" options="-1.5"/> +<run class="Two"> + <stdout> + <line text="In instance check method, count=1 so doit returns false"/> + <line text="Method m() running"/> + <line text="In instance check method, count=2 so doit returns true"/> + <line text="In advice()"/> + <line text="Method m() running"/> + <line text="In instance check method, count=3 so doit returns false"/> + <line text="Method m() running"/> + <line text="In instance check method, count=4 so doit returns true"/> + <line text="In advice()"/> + <line text="Method m() running"/> + </stdout> +</run> +</ajc-test> + +<ajc-test dir="bugs1612/pr239649" title="thisAspectInstance - 3"> +<compile files="Three.java" options="-1.5"/> +<run class="Three"> + <stdout> + <line text="Method m() running"/> + <line text="In instance check method, count=1 so doit returns false"/> + <line text="Method m() running"/> + <line text="In instance check method, count=2 so doit returns true"/> + <line text="In advice()"/> + <line text="Method m() running"/> + <line text="In instance check method, count=3 so doit returns false"/> + <line text="Method m() running"/> + <line text="In instance check method, count=4 so doit returns true"/> + <line text="In advice()"/> + </stdout> +</run> +</ajc-test> + +<ajc-test dir="bugs1612/pr239649" title="thisAspectInstance - 4"> +<compile files="Four.java" options="-1.5"/> +<run class="Four"> + <stdout> + <line text="In instance check method doit()"/> + <line text="In advice() execution(void Four.m())"/> + <line text="Method m() running"/> + </stdout> +</run> +</ajc-test> + +<ajc-test dir="bugs1612/pr239649" title="thisAspectInstance - 5"> +<compile files="Five.java" options="-1.5"/> +<run class="Five"> + <stdout> + <line text="In instance check method doit()"/> + <line text="In advice() arg0=abc"/> + <line text="Method m() running"/> + </stdout> +</run> +</ajc-test> + +<ajc-test dir="bugs1612/pr239649" title="thisAspectInstance - 6"> +<compile files="Six.java" options="-1.5"/> +<run class="Six"> + <stdout> + <line text="In instance check method doit()"/> + <line text="In advice() execution(void Six.main(String[]))"/> + <line text="Method m() running"/> + </stdout> +</run> +</ajc-test> + +<ajc-test dir="bugs1612/pr239649" title="thisAspectInstance - 7"> +<compile files="Seven.java" options="-1.5"/> +<run class="Seven"> + <stdout> + <line text="In instance check method doit()"/> + <line text="In advice() call(void Seven.m()) execution(void Seven.main(String[]))"/> + <line text="Method m() running"/> + </stdout> +</run> +</ajc-test> + +<ajc-test dir="bugs1612/pr239649" title="thisAspectInstance - 8"> +<compile files="Eight.java" options="-1.5"/> +<run class="Eight"> + <stdout> + <line text="in doit(): class=X"/> + <line text="In advice()"/> + <line text="Method m() running"/> + </stdout> +</run> +</ajc-test> + +<ajc-test dir="bugs1612/pr239649" title="thisAspectInstance - 9"> +<compile files="Nine.java" options="-1.5"/> +<run class="Nine"> + <stdout> + <line text="in doit(): class=X"/> + <line text="In advice()"/> + <line text="Method m() running"/> + </stdout> +</run> +</ajc-test> + +<ajc-test dir="bugs1612/pr239649" title="thisAspectInstance - 10"> +<compile files="Ten.java" options="-1.5"/> +<run class="com.foo.bar.Ten"> + <stdout> + <line text="In instance check method doit() class=com.foo.bar.X"/> + <line text="In advice()"/> + <line text="Method m() running"/> + </stdout> +</run> +</ajc-test> + +<ajc-test dir="bugs1612/pr239649" title="thisAspectInstance - 11"> +<compile files="Eleven.java" options="-1.5"> +<message kind="error" text="thisAspectInstance can only be used inside an if() clause for singleton aspects (compiler limitation)"/> +</compile> +</ajc-test> + +<ajc-test dir="bugs1612/pr239649" title="thisAspectInstance - 12"> +<compile files="Twelve.java" options="-1.5"/> +<run class="Twelve"> + <stdout> + <line text="In instance check method doit()"/> + <line text="In advice() arg=abc tjpsp=execution(void Twelve.m(String))"/> + <line text="Method m() running"/> + </stdout> +</run> +</ajc-test> + +<ajc-test dir="bugs1612/pr239649" title="thisAspectInstance - 13"> +<compile files="Thirteen.java" options="-1.5"/> +<run class="Thirteen"> + <stdout> + <line text="instance is X"/> + <line text="In advice() arg=abc tjpsp=execution(void Thirteen.m(String))"/> + <line text="Method m() running"/> + </stdout> +</run> +</ajc-test> + +<ajc-test dir="bugs1612/pr239649" title="thisAspectInstance - 14"> +<compile files="Fourteen.java" options="-1.5"/> +<run class="Fourteen"> + <stdout> + <line text="instance is X"/> + <line text="In advice()"/> + <line text="Method m() running"/> + </stdout> +</run> +</ajc-test> + +<ajc-test dir="bugs1612/pr239649" title="thisAspectInstance - 15"> +<compile files="Fifteen.java" options="-1.5"/> +<run class="Fifteen"> + <stdout> + <line text="in doit(): class=X"/> + <line text="In advice()"/> + <line text="Method m() running"/> + </stdout> +</run> +</ajc-test> + +<ajc-test dir="bugs1612/doubleITDF" title="double itdf"> +<compile files="A.java" options="-1.7"/> +<run class="A"> + <stdout> + <line text="AA"/> + </stdout> +</run> +</ajc-test> + +<ajc-test dir="bugs1612/verify" title="verify perthis"> +<compile files="Runner.aj" inpath="code.jar" classpath="groovy-1.8.0.jar;asm-3.2.jar" options="-1.6 -Xset:generateStackMaps=true"/> +<run class="Runner"> + <stdout> + <line text="AA"/> + </stdout> +</run> +</ajc-test> + +<ajc-test dir="bugs1612/pr353936" title="local variable tables"> +<compile files="Code.java" options="-1.5"/> +</ajc-test> + +<ajc-test dir="bugs1612/pr352363" title="empty pattern"> +<compile files="Code.java" options="-1.5"> + <message line="12" kind="warning" text="name is empty1"/> + <message line="13" kind="warning" text="name is empty2"/> +</compile> +</ajc-test> + +<ajc-test dir="bugs1612/pr351592" title="generics issue"> +<compile files="Test.java Fib.java FibCaching.aj Caching.aj" options="-1.5"/> +<run class="caching.Test"/> +</ajc-test> + +<ajc-test dir="bugs1612/pr351592" title="generics issue - 2"> +<compile files="Test.java Fib.java FibCaching.aj Caching.aj" options="-1.5"/> +<run class="caching.Test"/> +</ajc-test> + +<ajc-test dir="bugs1612/pr350800" title="generics npe"> +<compile files="AbstractAdapter.java AbstractProbingAspect.java Adapter.java ProbingAspect.java" options="-1.5"/> +<!-- run class="com.example.MyAspectTest" --> +</ajc-test> + +<ajc-test dir="bugs1612/pr350800_2" title="generics npe - code"> +<compile files="AbstractAdapter.java AbstractProbingAspect.java Adapter.java ProbingAspect.java" options="-1.5"/> +<!-- run class="com.example.MyAspectTest" --> +</ajc-test> + +<ajc-test dir="bugs1612/pr350800_3" title="generics npe - 3"> +<compile files="AbstractAdapter.java AbstractProbingAspect.java Adapter.java ProbingAspect.java" options="-1.5"/> +<run class="test.aop.Adapter"> +<stdout> +<line text=">hello"/> +</stdout> +</run> +</ajc-test> + +<ajc-test dir="bugs1612/pr349961" title="ordering"> +<compile files="MyParameterAnnotation.java MyAspect.java MyAspectTest.java A.java ABean.java" options="-1.5"/> +<run class="com.example.MyAspectTest"> +</run> +</ajc-test> + +<ajc-test dir="bugs1612/pr349961" title="ordering - 2"> +<compile files="MyParameterAnnotation.java MyAspect.java MyAspectTest.java ABean.java A.java" options="-1.5"/> +<run class="com.example.MyAspectTest"> +</run> +</ajc-test> + +<ajc-test dir="bugs1612/pr347395" title="verifyerror - inline"> +<compile files="Target.java Task.java TaskHistoryAspect.aj TaskModification.java" options="-1.5"/> +<run class="xxx.util.Target"> +</run> +</ajc-test> + +<ajc-test dir="bugs1612/pr349398" title="duplicate methods"> +<compile files="DataGenerator.java CacheAspect.java DataGeneratorCacheAspect.java DataGeneratorTest.java" options="-1.5"/> +<run class="DataGeneratorTest"> +</run> +</ajc-test> + + +<ajc-test dir="bugs1612/pr347684" title="binding ints"> +<compile files="BindingInts.java" options="-1.5"/> +<run class="BindingInts"> + <stdout> + <line text="execution(void BindingInts.a()) 37"/> + </stdout> +</run> +</ajc-test> + +<ajc-test dir="bugs1612/pr347684" title="binding ints - 2"> +<compile files="BindingInts2.java" options="-1.5"/> +<run class="BindingInts2"> + <stdout> + <line text="execution(void BindingInts2.a()) 99"/> + </stdout> +</run> +</ajc-test> + +<ajc-test dir="bugs1612/pr347684" title="binding ints - 3"> +<compile files="BindingInts3.java" options="-1.5"/> +<run class="BindingInts3"> + <stdout> + <line text="execution(void BindingInts3.a()) abc"/> + </stdout> +</run> +</ajc-test> + +<ajc-test dir="bugs1612/pr347684" title="binding ints - 4"> +<compile files="BindingInts4.java" options="-1.5"/> +<run class="BindingInts4"> + <stdout> + <line text="execution(void BindingInts4.a()) 37 48"/> + </stdout> +</run> +</ajc-test> + +<ajc-test dir="bugs1612/pr347684" title="binding ints - 5"> +<compile files="BindingInts5.java" options="-1.5"/> +<run class="BindingInts5"> + <stdout> + <line text="execution(void BindingInts5.a()) 37"/> + </stdout> +</run> +</ajc-test> + + +<ajc-test dir="bugs1612/pr347684" title="binding ints - 6"> +<compile files="BindingInts6.java" options="-1.5"/> +<run class="BindingInts6"> + <stdout> + <line text="execution(void BindingInts6.a()) 37 1 99"/> + </stdout> +</run> +</ajc-test> + +<ajc-test dir="bugs1612/pr345515" title="anno copying"> +<compile files="Code.java" options="-1.5"/> +<run class="Code"></run> +</ajc-test> + +<ajc-test dir="bugs1612/pr327867" title="synthetic methods"> +<compile files="Foo.java" options="-1.5 -showWeaveInfo"> +<message kind="weave" text="Join point 'method-execution(void Foo.main(java.lang.String[]))' in Type 'Foo' (Foo.java:3) advised by before advice from 'X' (Foo.java:17)"/> +<message kind="weave" text="Join point 'method-execution(void Foo.m())' in Type 'Foo' (Foo.java:7) advised by before advice from 'X' (Foo.java:17)"/> +</compile> +<run class="Foo"/> +</ajc-test> + +<ajc-test dir="bugs1612/pr345172" title="incorrect annos"> +<compile files="InterType.java" options="-1.5 -showWeaveInfo"> +<message kind="weave" text="Join point 'method-execution(void InterType$InterTypeIfc.m1(int))' in Type 'InterType' (InterType.java:21) advised by around advice from 'InterType$AroundMethod' (InterType.java:12)"/> +<!-- +<message kind="weave" text="Join point 'method-execution(void InterType$InterTypeIfc.m1(int, int))' in Type 'InterType' (InterType.java:24) advised by around advice from 'InterType$AroundMethod' (InterType.java:12)"/> +<message kind="weave" text="Join point 'method-execution(void InterType.m1(int))' in Type 'InterType' (InterType.java:28) advised by around advice from 'InterType$AroundMethod' (InterType.java:12)"/> +--> +<message kind="weave" text="Type 'InterType$InterTypeIfc' (InterType.java) has intertyped method from 'InterType' (InterType.java:'void InterType$InterTypeIfc.m1(int)')"/> +<message kind="weave" text="Type 'InterType$InterTypeIfc' (InterType.java) has intertyped method from 'InterType' (InterType.java:'void InterType$InterTypeIfc.m1(int, int)')"/> +</compile> +<run class="InterType"/> +</ajc-test> + +<ajc-test dir="bugs1612/pr345172" title="incorrect annos 2"> +<compile files="InterType2.java" options="-1.5"> +</compile> +<run class="InterType2"> +<stdout> +<line text="execution(void InterType2.InterTypeIfc.m1(int))"/> +</stdout></run> +</ajc-test> + +<ajc-test dir="bugs1612/pr345172" title="incorrect annos 3"> +<compile files="InterType3.java" options="-1.5"> +</compile> +<run class="InterType3"> +<stdout> +<line text="execution(void InterType3.InterTypeIfc.m1(int, String))"/> +</stdout></run> +</ajc-test> + + + + +<ajc-test dir="bugs1612/pr328099" title="signed jar ltw"> +<compile files="X.java" classpath="code.jar"/> +<run class="foo.bar.FooLaunch" ltw="aop.xml" classpath="$sandbox/code.jar"> +<stdout> +<line text="pre...Foo.bar()...post"/> +</stdout> +</run> +</ajc-test> + +<ajc-test dir="bugs1612/pr315398" title="verifyerror"> +<compile files="Code.java" options="-1.5"> +</compile> +<run class="Code"> +<stdout> +<line text="1"/> +<line text="advice"/> +<line text="2"/> +</stdout></run> +</ajc-test> + +<ajc-test dir="bugs1612/pr315398" title="verifyerror - 2"> +<compile files="Code2.java" options="-1.5"> +</compile> +<run class="Code2"></run> +</ajc-test> + +<ajc-test dir="bugs1612/pr335810" title="rawtype warning"> +<compile files="One.java" options="-1.5 -warn:+raw -warn:+unchecked -warn:+warningToken"> +</compile> +</ajc-test> + +<ajc-test dir="bugs1612/pr327134" title="rawtype pointcut"> +<compile files="Code.java" options="-1.5 -warn:+raw -warn:+warningToken"> +</compile> +</ajc-test> + +<ajc-test dir="bugs1612/pr344005" title="decp generics"> +<compile files="Anno.java Types.java Azpect.java" options="-1.5 -showWeaveInfo"> +<message kind="weave" text="XX"/> +</compile> +</ajc-test> + +<ajc-test dir="bugs1612/pr343051" title="illegalaccesserror"> +<compile files="Code.java Code2.java Azpect.java" options="-1.5"/> +<run class="p.Code"> +<stdout> +<line text="abc"/> +</stdout> +</run> +</ajc-test> + +<ajc-test dir="bugs1612/pr339974" title="itit npe"> +<compile files="City.java TrafficCalculator.java" options="-1.5"> +<message kind="error" text="The nested type TrafficCalculator cannot hide an enclosing type"/> +</compile> +</ajc-test> + +<ajc-test dir="bugs1612/pr342605" title="noimporterror"> +<compile files="Code.java" options="-1.5 -noImportError"/> +<run class="Code"/> +</ajc-test> + + <ajc-test dir="bugs1612/pr342323" title="clashing local types"> + <compile files="Runner.java Bean.java Azpect.java" options="-1.5"/> + <run class="ppp.Runner"> + <stdout> + <line text="Calling regular method"/> + <line text="class"/> + <line text="Calling itd method"/> + <line text="aspect foo"/> + </stdout> + </run> + </ajc-test> + +<ajc-test dir="bugs1612/pr338175" title="itit"> +<compile files="pack1/Aspect.java pack2/Java.java pack2/Java2.java" options="-1.5"> + <message kind="error" text="Duplicate nested type ITIT"/> + <message kind="error" text="can't determine modifiers"/> +</compile> +</ajc-test> + + <ajc-test dir="bugs1612/pr292239" title="throws clause"> + <compile files="Code.java" options="-1.5 -showWeaveInfo"> + <message kind="weave" text="Join point 'method-execution(void mypackage.Code.n())' in Type 'mypackage.Code' (Code.java:19) advised by afterThrowing advice from 'mypackage.Azpect' (Code.java:9)"/> + </compile> + <run class="mypackage.Code"> + <stdout> + <line text="caught it"/> + <line text="done"/> + </stdout> + </run> + </ajc-test> + + <ajc-test dir="bugs1612/pr292239" title="throws clause - 2"> + <compile files="Code2.java" options="-1.5 -showWeaveInfo"> + <message kind="weave" text="Join point 'method-execution(void mypackage.Code2.n2())' in Type 'mypackage.Code2' (Code2.java:17) advised by afterThrowing advice from 'mypackage.Azpect' (Code2.java:7)"/> + </compile> + <run class="mypackage.Code2"> + <stdout> + <line text="caught it: execution(void mypackage.Code2.n2())"/> + <line text="done"/> + </stdout> + </run> + </ajc-test> +<!-- + + + <ajc-test dir="bugs1611/pr336136" title="itit"> + <compile files="Country_Roo_Op4j.java"> + <message kind="error" text="The import com.foo cannot be resolved" line="1"/> + <message kind="error" text="The import org.javaruntype cannot be resolved" line="3"/> + <message kind="error" text="The import org.op4j cannot be resolved" line="4"/> + <message kind="error" text="The import org.op4j cannot be resolved" line="5"/> + <message kind="error" text="Country cannot be resolved to a type" line="9"/> + <message kind="error" text="Function cannot be resolved to a type" line="11"/> + <message kind="error" text="can't determine modifiers of missing type Country_Roo_Op4j$Keys"/> + </compile>" + </ajc-test> + + --> + + +</suite>
\ No newline at end of file |