1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002 |
- <!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[
- ]>
-
- <!-- AspectJ v1.5.0 Tests -->
-
- <suite>
-
- <ajc-test dir="java5/bridgeMethods" pr="72766" title="Ignore bridge methods">
- <compile files="AspectX.aj" inpath="testcode.jar" options="-showWeaveInfo">
- <message kind="warning" line="7" text="pointcut did not match on the method call to a bridge method."/>
- <message kind="weave" text="(AspectX.aj:18) advised by before advice from 'AspectX'"/>
- <message kind="weave" text="(Number.java:5) advised by before advice from 'AspectX'"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="migration" title="load aspectj 1.2.1 aspects in aspectj 5">
- <compile files="Program.java" aspectpath="aspects121.jar">
- </compile>
- <run class="Program"/>
- </ajc-test>
-
- <ajc-test dir="bugs/java5/arrayCloning" pr="72150" vm="1.5"
- title="AJC possible bug with static nested classes">
- <compile files="A.java,C.java" options="-1.5,-showWeaveInfo">
- <message kind="weave" text="Type 'C' (C.java:14) advised by around advice from 'A' (A.java:2)"/>
- </compile>
- <run class="C"/>
- </ajc-test>
-
- <ajc-test dir="java5/pseudoKeywords"
- title="method called around in class">
- <compile files="MethodCalledAround.java">
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/pseudoKeywords"
- title="method called around in aspect">
- <compile files="MethodCalledAroundAspect.java">
- <message kind="error" line="2"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="bugs150/pr87376" title="structure model npe on type not found">
- <compile files="I.java,NPE.aj" options="-emacssym">
- <message kind="error" line="8" text="I cannot be resolved to a type"/>
- <message kind="error" line="10" text="I cannot be resolved to a type"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="decp" pr="80249" title="Order of types passed to compiler determines weaving behavior">
- <compile files="A.java,B.java,AspectX.java"/>
- <run class="B"/>
- <compile files="B.java,A.java,AspectX.java"/>
- <run class="B"/>
- </ajc-test>
-
- <ajc-test dir="decs" pr="42743" title="declare soft of runtime exception">
- <compile files="DeclareSoftRuntimeException.aj">
- <message kind="warning" line="3" text="MyRuntimeException will not be softened as it is already a RuntimeException"/>
- </compile>
- <run class="DeclareSoftRuntimeException">
- <stdout>
- <line text="MyRuntimeException"/>
- <line text="org.aspectj.lang.SoftException"/>
- <line text="MyRuntimeException"/>
- </stdout>
- </run>
- </ajc-test>
-
- <ajc-test dir="decs" pr="42743" title="declare soft w. catch block">
- <compile files="VerifyError.aj">
- </compile>
- <run class="VerifyError"/>
- </ajc-test>
-
- <ajc-test dir="bugs" pr="61568" title="Various kinds of ambiguous bindings">
- <compile files="AmbiguousBindings.aj">
- <message line="17" text="ambiguous binding of parameter(s) foo across '||' in pointcut"></message>
- <message line="19" text="ambiguous binding of parameter(s) foo across '||' in pointcut"></message>
- <message line="21" text="ambiguous binding of parameter(s) foo across '||' in pointcut"></message>
- <message line="23" text="ambiguous binding of parameter(s) x across '||' in pointcut"></message>
- <message line="25" text="ambiguous binding of parameter(s) foo across '||' in pointcut"></message>
- </compile>
- </ajc-test>
-
- <ajc-test dir="bugs" pr="61658" title="ambiguous args">
- <compile files="PR61658.java">
- <message line="17" text="ambiguous binding of parameter(s) a, b across '||' in pointcut"></message>
- </compile>
- </ajc-test>
-
- <ajc-test dir="bugs150" pr="78021" title="Injecting exception into while loop with break statement causes catch block to be ignored">
- <compile files="PR78021.java"/>
- <run class="PR78021"/>
- </ajc-test>
-
- <ajc-test dir="bugs150" pr="79554" title="Return in try-block disables catch-block if final-block is present">
- <compile files="PR79554.java"/>
- <run class="PR79554"/>
- </ajc-test>
-
- <ajc-test dir="bugs150" pr="82570" title="Weaved code does not include debug lines">
- <compile files="PR82570_1.java"/>
- </ajc-test>
-
- <ajc-test dir="bugs150" pr="83303" title="compiler error when mixing inheritance, overriding and polymorphism">
- <compile files="PR83303.java"/>
- </ajc-test>
-
- <ajc-test dir="bugs150" pr="83563" title="pertypewithin() handing of inner classes (1)">
- <compile files="PR83563_1.java"/>
- <run class="PR83563_1"/>
- </ajc-test>
-
- <ajc-test dir="bugs150" pr="83563" title="pertypewithin() handing of inner classes (2)">
- <compile files="PR83563_2.java"/>
- <run class="PR83563_2"/>
- </ajc-test>
-
- <ajc-test dir="bugs150" pr="83645" title="pertypewithin({interface}) illegal field modifier">
- <compile files="PR83645.java"/>
- <run class="PR83645"/>
- </ajc-test>
-
- <ajc-test dir="bugs150" title="bad asm for enums" vm="1.5">
- <compile files="Rainbow.java" options="-emacssym,-1.5"/>
- </ajc-test>
-
- <!-- Annotation binding tests -->
-
- <ajc-test dir="java5/annotations/binding" vm="1.5" title="call annotation binding 1">
- <compile files="CallAnnBinding.aj" options="-1.5"/>
- <run class="CallAnnBinding"/>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/binding" vm="1.5" title="call annotation binding 2">
- <compile files="CallAnnBinding2.aj" options="-1.5"/>
- <run class="CallAnnBinding2"/>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/binding" vm="1.5" title="call annotation binding 3">
- <compile files="CallAnnBinding3.aj" options="-1.5"/>
- <run class="CallAnnBinding3"/>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/binding" vm="1.5" title="call annotation binding 4">
- <compile files="CallAnnBinding4.aj" options="-1.5"/>
- <run class="CallAnnBinding4"/>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/binding" vm="1.5" title="call annotation binding 5">
- <compile files="CallAnnBinding5.aj" options="-1.5"/>
- <run class="CallAnnBinding5"/>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/binding" vm="1.5" title="call annotation binding 6">
- <compile files="CallAnnBinding6.aj" options="-1.5"/>
- <run class="CallAnnBinding6"/>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/binding" vm="1.5" title="call annotation binding 7">
- <compile files="CallAnnBinding7.aj" options="-1.5"/>
- <run class="CallAnnBinding7"/>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/binding" vm="1.5" title="@target annotation binding 1">
- <compile files="AtTarget1.aj" options="-1.5"/>
- <run class="AtTarget1"/>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/binding" vm="1.5" title="@target annotation binding 2">
- <compile files="AtTarget2.aj" options="-1.5"/>
- <run class="AtTarget2"/>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/binding" vm="1.5" title="@target annotation binding 3">
- <compile files="AtTarget3.aj" options="-1.5"/>
- <run class="AtTarget3"/>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/binding" vm="1.5" title="@target annotation binding 4">
- <compile files="AtTarget4.aj" options="-1.5"/>
- <run class="AtTarget4"/>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/binding/usingPackageNames" vm="1.5" title="@target annotation binding 5">
- <compile files="MyAspect.aj,MyAnnotation.java,MyClass.java" options="-1.5"/>
- <run class="test.MyClass"/>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/binding" vm="1.5" title="@this annotation binding 1">
- <compile files="AtThis1.aj" options="-1.5"/>
- <run class="AtThis1"/>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/binding" vm="1.5" title="@this annotation binding 2">
- <compile files="AtThis2.aj" options="-1.5"/>
- <run class="AtThis2"/>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/binding" vm="1.5" title="@this annotation binding 3">
- <compile files="AtThis3.aj" options="-1.5"/>
- <run class="AtThis3"/>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/binding" vm="1.5" title="@this annotation binding 4">
- <compile files="AtThis4.aj" options="-1.5"/>
- <run class="AtThis4"/>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/binding" vm="1.5" title="@this annotation binding 5">
- <compile files="AtThis5.aj" options="-1.5"/>
- <run class="AtThis5"/>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/binding" vm="1.5" title="@args annotation binding 1">
- <compile files="AtArgs1.aj" options="-1.5"/>
- <run class="AtArgs1"/>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/binding" vm="1.5" title="@args annotation binding 2">
- <compile files="AtArgs2.aj" options="-1.5"/>
- <run class="AtArgs2"/>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/binding" vm="1.5" title="@args annotation binding 3">
- <compile files="AtArgs3.aj" options="-1.5"/>
- <run class="AtArgs3"/>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/binding" vm="1.5" title="@args annotation binding 4">
- <compile files="AtArgs4.aj" options="-1.5"/>
- <run class="AtArgs4"/>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/binding" vm="1.5" title="@args annotation binding 5">
- <compile files="AtArgs5.aj" options="-1.5"/>
- <run class="AtArgs5"/>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/binding" vm="1.5" title="execution and @annotation">
- <compile files="ExecutionAnnBinding1.aj" options="-1.5"/>
- <run class="ExecutionAnnBinding1"/>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/binding" vm="1.5" title="set and @annotation">
- <compile files="FieldAnnBinding1.aj" options="-1.5"/>
- <run class="FieldAnnBinding1"/>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/binding" vm="1.5" title="get and @annotation">
- <compile files="FieldAnnBinding2.aj" options="-1.5"/>
- <run class="FieldAnnBinding2"/>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/binding" vm="1.5" title="get and @annotation with arrays">
- <compile files="FieldAnnBinding3.aj" options="-1.5"/>
- <run class="FieldAnnBinding3"/>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/binding" vm="1.5" title="cons call and @annotation">
- <compile files="CtorAnnBinding1.aj" options="-1.5"/>
- <run class="CtorAnnBinding1"/>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/binding" vm="1.5" title="cons exe and @annotation">
- <compile files="CtorAnnBinding2.aj" options="-1.5"/>
- <run class="CtorAnnBinding2"/>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/binding" vm="1.5" title="staticinit and @annotation">
- <compile files="StaticInitBinding.aj" options="-1.5"/>
- <run class="StaticInitBinding"/>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/binding" vm="1.5" title="preinit and @annotation">
- <compile files="PreInitBinding.aj" options="-1.5"/>
- <run class="PreInitBinding"/>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/binding" vm="1.5" title="init and @annotation">
- <compile files="InitBinding.aj" options="-1.5"/>
- <run class="InitBinding"/>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/binding" vm="1.5" title="adviceexecution and @annotation">
- <compile files="AdviceExecBinding.aj" options="-1.5"/>
- <run class="AdviceExecBinding"/>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/binding" vm="1.5" title="handler and @annotation">
- <compile files="HandlerBinding.aj" options="-1.5"/>
- <run class="HandlerBinding"/>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/binding" vm="1.5" title="@withincode() and call(* println(..))">
- <compile files="WithinCodeBinding1.aj" options="-1.5"/>
- <run class="WithinCodeBinding1"/>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/binding" vm="1.5" title="@within">
- <compile files="WithinBinding1.aj" options="-1.5"/>
- <run class="WithinBinding1"/>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/binding" vm="1.5" title="@within - multiple types">
- <compile files="WithinBinding2.aj" options="-1.5"/>
- <run class="WithinBinding2"/>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/binding/complexExample" vm="1.5" title="packages and no binding">
- <compile files="A.java,B.java,Color.java,X.java" options="-1.5"/>
- <run class="a.b.c.A"/>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/binding/complexExample" vm="1.5" title="packages and binding">
- <compile files="A.java,B.java,Color.java,X2.java" options="-1.5"/>
- <run class="a.b.c.A"/>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/binding" vm="1.5" title="binding with static methods">
- <compile files="StaticMethods.java" options="-1.5"/>
- <run class="StaticMethods"/>
- </ajc-test>
-
- <ajc-test dir="java5/annotations" vm="1.5" title="annotation matching on call">
- <weave classesFiles="AnnotatedType.java,SimpleAnnotation.java,SimpleAnnotation2.java"
- aspectsFiles="AnnotationAspect02.aj"
- options="-1.5,-showWeaveInfo">
- <message kind="weave" text="Type 'AnnotatedType' (AnnotatedType.java:3) advised by before advice from 'AnnotationAspect02' (AnnotationAspect02.aj:4)"/>
- <message kind="weave" text="Type 'AnnotatedType' (AnnotatedType.java:3) advised by before advice from 'AnnotationAspect02' (AnnotationAspect02.aj:2)"/>
- <message kind="weave" text="Type 'AnnotatedType' (AnnotatedType.java:4) advised by before advice from 'AnnotationAspect02' (AnnotationAspect02.aj:4)"/>
- </weave>
- </ajc-test>
-
- <ajc-test dir="java5/annotations" vm="1.5" title="at annotation matching">
- <weave classesFiles="AnnotatedType.java,SimpleAnnotation.java,SimpleAnnotation2.java"
- aspectsFiles="AnnotationAspect03.aj"
- options="-1.5,-showWeaveInfo">
- <message kind="warning" line="8" text="@annotation matched here"/>
- </weave>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/within_code" vm="1.5" title="annotations and within(code)">
- <weave classesFiles="TestingAnnotations.java"
- aspectsFiles="WithinAndWithinCodeTests.java"
- options="-1.5,-showWeaveInfo">
- <message kind="warning" line="31" text="@within match on non-inherited annotation"/>
- <message kind="warning" line="39" text="@within match on non-inherited annotation"/>
- <message kind="warning" line="39" text="@within match on inheritable annotation"/>
- <message kind="warning" line="43" text="@within match on inheritable annotation"/>
- <message kind="warning" line="32" text="@withincode match"/>
- </weave>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/within" vm="1.5" title="annotations and within">
- <weave classesFiles="PlainWithin.java"
- aspectsFiles="PlainWithinTests.java"
- options="-1.5,-showWeaveInfo">
- <message kind="warning" line="21" text="positive within match on annotation"/>
- <message kind="warning" line="25" text="negative within match on annotation"/>
- </weave>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/thisOrtarget" vm="1.5" title="must have runtime retention">
- <compile options="-1.5" files="TestingAnnotations.java,NotRuntimeRetention.aj">
- <message kind="error" line="7" text="Annotation type MyClassRetentionAnnotation does not have runtime retention"/>
- <message kind="error" line="13" text="Annotation type MyClassRetentionAnnotation does not have runtime retention"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/thisOrtarget" vm="1.5" title="inheritable or not">
- <compile options="-1.5" files="TestingAnnotations.java,ThisOrTargetTests.aj">
- </compile>
- <run class="TestingAnnotations"/>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/thisOrtarget" vm="1.5" title="use of @this/target in deow">
- <compile options="-1.5" files="TestingAnnotations.java,DeclareEoW.java">
- <message kind="error" line="3" text="this() pointcut designator cannot be used in declare statement"/>
- <message kind="error" line="5" text="target() pointcut designator cannot be used in declare statement"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/args" vm="1.5" title="@args tests">
- <compile options="-1.5" files="TestingArgsAnnotations.java,AtArgsAspect.java">
- </compile>
- <run class="TestingArgsAnnotations"/>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/args" vm="1.5" title="use of @args in deow">
- <compile options="-1.5" files="TestingArgsAnnotations.java,DeclareEoW.java">
- <message kind="error" line="3" text="args() pointcut designator cannot be used in declare statement"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/annotations" vm="1.5" title="compiling an annotation">
- <compile options="-1.5" files="SimpleAnnotation.java">
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/annotations" vm="1.5" title="compiling annotated file">
- <compile options="-1.5" files="SimpleAnnotation.java,AnnotatedType.java">
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/within" vm="1.5" title="annotations and within (src)">
- <compile files="PlainWithin.java,PlainWithinTests.java"
- aspectsFiles="PlainWithinTests.java"
- options="-1.5">
- <message kind="warning" line="21" text="positive within match on annotation"/>
- <message kind="warning" line="25" text="negative within match on annotation"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/attarget" vm="1.5" title="losing annotations...">
- <compile options="-1.5" files="Program.java,AtTargetAspect.java">
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/annotations" vm="1.5" title="no itds on annotation types">
- <compile files="AnnotatedType.java,SimpleAnnotation.java,SimpleAnnotation2.java,AnnotationAspect01.aj"
- options="-1.5">
- <message kind="error" line="4" text="can't make inter-type constructor declarations"/>
- <message kind="error" line="8" text="can't make inter-type method declarations"/>
- <message kind="error" line="13" text="can't make inter-type field declarations"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/annotations" vm="1.5" title="no declare parents on annotation types">
- <compile files="AnnotatedType.java,SimpleAnnotation.java,SimpleAnnotation2.java,AnnotationAspect04.aj"
- options="-1.5">
- <message kind="error" line="7" text="can't use declare parents to alter supertype of annotation type SimpleAnnotation"/>
- <message kind="error" line="10" text="can't use declare parents to make 'java.lang.annotation.Annotation' the parent of type"/>
- <message kind="error" line="4" text="can't use declare parents to make annotation type SimpleAnnotation implement an interface"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/annotations" vm="1.5" title="declare parents wildcards matching annotation types">
- <compile files="AnnotatedType.java,SimpleAnnotation.java,SimpleAnnotation2.java,AnnotationAspect05.aj"
- options="-1.5">
- <message kind="warning" line="4" text="annotation type SimpleAnnotation2 matches a declare parents type pattern but is being ignored"/>
- <message kind="warning" line="4" text="annotation type SimpleAnnotation matches a declare parents type pattern but is being ignored"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/binding/complexExample" vm="1.5" title="annotated any pattern">
- <compile files="A.java,B.java,C.java,Color.java,X3.java"
- options="-1.5">
- </compile>
- <run class="g.h.i.C"/>
- <run class="a.b.c.A"/>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/binding/complexExample" vm="1.5" title="annotation not imported">
- <compile files="A.java,B.java,C.java,Color.java,X4.java"
- options="-1.5">
- <message kind="warning" line="6" text="no match for this type name: Color"/>
- </compile>
- <run class="a.b.c.A"/>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/itds" vm="1.5" title="nasty annotation and itds test">
- <compile files="AnnotationsAndITDs.aj" options="-1.5">
- <message kind="warning" line="25" text="execution(@SomeAnnotation ...)"/>
- <message kind="warning" line="28" text="execution(@SomeAnnotation ...)"/>
- <message kind="warning" line="52" text="execution(@SomeAnnotation ...)"/>
- <message kind="warning" line="53" text="execution(@SomeAnnotation ...)"/>
- <message kind="warning" line="17" text="execution(@SomeAnnotation ...new(..)"/>
- <message kind="warning" line="20" text="execution(@SomeAnnotation ...new(..)"/>
- <message kind="warning" line="45" text="execution(@SomeAnnotation ...new(..)"/>
- <message kind="warning" line="46" text="execution(@SomeAnnotation ...new(..)"/>
- <message kind="warning" line="70" text="set(@SomeAnnotation...)"/>
- <message kind="warning" line="71" text="set(@SomeAnnotation...)"/>
- <message kind="warning" line="76" text="set(@SomeAnnotation...)"/>
- <message kind="warning" line="77" text="set(@SomeAnnotation...)"/>
- <message kind="warning" line="175" text="si(@SomeAnnotation...)"/>
- <message kind="warning" line="180" text="si(@SomeAnnotation...)"/>
- </compile>
- <run class="AnnotationsAndITDs">
- <stdout>
- <line text="@type System"/>
- <line text="hello AnnotationsAndITDs"/>
- <line text="goodbye String"/>
- <line text="x Object"/>
- <line text="y Integer"/>
- <line text="method bar has 1 params, first param annotation is @ParamAnnotation"/>
- <line text="d Double"/>
- <line text="f Double"/>
- <line text="@type System"/>
- <line text="@cons String"/>
- <line text="@cons String"/>
- <line text="@method ITDMe2"/>
- <line text="@method ITDMe2"/>
- <line text="@field ITDMe2"/>
- <line text="@field ITDMe2"/>
- </stdout>
- </run>
- </ajc-test>
-
- <!-- ======================================================================================= -->
- <!-- Autoboxing tests -->
- <!-- ======================================================================================= -->
-
- <ajc-test dir="java5/autoboxing" vm="1.5" title="simple boxing test">
- <compile files="AutoboxingB.java,AutoboxingC.java,AutoboxingD.java,AutoboxingF.java,AutoboxingI.java,AutoboxingJ.java,AutoboxingS.java,AutoboxingZ.java,SimpleAutoboxing.java,SimpleAutoboxingAspect.aj"
- options="-1.5,-showWeaveInfo">
- <message kind="weave" text="Type 'SimpleAutoboxing' (SimpleAutoboxing.java:7) advised by before advice from 'SimpleAutoboxingAspect' (SimpleAutoboxingAspect.aj:8)"/>
- <message kind="weave" text="Type 'SimpleAutoboxing' (SimpleAutoboxing.java:7) advised by before advice from 'SimpleAutoboxingAspect' (SimpleAutoboxingAspect.aj:4)"/>
- </compile>
- <run class="SimpleAutoboxing">
- <stderr>
- <line text="Matching by Integer:20000"/>
- <line text="Matching by int:20000"/>
- <line text="method_takes_Integer=20000"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="java5/autoboxing" vm="1.5" title="integer boxing">
- <compile files="AutoboxingB.java,AutoboxingC.java,AutoboxingD.java,AutoboxingF.java,AutoboxingI.java,AutoboxingJ.java,AutoboxingS.java,AutoboxingZ.java,SimpleAutoboxing.java,AspectInteger.aj"
- options="-1.5,-showWeaveInfo">
- <message kind="weave" text="Type 'AutoboxingI' (AutoboxingI.java:11) advised by before advice from 'AspectInteger' (AspectInteger.aj:8)"/>
- <message kind="weave" text="Type 'AutoboxingI' (AutoboxingI.java:11) advised by before advice from 'AspectInteger' (AspectInteger.aj:4)"/>
- <message kind="weave" text="Type 'AutoboxingI' (AutoboxingI.java:12) advised by before advice from 'AspectInteger' (AspectInteger.aj:8)"/>
- <message kind="weave" text="Type 'AutoboxingI' (AutoboxingI.java:12) advised by before advice from 'AspectInteger' (AspectInteger.aj:4)"/>
- <message kind="weave" text="Type 'AutoboxingI' (AutoboxingI.java:13) advised by before advice from 'AspectInteger' (AspectInteger.aj:8)"/>
- <message kind="weave" text="Type 'AutoboxingI' (AutoboxingI.java:13) advised by before advice from 'AspectInteger' (AspectInteger.aj:4)"/>
- <message kind="weave" text="Type 'AutoboxingI' (AutoboxingI.java:14) advised by before advice from 'AspectInteger' (AspectInteger.aj:8)"/>
- <message kind="weave" text="Type 'AutoboxingI' (AutoboxingI.java:14) advised by before advice from 'AspectInteger' (AspectInteger.aj:4)"/>
- </compile>
- <run class="AutoboxingI">
- <stderr>
- <line text="Matching by Integer:10000"/>
- <line text="Matching by int:10000"/>
- <line text="method_takes_Integer=10000"/>
- <line text="Matching by Integer:20000"/>
- <line text="Matching by int:20000"/>
- <line text="method_takes_Integer=20000"/>
- <line text="Matching by Integer:30000"/>
- <line text="Matching by int:30000"/>
- <line text="method_takes_int=30000"/>
- <line text="Matching by Integer:40000"/>
- <line text="Matching by int:40000"/>
- <line text="method_takes_int=40000"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="java5/autoboxing" vm="1.5" title="char boxing">
- <compile files="AutoboxingB.java,AutoboxingC.java,AutoboxingD.java,AutoboxingF.java,AutoboxingI.java,AutoboxingJ.java,AutoboxingS.java,AutoboxingZ.java,SimpleAutoboxing.java,AspectChar.aj"
- options="-1.5,-showWeaveInfo">
- <message kind="weave" text="Type 'AutoboxingC' (AutoboxingC.java:11) advised by before advice from 'AspectChar' (AspectChar.aj:8)"/>
- <message kind="weave" text="Type 'AutoboxingC' (AutoboxingC.java:11) advised by before advice from 'AspectChar' (AspectChar.aj:4)"/>
- <message kind="weave" text="Type 'AutoboxingC' (AutoboxingC.java:12) advised by before advice from 'AspectChar' (AspectChar.aj:8)"/>
- <message kind="weave" text="Type 'AutoboxingC' (AutoboxingC.java:12) advised by before advice from 'AspectChar' (AspectChar.aj:4)"/>
- <message kind="weave" text="Type 'AutoboxingC' (AutoboxingC.java:13) advised by before advice from 'AspectChar' (AspectChar.aj:8)"/>
- <message kind="weave" text="Type 'AutoboxingC' (AutoboxingC.java:13) advised by before advice from 'AspectChar' (AspectChar.aj:4)"/>
- <message kind="weave" text="Type 'AutoboxingC' (AutoboxingC.java:14) advised by before advice from 'AspectChar' (AspectChar.aj:8)"/>
- <message kind="weave" text="Type 'AutoboxingC' (AutoboxingC.java:14) advised by before advice from 'AspectChar' (AspectChar.aj:4)"/>
- </compile>
- <run class="AutoboxingC">
- <stderr>
- <line text="Character:1"/>
- <line text="char:1"/>
- <line text="method_takes_Character=1"/>
- <line text="Character:2"/>
- <line text="char:2"/>
- <line text="method_takes_Character=2"/>
- <line text="Character:3"/>
- <line text="char:3"/>
- <line text="method_takes_char=3"/>
- <line text="Character:4"/>
- <line text="char:4"/>
- <line text="method_takes_char=4"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="java5/autoboxing" vm="1.5" title="double boxing">
- <compile files="AutoboxingB.java,AutoboxingC.java,AutoboxingD.java,AutoboxingF.java,AutoboxingI.java,AutoboxingJ.java,AutoboxingS.java,AutoboxingZ.java,SimpleAutoboxing.java,AspectDouble.aj"
- options="-1.5,-showWeaveInfo">
- <message kind="weave" text="Type 'AutoboxingD' (AutoboxingD.java:11) advised by before advice from 'AspectDouble' (AspectDouble.aj:8)"/>
- <message kind="weave" text="Type 'AutoboxingD' (AutoboxingD.java:11) advised by before advice from 'AspectDouble' (AspectDouble.aj:4)"/>
- <message kind="weave" text="Type 'AutoboxingD' (AutoboxingD.java:12) advised by before advice from 'AspectDouble' (AspectDouble.aj:8)"/>
- <message kind="weave" text="Type 'AutoboxingD' (AutoboxingD.java:12) advised by before advice from 'AspectDouble' (AspectDouble.aj:4)"/>
- <message kind="weave" text="Type 'AutoboxingD' (AutoboxingD.java:13) advised by before advice from 'AspectDouble' (AspectDouble.aj:8)"/>
- <message kind="weave" text="Type 'AutoboxingD' (AutoboxingD.java:13) advised by before advice from 'AspectDouble' (AspectDouble.aj:4)"/>
- <message kind="weave" text="Type 'AutoboxingD' (AutoboxingD.java:14) advised by before advice from 'AspectDouble' (AspectDouble.aj:8)"/>
- <message kind="weave" text="Type 'AutoboxingD' (AutoboxingD.java:14) advised by before advice from 'AspectDouble' (AspectDouble.aj:4)"/>
- </compile>
- <run class="AutoboxingD">
- <stderr>
- <line text="Double:100.0"/>
- <line text="double:100.0"/>
- <line text="method_takes_Double=100.0"/>
- <line text="Double:200.0"/>
- <line text="double:200.0"/>
- <line text="method_takes_Double=200.0"/>
- <line text="Double:300.0"/>
- <line text="double:300.0"/>
- <line text="method_takes_double=300.0"/>
- <line text="Double:400.0"/>
- <line text="double:400.0"/>
- <line text="method_takes_double=400.0"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="java5/autoboxing" vm="1.5" title="float boxing">
- <compile files="AutoboxingB.java,AutoboxingC.java,AutoboxingD.java,AutoboxingF.java,AutoboxingI.java,AutoboxingJ.java,AutoboxingS.java,AutoboxingZ.java,SimpleAutoboxing.java,AspectFloat.aj"
- options="-1.5,-showWeaveInfo">
- <message kind="weave" text="Type 'AutoboxingF' (AutoboxingF.java:11) advised by before advice from 'AspectFloat' (AspectFloat.aj:8)"/>
- <message kind="weave" text="Type 'AutoboxingF' (AutoboxingF.java:11) advised by before advice from 'AspectFloat' (AspectFloat.aj:4)"/>
- <message kind="weave" text="Type 'AutoboxingF' (AutoboxingF.java:12) advised by before advice from 'AspectFloat' (AspectFloat.aj:8)"/>
- <message kind="weave" text="Type 'AutoboxingF' (AutoboxingF.java:12) advised by before advice from 'AspectFloat' (AspectFloat.aj:4)"/>
- <message kind="weave" text="Type 'AutoboxingF' (AutoboxingF.java:13) advised by before advice from 'AspectFloat' (AspectFloat.aj:8)"/>
- <message kind="weave" text="Type 'AutoboxingF' (AutoboxingF.java:13) advised by before advice from 'AspectFloat' (AspectFloat.aj:4)"/>
- <message kind="weave" text="Type 'AutoboxingF' (AutoboxingF.java:14) advised by before advice from 'AspectFloat' (AspectFloat.aj:8)"/>
- <message kind="weave" text="Type 'AutoboxingF' (AutoboxingF.java:14) advised by before advice from 'AspectFloat' (AspectFloat.aj:4)"/>
- </compile>
- <run class="AutoboxingF">
- <stderr>
- <line text="Float:100.0"/>
- <line text="float:100.0"/>
- <line text="method_takes_Float=100.0"/>
- <line text="Float:200.0"/>
- <line text="float:200.0"/>
- <line text="method_takes_Float=200.0"/>
- <line text="Float:300.0"/>
- <line text="float:300.0"/>
- <line text="method_takes_float=300.0"/>
- <line text="Float:400.0"/>
- <line text="float:400.0"/>
- <line text="method_takes_float=400.0"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="java5/autoboxing" vm="1.5" title="short boxing">
- <compile files="AutoboxingB.java,AutoboxingC.java,AutoboxingD.java,AutoboxingF.java,AutoboxingI.java,AutoboxingJ.java,AutoboxingS.java,AutoboxingZ.java,SimpleAutoboxing.java,AspectShort.aj"
- options="-1.5,-showWeaveInfo">
- <message kind="weave" text="Type 'AutoboxingS' (AutoboxingS.java:11) advised by before advice from 'AspectShort' (AspectShort.aj:8)"/>
- <message kind="weave" text="Type 'AutoboxingS' (AutoboxingS.java:11) advised by before advice from 'AspectShort' (AspectShort.aj:4)"/>
- <message kind="weave" text="Type 'AutoboxingS' (AutoboxingS.java:12) advised by before advice from 'AspectShort' (AspectShort.aj:8)"/>
- <message kind="weave" text="Type 'AutoboxingS' (AutoboxingS.java:12) advised by before advice from 'AspectShort' (AspectShort.aj:4)"/>
- <message kind="weave" text="Type 'AutoboxingS' (AutoboxingS.java:13) advised by before advice from 'AspectShort' (AspectShort.aj:8)"/>
- <message kind="weave" text="Type 'AutoboxingS' (AutoboxingS.java:13) advised by before advice from 'AspectShort' (AspectShort.aj:4)"/>
- <message kind="weave" text="Type 'AutoboxingS' (AutoboxingS.java:14) advised by before advice from 'AspectShort' (AspectShort.aj:8)"/>
- <message kind="weave" text="Type 'AutoboxingS' (AutoboxingS.java:14) advised by before advice from 'AspectShort' (AspectShort.aj:4)"/>
- </compile>
- <run class="AutoboxingS">
- <stderr>
- <line text="Short:100"/>
- <line text="short:100"/>
- <line text="method_takes_Short=100"/>
- <line text="Short:200"/>
- <line text="short:200"/>
- <line text="method_takes_Short=200"/>
- <line text="Short:300"/>
- <line text="short:300"/>
- <line text="method_takes_short=300"/>
- <line text="Short:400"/>
- <line text="short:400"/>
- <line text="method_takes_short=400"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="java5/autoboxing" vm="1.5" title="long boxing">
- <compile files="AutoboxingB.java,AutoboxingC.java,AutoboxingD.java,AutoboxingF.java,AutoboxingI.java,AutoboxingJ.java,AutoboxingS.java,AutoboxingZ.java,SimpleAutoboxing.java,AspectLong.aj"
- options="-1.5,-showWeaveInfo">
- <message kind="weave" text="Type 'AutoboxingJ' (AutoboxingJ.java:11) advised by before advice from 'AspectLong' (AspectLong.aj:8)"/>
- <message kind="weave" text="Type 'AutoboxingJ' (AutoboxingJ.java:11) advised by before advice from 'AspectLong' (AspectLong.aj:4)"/>
- <message kind="weave" text="Type 'AutoboxingJ' (AutoboxingJ.java:12) advised by before advice from 'AspectLong' (AspectLong.aj:8)"/>
- <message kind="weave" text="Type 'AutoboxingJ' (AutoboxingJ.java:12) advised by before advice from 'AspectLong' (AspectLong.aj:4)"/>
- <message kind="weave" text="Type 'AutoboxingJ' (AutoboxingJ.java:13) advised by before advice from 'AspectLong' (AspectLong.aj:8)"/>
- <message kind="weave" text="Type 'AutoboxingJ' (AutoboxingJ.java:13) advised by before advice from 'AspectLong' (AspectLong.aj:4)"/>
- <message kind="weave" text="Type 'AutoboxingJ' (AutoboxingJ.java:14) advised by before advice from 'AspectLong' (AspectLong.aj:8)"/>
- <message kind="weave" text="Type 'AutoboxingJ' (AutoboxingJ.java:14) advised by before advice from 'AspectLong' (AspectLong.aj:4)"/>
- </compile>
- <run class="AutoboxingJ">
- <stderr>
- <line text="Long:1000000"/>
- <line text="long:1000000"/>
- <line text="method_takes_Long=1000000"/>
- <line text="Long:2000000"/>
- <line text="long:2000000"/>
- <line text="method_takes_Long=2000000"/>
- <line text="Long:3000000"/>
- <line text="long:3000000"/>
- <line text="method_takes_long=3000000"/>
- <line text="Long:4000000"/>
- <line text="long:4000000"/>
- <line text="method_takes_long=4000000"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="java5/autoboxing" vm="1.5" title="boolean boxing">
- <compile files="AutoboxingB.java,AutoboxingC.java,AutoboxingD.java,AutoboxingF.java,AutoboxingI.java,AutoboxingJ.java,AutoboxingS.java,AutoboxingZ.java,SimpleAutoboxing.java,AspectBoolean.aj"
- options="-1.5,-showWeaveInfo">
- <message kind="weave" text="Type 'AutoboxingZ' (AutoboxingZ.java:9) advised by before advice from 'AspectBoolean' (AspectBoolean.aj:8)"/>
- <message kind="weave" text="Type 'AutoboxingZ' (AutoboxingZ.java:9) advised by before advice from 'AspectBoolean' (AspectBoolean.aj:4)"/>
- <message kind="weave" text="Type 'AutoboxingZ' (AutoboxingZ.java:10) advised by before advice from 'AspectBoolean' (AspectBoolean.aj:8)"/>
- <message kind="weave" text="Type 'AutoboxingZ' (AutoboxingZ.java:10) advised by before advice from 'AspectBoolean' (AspectBoolean.aj:4)"/>
- <message kind="weave" text="Type 'AutoboxingZ' (AutoboxingZ.java:11) advised by before advice from 'AspectBoolean' (AspectBoolean.aj:8)"/>
- <message kind="weave" text="Type 'AutoboxingZ' (AutoboxingZ.java:11) advised by before advice from 'AspectBoolean' (AspectBoolean.aj:4)"/>
- <message kind="weave" text="Type 'AutoboxingZ' (AutoboxingZ.java:12) advised by before advice from 'AspectBoolean' (AspectBoolean.aj:8)"/>
- <message kind="weave" text="Type 'AutoboxingZ' (AutoboxingZ.java:12) advised by before advice from 'AspectBoolean' (AspectBoolean.aj:4)"/>
- </compile>
- <run class="AutoboxingZ">
- <stderr>
- <line text="Boolean:false"/>
- <line text="boolean:false"/>
- <line text="method_takes_Boolean=false"/>
- <line text="Boolean:false"/>
- <line text="boolean:false"/>
- <line text="method_takes_Boolean=false"/>
- <line text="Boolean:false"/>
- <line text="boolean:false"/>
- <line text="method_takes_boolean=false"/>
- <line text="Boolean:false"/>
- <line text="boolean:false"/>
- <line text="method_takes_boolean=false"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="java5/autoboxing" vm="1.5" title="byte boxing">
- <compile files="AutoboxingB.java,AutoboxingC.java,AutoboxingD.java,AutoboxingF.java,AutoboxingI.java,AutoboxingJ.java,AutoboxingS.java,AutoboxingZ.java,SimpleAutoboxing.java,AspectByte.aj"
- options="-1.5,-showWeaveInfo">
- <message kind="weave" text="Type 'AutoboxingB' (AutoboxingB.java:11) advised by before advice from 'AspectByte' (AspectByte.aj:8)"/>
- <message kind="weave" text="Type 'AutoboxingB' (AutoboxingB.java:11) advised by before advice from 'AspectByte' (AspectByte.aj:4)"/>
- <message kind="weave" text="Type 'AutoboxingB' (AutoboxingB.java:12) advised by before advice from 'AspectByte' (AspectByte.aj:8)"/>
- <message kind="weave" text="Type 'AutoboxingB' (AutoboxingB.java:12) advised by before advice from 'AspectByte' (AspectByte.aj:4)"/>
- <message kind="weave" text="Type 'AutoboxingB' (AutoboxingB.java:13) advised by before advice from 'AspectByte' (AspectByte.aj:8)"/>
- <message kind="weave" text="Type 'AutoboxingB' (AutoboxingB.java:13) advised by before advice from 'AspectByte' (AspectByte.aj:4)"/>
- <message kind="weave" text="Type 'AutoboxingB' (AutoboxingB.java:14) advised by before advice from 'AspectByte' (AspectByte.aj:8)"/>
- <message kind="weave" text="Type 'AutoboxingB' (AutoboxingB.java:14) advised by before advice from 'AspectByte' (AspectByte.aj:4)"/>
- </compile>
- <run class="AutoboxingB">
- <stderr>
- <line text="Byte:1"/>
- <line text="byte:1"/>
- <line text="method_takes_Byte=1"/>
- <line text="Byte:50"/>
- <line text="byte:50"/>
- <line text="method_takes_Byte=50"/>
- <line text="Byte:3"/>
- <line text="byte:3"/>
- <line text="method_takes_byte=3"/>
- <line text="Byte:52"/>
- <line text="byte:52"/>
- <line text="method_takes_byte=52"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="java5/autoboxing" vm="1.5" title="boxing in after returning">
- <compile files="AutoboxingB.java,AutoboxingC.java,AutoboxingD.java,AutoboxingF.java,AutoboxingI.java,AutoboxingJ.java,AutoboxingS.java,AutoboxingZ.java,SimpleAutoboxing.java,AspectAfterReturning.aj"
- options="-1.5,-showWeaveInfo">
- <message kind="weave" text="Type 'AspectAfterReturning' (AspectAfterReturning.aj:18) advised by afterReturning advice from 'AspectAfterReturning' (AspectAfterReturning.aj:4)"/>
- <message kind="weave" text="Type 'AspectAfterReturning' (AspectAfterReturning.aj:18) advised by afterReturning advice from 'AspectAfterReturning' (AspectAfterReturning.aj:8)"/>
- <message kind="weave" text="Type 'AspectAfterReturning' (AspectAfterReturning.aj:18) advised by afterReturning advice from 'AspectAfterReturning' (AspectAfterReturning.aj:12)"/>
- <message kind="weave" text="Type 'AspectAfterReturning' (AspectAfterReturning.aj:19) advised by afterReturning advice from 'AspectAfterReturning' (AspectAfterReturning.aj:4)"/>
- <message kind="weave" text="Type 'AspectAfterReturning' (AspectAfterReturning.aj:19) advised by afterReturning advice from 'AspectAfterReturning' (AspectAfterReturning.aj:8)"/>
- <message kind="weave" text="Type 'AspectAfterReturning' (AspectAfterReturning.aj:19) advised by afterReturning advice from 'AspectAfterReturning' (AspectAfterReturning.aj:12)"/>
- </compile>
- <run class="AspectAfterReturning">
- <stderr>
- <line text="Returning I=5"/>
- <line text="Returning Integer=5"/>
- <line text="Returning Object=5"/>
- <line text="Returning I=10"/>
- <line text="Returning Integer=10"/>
- <line text="Returning Object=10"/>
- </stderr>
- </run>
- </ajc-test>
-
- <!-- ======================================================================================= -->
- <!-- Covariance tests -->
- <!-- ======================================================================================= -->
-
- <ajc-test dir="java5/covariance" vm="1.5" title="covariance 1">
- <compile options="-1.5,-showWeaveInfo" files="CovBaseProgram01.java,CovAspect01.aj">
- <message kind="weave" text="Type 'CovBaseProgram01' (CovBaseProgram01.java:26) advised by before advice from 'CovAspect01' (CovAspect01.aj:5)"/>
- <message kind="weave" text="Type 'CovBaseProgram01' (CovBaseProgram01.java:27) advised by before advice from 'CovAspect01' (CovAspect01.aj:5)"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/covariance" vm="1.5" title="covariance 2">
- <compile options="-1.5,-showWeaveInfo" files="CovBaseProgram01.java,CovAspect02.aj">
- <message kind="weave" text="Type 'CovBaseProgram01' (CovBaseProgram01.java:26) advised by before advice from 'CovAspect02' (CovAspect02.aj:5)"/>
- <message kind="weave" text="Type 'CovBaseProgram01' (CovBaseProgram01.java:27) advised by before advice from 'CovAspect02' (CovAspect02.aj:5)"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/covariance" vm="1.5" title="covariance 3">
- <compile options="-1.5,-showWeaveInfo" files="CovBaseProgram01.java,CovAspect03.aj">
- <message kind="weave" text="Type 'CovBaseProgram01' (CovBaseProgram01.java:26) advised by before advice from 'CovAspect03' (CovAspect03.aj:5)"/>
- <message kind="weave" text="Type 'CovBaseProgram01' (CovBaseProgram01.java:27) advised by before advice from 'CovAspect03' (CovAspect03.aj:5)"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/covariance" vm="1.5" title="covariance 4">
- <compile options="-1.5,-showWeaveInfo" files="CovBaseProgram02.java,CovAspect04.aj">
- <message kind="weave" text="Type 'CovBaseProgram02' (CovBaseProgram02.java:30) advised by before advice from 'CovAspect04' (CovAspect04.aj:5)"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/covariance" vm="1.5" title="covariance 5">
- <compile options="-1.5,-showWeaveInfo" files="CovBaseProgram01.java,CovAspect05.aj">
- <message kind="weave" text="Type 'CovBaseProgram01' (CovBaseProgram01.java:26) advised by before advice from 'CovAspect05' (CovAspect05.aj:5)"/>
- <message kind="weave" text="Type 'CovBaseProgram01' (CovBaseProgram01.java:27) advised by before advice from 'CovAspect05' (CovAspect05.aj:5)"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/covariance" vm="1.5" title="covariance 6">
- <compile options="-1.5,-showWeaveInfo" files="CovBaseProgram01.java,CovAspect06.aj">
- <message kind="warning" line="3" text="does not match because declaring type is Super"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/covariance" vm="1.5" title="covariance 7">
- <compile options="-1.5,-showWeaveInfo" files="CovBaseProgram01.java,CovAspect07.aj">
- <message kind="weave" text="Type 'CovBaseProgram01' (CovBaseProgram01.java:27) advised by before advice from 'CovAspect07' (CovAspect07.aj:5)"/>
- <message kind="warning" line="3" text="does not match because declaring type is Super"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/covariance" vm="1.5" title="covariance 8">
- <compile options="-1.5,-showWeaveInfo" files="CovBaseProgram01.java,CovAspect08.aj">
- <message kind="weave" text="Type 'CovBaseProgram01' (CovBaseProgram01.java:27) advised by before advice from 'CovAspect08' (CovAspect08.aj:11)"/>
- <message kind="weave" text="Type 'CovBaseProgram01' (CovBaseProgram01.java:27) advised by before advice from 'CovAspect08' (CovAspect08.aj:5)"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/covariance" vm="1.5" title="covariance 9">
- <compile options="-1.5,-showWeaveInfo" files="CovBaseProgram01.java,CovAspect09.aj">
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/covariance" vm="1.5" title="covariance 10">
- <compile options="-1.5,-showWeaveInfo" files="CovBaseProgram01.java,CovAspect10.aj">
- <message kind="weave" text="Type 'CovBaseProgram01' (CovBaseProgram01.java:26) advised by before advice from 'CovAspect10' (CovAspect10.aj:5)"/>
- <message kind="weave" text="Type 'CovBaseProgram01' (CovBaseProgram01.java:27) advised by before advice from 'CovAspect10' (CovAspect10.aj:5)"/>
- </compile>
- </ajc-test>
-
- <!-- ======================================================================================= -->
- <!-- Enum tests -->
- <!-- ======================================================================================= -->
-
- <ajc-test dir="java5/enums" vm="1.5" title="cant itd constructor on enum">
- <compile files="SimpleEnum.java,SimpleEnum2.java,EnumAspect01.aj" options="-1.5">
- <message kind="error" line="2" text="can't make inter-type constructor declarations on enum types"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/enums" vm="1.5" title="cant itd field or method on enum">
- <compile files="SimpleEnum.java,SimpleEnum2.java,EnumAspect02.aj" options="-1.5">
- <message kind="error" line="2" text="can't make inter-type method declarations on enum types"/>
- <message kind="error" line="6" text="can't make inter-type field declarations on enum types"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/enums" vm="1.5" title="declare parents and enums">
- <compile files="SimpleEnum.java,SimpleEnum2.java,EnumAspect03.aj" options="-1.5">
- <message kind="error" line="5" text="can't use declare parents to make enum type SimpleEnum implement an interface"/>
- <message kind="error" line="8" text="can't use declare parents to alter supertype of enum type SimpleEnum"/>
- <message kind="error" line="11" text="can't use declare parents to make 'java.lang.Enum' the parent of type EnumAspect03$D"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/enums" vm="1.5" title="wildcard enum match in itd">
- <compile files="SimpleEnum.java,SimpleEnum2.java,EnumAspect04.aj" options="-1.5">
- <message kind="warning" line="5" text="enum type SimpleEnum2 matches a declare parents type pattern but is being ignored"/>
- <message kind="warning" line="5" text="enum type SimpleEnum matches a declare parents type pattern but is being ignored"/>
- </compile>
- </ajc-test>
-
- <!-- ======================================================================================= -->
- <!-- pertypewithin tests -->
- <!-- ======================================================================================= -->
-
- <ajc-test dir="java5/pertypewithin" title="basic ptw test">
- <compile files="A.java,B.java,C.java,D.java,Main.java,X.java"/>
- <run class="p.A">
- <stderr>
- <line text="hi from A"/>
- <line text="after() returning from a method call to sayhi()"/>
- <line text="hi from A"/>
- <line text="after() returning from a method call to sayhi()"/>
- <line text="Tests in A have passed"/>
- <line text="callcount = 2"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="java5/pertypewithin" title="ptw hasAspect">
- <compile files="A.java,B.java,C.java,D.java,Main.java,X.java"/>
- <run class="p.B">
- <stderr>
- <line text="hi from B"/>
- <line text="after() returning from a method call to sayhi()"/>
- <line text="hi from B"/>
- <line text="after() returning from a method call to sayhi()"/>
- <line text="hi from B"/>
- <line text="after() returning from a method call to sayhi()"/>
- <line text="callcount = 3"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="java5/pertypewithin" title="ptw aspectOf">
- <compile files="A.java,B.java,C.java,D.java,Main.java,X.java"/>
- <run class="p.C"/>
- </ajc-test>
-
- <ajc-test dir="java5/pertypewithin" title="ptw multi-aspects">
- <compile files="P.java,Q.java,R.java"/>
- <run class="P">
- <stderr>
- <line text="Q reporting 2"/>
- <line text="R reporting 3"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="java5/pertypewithin" title="ptw binary">
- <weave classesFiles="G.java" aspectsFiles="H.java"/>
- <run class="G">
- <stderr>
- <line text="advice running"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="java5/pertypewithin" title="ptw binary aspect">
- <compile files="H.java" outjar="aspects.jar">
- <message kind="warning" line="1" text="no match for this type name: G"/>
- </compile>
- <compile files="G.java" aspectpath="aspects.jar"/>
- <run class="G">
- <stderr>
- <line text="advice running"/>
- </stderr>
- </run>
- </ajc-test>
-
- <!-- ======================================================================================= -->
- <!-- varargs tests -->
- <!-- ======================================================================================= -->
-
- <ajc-test dir="java5/varargs" vm="1.5" title="varargs not matched by Object[] (call)">
- <compile files="SimpleVarargs.java,VarargsAspect01.aj" options="-1.5,-showWeaveInfo">
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/varargs" vm="1.5" title="varargs not matched by Object[] (exe)">
- <compile files="SimpleVarargs.java,VarargsAspect02.aj" options="-1.5,-showWeaveInfo">
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/varargs" vm="1.5" title="varargs not matched by Object[] (init)">
- <compile files="SimpleVarargs.java,VarargsAspect03.aj" options="-1.5,-showWeaveInfo">
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/varargs" vm="1.5" title="varargs not matched by Object[] (withincode)">
- <compile files="SimpleVarargs.java,VarargsAspect04.aj" options="-1.5,-showWeaveInfo">
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/varargs" vm="1.5" title="call with varargs signature">
- <compile files="SimpleVarargs.java,VarargsAspect05.aj" options="-1.5,-showWeaveInfo">
- <message kind="weave" text="Type 'SimpleVarargs' (SimpleVarargs.java:20) advised by before advice from 'VarargsAspect05' (VarargsAspect05.aj:3)"/>
- <message kind="weave" text="Type 'SimpleVarargs' (SimpleVarargs.java:21) advised by before advice from 'VarargsAspect05' (VarargsAspect05.aj:3)"/>
- <message kind="weave" text="Type 'SimpleVarargs' (SimpleVarargs.java:22) advised by before advice from 'VarargsAspect05' (VarargsAspect05.aj:3)"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/varargs" vm="1.5" title="call with varargs multi-signature">
- <compile files="SimpleVarargs.java,VarargsAspect06.aj" options="-1.5,-showWeaveInfo">
- <message kind="weave" text="Type 'SimpleVarargs' (SimpleVarargs.java:25) advised by before advice from 'VarargsAspect06' (VarargsAspect06.aj:3)"/>
- <message kind="weave" text="Type 'SimpleVarargs' (SimpleVarargs.java:26) advised by before advice from 'VarargsAspect06' (VarargsAspect06.aj:3)"/>
- <message kind="weave" text="Type 'SimpleVarargs' (SimpleVarargs.java:27) advised by before advice from 'VarargsAspect06' (VarargsAspect06.aj:3)"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/suppressedWarnings" vm="1.5" title="suppressing non-matching advice warnings">
- <compile files="Suppression1.aj" options="-1.5,-showWeaveInfo">
- <message kind="warning" line="13"/>
- <message kind="warning" line="21"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/suppressedWarnings" vm="1.5" title="suppressing non-matching advice warnings when multiple source files involved">
- <compile files="A.java,A1.aj,A2.aj,A3.aj" options="-1.5,-showWeaveInfo">
- <message kind="warning" line="4" file="A1.aj"/>
- <message kind="warning" line="4" file="A2.aj"/>
- <message kind="warning" line="11" file="A2.aj"/>
- <message kind="warning" line="4" file="A3.aj"/>
- <message kind="warning" line="11" file="A3.aj"/>
- </compile>
- </ajc-test>
-
- <!-- ======================================================================================= -->
- <!-- annotated aspect members -->
- <!-- ======================================================================================= -->
-
- <ajc-test dir="java5/annotations/aspectMembers" title="annotated annotations (@Target)">
- <compile files="a/Annotations.java,a/Foo.java" options="-1.5">
- <message kind="error" line="16" text="The annotation @MethodAnnotation is disallowed for this location"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/aspectMembers" title="simple annotated aspect members">
- <compile files="a/Annotations.java,a/AnnotatedAspect.aj" options="-1.5">
- <message kind="warning" line="4" text="annotated type"/>
- <message kind="warning" line="6" text="annotated field"/>
- <message kind="warning" line="8" text="annotated method"/>
- <message kind="warning" line="11" text="annotated constructor"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/aspectMembers" title="simple annotated aspect members with bad target">
- <compile files="a/Annotations.java,a/AnnotatedAspect02.aj" options="-1.5">
- <message kind="error" line="3" text="The annotation @MethodAnnotation is disallowed for this location"/>
- <message kind="error" line="6" text="The annotation @TypeAnnotation is disallowed for this location"/>
- <message kind="error" line="8" text="The annotation @FieldAnnotation is disallowed for this location"/>
- <message kind="error" line="10" text="The annotation @AnnotationAnnotation is disallowed for this location"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/aspectMembers" title="annotated itds">
- <compile files="a/Annotations.java,a/AnnotatedAspect03.aj" options="-1.5">
- <message kind="warning" line="4" text="annotated type"/>
- <message kind="warning" line="6" text="annotated field"/>
- <message kind="warning" line="8" text="annotated field"/>
- <message kind="warning" line="10" text="annotated method"/>
- <message kind="warning" line="12" text="annotated constructor"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/aspectMembers" title="annotated itds with bad target">
- <compile files="a/Annotations.java,a/AnnotatedAspect04.aj" options="-1.5">
- <message kind="error" line="6" text="The annotation @ConstructorAnnotation is disallowed for this location"/>
- <message kind="error" line="8" text="The annotation @FieldAnnotation is disallowed for this location"/>
- <message kind="error" line="10" text="The annotation @TypeAnnotation is disallowed for this location"/>
- <!-- known limitation...
- <message kind="error" line="12" text="The annotation @MethodAnnotation is disallowed for this location"/>
- -->
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/aspectMembers" title="annotated advice">
- <compile files="a/Annotations.java,a/AnnotatedAspect05.aj" options="-1.5">
- <message kind="warning" line="17"/>
- </compile>
- <run class="a.AnnotatedAspect05"/>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/aspectMembers" title="annotated advice with bad target">
- <compile files="a/Annotations.java,a/AnnotatedAspect06.aj" options="-1.5">
- <message kind="error" line="6" text="The annotation @ConstructorAnnotation is disallowed for this location"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/aspectMembers" title="annotated pointcut">
- <compile files="a/Annotations.java,a/AnnotatedAspect07.aj" options="-1.5">
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/aspectMembers" title="annotated declare statements">
- <compile files="a/Annotations.java,a/AnnotatedAspect08.aj" options="-1.5">
- </compile>
- </ajc-test>
-
- <!-- ======================================================================================= -->
- <!-- ajdk examples -->
- <!-- ======================================================================================= -->
- <ajc-test dir="java5/annotations/ajdkExamples" title="ajdk: annotating aspects chapter">
- <compile files="AnnotatingAspects.aj" options="-1.5">
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/ajdkExamples" title="ajdk: annotating aspects chapter, ex 2">
- <compile files="SuppressAj.aj" options="-1.5">
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/ajdkExamples" title="ajdk: annotation pattern matching">
- <compile files="AnnotationPatternMatching.aj,org/xyz/OrgXYZAnnotation.java" options="-1.5">
- <message kind="warning" line="25" text="@Immutable"/>
- <message kind="warning" line="25" text="!@Persistent"/>
- <message kind="warning" line="29" text="!@Persistent"/>
- <message kind="warning" line="31" text="!@Persistent"/>
- <message kind="warning" line="33" text="!@Persistent"/>
- <message kind="warning" line="29" text="@Foo @Goo"/>
- <message kind="warning" line="29" text="@(Foo || Goo)"/>
- <message kind="warning" line="31" text="@(Foo || Goo)"/>
- <message kind="warning" line="33" text="@(org.xyz..*)"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/ajdkExamples" title="ajdk: annotation type pattern matching">
- <compile files="AnnotationsInTypePatterns.aj,org/xyz/OrgXYZAnnotation.java,org/xyz/Types.java,org/abc/Types.java,anns/Immutable.java,anns/NonPersistent.java" options="-1.5">
- <message kind="warning" line="23" text="(@Immutable *)"/>
- <message kind="warning" line="32" text="(@Immutable *)"/>
- <message kind="warning" line="3" text="(@Immutable *)"/>
- <message kind="warning" line="5" text="(@Immutable *)"/>
- <message kind="warning" line="8" text="(@Immutable *)"/>
- <message kind="warning" line="25" text="(!@Immutable *)"/>
- <message kind="warning" line="27" text="(!@Immutable *)"/>
- <message kind="warning" line="29" text="(!@Immutable *)"/>
- <message kind="warning" line="5" text="(!@Immutable *)"/>
- <message kind="warning" line="6" text="(!@Immutable *)"/>
- <message kind="warning" line="2" text="(!@Immutable *)"/>
- <message kind="warning" line="2" text="(!@Immutable *)"/>
- <message kind="warning" line="5" text="(!@Immutable *)"/>
- <message kind="warning" line="3" text="@Immutable (org.xyz.* || org.abc.*)"/>
- <message kind="warning" line="5" text="@Immutable (org.xyz.* || org.abc.*)"/>
- <message kind="warning" line="8" text="@Immutable (org.xyz.* || org.abc.*)"/>
- <message kind="warning" line="32" text="((@Immutable Foo+) || Goo)"/>
- <message kind="warning" line="27" text="((@Immutable Foo+) || Goo)"/>
- <message kind="warning" line="3" text="@(Immutable || NonPersistent) org.xyz..*"/>
- <message kind="warning" line="6" text="@(Immutable || NonPersistent) org.xyz..*"/>
- <message kind="warning" line="8" text="@(Immutable || NonPersistent) org.xyz..*"/>
- <message kind="warning" line="8" text="@Immutable @NonPersistent org.xyz..*"/>
- <message kind="warning" line="6" text="@(@Inherited *) org.xyz..*"/>
- <message kind="warning" line="8" text="@(@Inherited *) org.xyz..*"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/ajdkExamples" title="ajdk: annotations in sig patterns">
- <compile files="AnnotationsInSignaturePatterns.aj,anns/Cachable.java,anns/SensitiveData.java,anns/Persisted.java,Classified.java,anns/Immutable.java,Secure.java,Catastrophic.java,Oneway.java,anns/Transaction.java,org/xyz/SignatureTypes.java" options="-1.5">
- <message kind="warning" line="32" text="@SensitiveData * *"/>
- <message kind="warning" line="7" text="@SensitiveData * *"/>
- <message kind="warning" line="13" text="@SensitiveData * *"/>
- <message kind="warning" line="7" text="@SensitiveData List org.xyz..*.*"/>
- <message kind="warning" line="11" text="(@SensitiveData *) org.xyz..*.*"/>
- <message kind="warning" line="13" text="(@SensitiveData *) org.xyz..*.*"/>
- <message kind="warning" line="50" text="@Foo (@Goo *) (@Hoo *).*"/>
- <message kind="warning" line="38" text="@Persisted @Classified * *"/>
-
- <message kind="warning" line="44" text="@Oneway * *(..)"/>
- <message kind="warning" line="18" text="@Transaction * (@Persisted org.xyz..*).*(..)"/>
- <message kind="warning" line="52" text="* *.*(@Immutable *,..)"/>
- <message kind="warning" line="53" text="* *.*(@Immutable *,..)"/>
- <message kind="warning" line="54" text="* *.*(@Immutable *,..)"/>
-
- <message kind="warning" line="62" text="within(@Secure *)"/>
- <message kind="warning" line="63" text="within(@Secure *)"/>
- <message kind="warning" line="66" text="staticinitialization(@Persisted *)"/>
- <message kind="warning" line="17" text="staticinitialization(@Persisted *)"/>
- <message kind="warning" line="56" text="call(@Oneway * *(..))"/>
- <message kind="warning" line="28" text="execution(public (@Immutable *) org.xyz..*.*(..))"/>
- <message kind="warning" line="26" text="set(@Cachable * *)"/>
- <message kind="warning" line="80" text="handler(!@Catastrophic *)"/>
-
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/ajdkExamples" title="ajdk: runtime annotations">
- <compile files="RuntimeTypeMatching.aj" options="-1.5">
- <message kind="warning" line="121" text="@within(Foo)"/>
- <message kind="warning" line="122" text="@within(Foo)"/>
- </compile>
- <run class="RuntimeTypeMatching">
- <stdout>
- <line text="This information is TOP-SECRET"/>
- <line text="@target(Classified) at call(void A.a())"/>
- <line text="@this(Foo) at execution(void B.b())"/>
- <line text="Classified data being passed at call(void B.callA(A))"/>
- <line text="Classified data being passed at execution(void B.callA(A))"/>
- <line text="This information is TOP-SECRET"/>
- <line text="@target(Classified) at call(Class java.lang.Object.getClass())"/>
- <line text="1 @Foo()"/>
- <line text="1 @Foo()"/>
- <line text="1 @Classified(classification=TOP-SECRET)"/>
- <line text="This information is TOP-SECRET"/>
- <line text="Entering critical join point with priority 3"/>
- <line text="Entering critical join point with reflectively obtained priority 3"/>
- <line text="@target(Classified) at call(void A.a())"/>
- <line text="@this(Foo) at execution(void B.callA(A))"/>
- <line text="(Class) Transaction required at execution(void ByeByeEJB.method1())"/>
- <line text="(Method) Transaction required at execution(void ByeByeEJB.method1())"/>
- <line text="(Class) Transaction required at execution(void ByeByeEJB.method2())"/>
- <line text="(Method) Transaction required at execution(void ByeByeEJB.method2())"/>
- <line text="(Class) Transaction required at execution(void ByeByeEJB.method3())"/>
- </stdout>
- </run>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/ajdkExamples" title="ajdk: @retention checking">
- <compile files="RetentionTime.aj" options="-1.5">
- <message kind="error" line="8" text="Annotation type Goo does not have runtime retention"/>
- <message kind="error" line="13" text="Annotation type Goo does not have runtime retention"/>
- <message kind="error" line="18" text="Annotation type Goo does not have runtime retention"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/ajdkExamples" title="ajdk: @inherited">
- <compile files="AnnotationInheritance.aj" options="-1.5">
- <message kind="warning" line="16" text="annotatedMethodCall()"/>
- <message kind="warning" line="16" text="c1MethodCall()"/>
- <message kind="warning" line="17" text="c1MethodCall()"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/ajdkExamples" title="ajdk: deow-ann">
- <compile files="DeclaresWithAnnotations.aj,org/xyz/model/Model.java" options="-1.5">
- <message kind="warning" line="27" text="Expensive operation called from within performance critical section"/>
- <message kind="error" line="26" text="Untrusted code should not call the model classes directly"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/ajdkExamples" title="ajdk: decp-ann">
- <compile files="DecpAnnotations.aj" options="-1.5">
- </compile>
- <run class="DecpAnnotations">
- <stdout>
- <line text="Test Foo is not secured: PASS"/>
- <line text="Test Goo is secured: PASS"/>
- <line text="goo credentials: none"/>
- <line text="Test BankAccount is not secured: PASS"/>
- <line text="Test PrivateBankAccount is not secured: PASS"/>
- <line text="Test BusinessBankAccount is secured: PASS"/>
- </stdout>
- </run>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/ajdkExamples" title="ajdk: dec precedence">
- <compile files="PrecedenceAnnotations.aj" options="-1.5">
- </compile>
- <run class="PrecedenceAnnotations">
- <stdout>
- <line text="@Security S2"/>
- <line text="S1"/>
- <line text="@Performance P2"/>
- <line text="P1"/>
- </stdout>
- </run>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/ajdkExamples" title="ajdk: dec annotation">
- <compile files="DeclareAnnotation.aj,org/xyz/model/Model.java" options="-1.5">
- <message kind="warning" line="3" text="@BusinessDomain"/>
- <message kind="warning" line="43" text="@Secured"/>
- <message kind="warning" line="44" text="@Secured"/>
- <message kind="warning" line="55" text="@Secured"/>
- <message kind="warning" line="62" text="@Persisted"/>
- <message kind="warning" line="68" text="@Persisted"/>
- <message kind="warning" line="41" text="@Secured"/>
- <message kind="warning" line="51" text="@Secured"/>
- </compile>
- <run class="DeclareAnnotation"/>
- </ajc-test>
-
- <ajc-test dir="java5/covariance/ajdk" title="ajdk: covariance">
- <compile files="AJDKExamples.aj" options="-1.5">
- <message kind="warning" line="43" text="call(* whoAreYou())"/>
- <message kind="warning" line="44" text="call(* whoAreYou())"/>
- <message kind="warning" line="43" text="call(* A.whoAreYou())"/>
- <message kind="warning" line="44" text="call(* A.whoAreYou())"/>
- <message kind="warning" line="43" text="call(A whoAreYou())"/>
- <message kind="warning" line="44" text="call(A whoAreYou())"/>
- <message kind="warning" line="44" text="call(A+ B.whoAreYou())"/>
- <message kind="warning" line="44" text="call(B whoAreYou())"/>
- <message kind="warning" line="44" text="call(B B.whoAreYou())"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/varargs/ajdk" title="ajdk: varargs">
- <compile files="AJDKExamples.aj,org/xyz/Foo.java,org/xyz/Goo.java,org/xyz/Hoo.java" options="-1.5">
- <message kind="warning" line="8" text="call vararg match"/>
- <message kind="warning" line="14" text="execution vararg match"/>
- <message kind="warning" line="5" text="init vararg match"/>
- <message kind="warning" line="6" text="init vararg match"/>
- <message kind="warning" line="27" text="single vararg"/>
- <message kind="warning" line="28" text="single String[]"/>
- <message kind="warning" line="18" text="single String[]"/>
- </compile>
- <run class="AJDKExamples">
- <stdout>
- <line text="Matched at call(void X.foo(int, String[]))"/>
- </stdout>
- </run>
- </ajc-test>
-
- <ajc-test dir="java5/pertypewithin/ajdk" title="ajdk: ptw">
- <compile files="AJDKExamples.aj" options="-1.5"/>
- <run class="org.xyz.foo.AJDKExamples">
- <stdout>
- <line text="true"/>
- <line text="true"/>
- <line text="There are 2 As"/>
- <line text="There are 3 Bs"/>
- </stdout>
- </run>
- </ajc-test>
-
- <!-- ======================================================================================= -->
- <!-- declare annotation -->
- <!-- ======================================================================================= -->
-
- <ajc-test dir="java5/annotations/declare" title="basic declare annotation parse test">
- <compile files="BasicParseTest.aj" options="-1.5">
- </compile>
- </ajc-test>
-
- <!-- ======================================================================================= -->
- <!-- declare annotation (@type) -->
- <!-- ======================================================================================= -->
-
- <ajc-test dir="java5/annotations/declare" title="declare @type 1">
- <compile files="DecaType1.java" options="-1.5"/>
- <run class="DecaType1">
- <stderr>
- <line text="annotation is @MyAnnotation()"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/declare" title="declare @type 2">
- <compile files="DecaType2.java" options="-1.5,-Xlint:ignore" >
- </compile>
- <run class="DecaType2">
- <stderr>
- <line text="annotation on DecaType2 is @MyAnnotation()"/>
- <line text="annotation on X is @MyAnnotation()"/>
- <line text="annotation on MyAnnotation is @MyAnnotation()"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/declare" title="declare @type - with matching pointcut">
- <compile files="DecaType3.java" options="-1.5"/>
- <run class="DecaType3">
- <stderr>
- <line text="hello world"/>
- <line text="advice running"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/declare" title="declare @type - binary weaving">
- <weave classesFiles="BaseTypes.java"
- aspectsFiles="DecaTypeBin1.aj,Colored.java"
- options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
- </weave>
- <run class="BaseTypes">
- <stderr>
- <line text="Color identified on class X"/>
- <line text="A.m() running"/>
- <line text="A.m() running"/>
- <line text="A.m() running"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/declare" title="declare @type - complex annotation - binary weaving">
- <weave classesFiles="BaseTypes.java" aspectsFiles="DecaTypeBin2.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
- <run class="BaseTypes">
- <stderr>
- <line text="ComplexAnnotation identified on execution(void A.m())"/>
- <line text="A.m() running"/>
- <line text="A.m() running"/>
- <line text="A.m() running"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/declare" title="declare @type - complex annotation - source weaving">
- <compile files="BaseTypes.java,DecaTypeBin2.aj" options="-1.5"/>
- <run class="BaseTypes">
- <stderr>
- <line text="ComplexAnnotation identified on execution(void A.m())"/>
- <line text="A.m() running"/>
- <line text="A.m() running"/>
- <line text="A.m() running"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/declare" title="declare @type - two annotations hit one type - source weaving">
- <compile files="BaseTypes.java,DecaTypeBin3.aj" options="-1.5"/>
- <run class="BaseTypes">
- <stderr>
- <line text="Color identified on execution(void A.m())"/>
- <line text="Fruit identified on execution(void A.m())"/>
- <line text="A.m() running"/>
- <line text="A.m() running"/>
- <line text="A.m() running"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/declare" title="declare @type - two annotations hit one type - binary weaving">
- <weave classesFiles="BaseTypes.java" aspectsFiles="DecaTypeBin3.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
- <run class="BaseTypes">
- <stderr>
- <line text="Color identified on execution(void A.m())"/>
- <line text="Fruit identified on execution(void A.m())"/>
- <line text="A.m() running"/>
- <line text="A.m() running"/>
- <line text="A.m() running"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/declare" title="declare @type - declare parents interactions (order 1) - binary weaving">
- <weave classesFiles="BaseTypes.java" aspectsFiles="DecaDecpInteractions1.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
- <run class="BaseTypes">
- <stderr>
- <line text="Marker interface identified on execution(void A.m())"/>
- <line text="Color annotation identified on execution(void A.m())"/>
- <line text="A.m() running"/>
- <line text="Marker interface identified on execution(void A.m())"/>
- <line text="A.m() running"/>
- <line text="Marker interface identified on execution(void A.m())"/>
- <line text="A.m() running"/>
- </stderr>
- </run>
- </ajc-test>
- <ajc-test dir="java5/annotations/declare" title="declare @type - declare parents interactions (order 1) - source weaving">
- <compile files="BaseTypes.java,DecaDecpInteractions1.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
- <run class="BaseTypes">
- <stderr>
- <line text="Marker interface identified on execution(void A.m())"/>
- <line text="Color annotation identified on execution(void A.m())"/>
- <line text="A.m() running"/>
- <line text="Marker interface identified on execution(void A.m())"/>
- <line text="A.m() running"/>
- <line text="Marker interface identified on execution(void A.m())"/>
- <line text="A.m() running"/>
- </stderr>
- </run>
- </ajc-test>
-
-
- <ajc-test dir="java5/annotations/declare" title="declare @type - declare parents interactions (order 2) - binary weaving">
- <weave classesFiles="BaseTypes.java" aspectsFiles="DecaDecpInteractions2.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
- <run class="BaseTypes">
- <stderr>
- <line text="Marker interface identified on execution(void A.m())"/>
- <line text="Color annotation identified on execution(void A.m())"/>
- <line text="A.m() running"/>
- <line text="Marker interface identified on execution(void A.m())"/>
- <line text="A.m() running"/>
- <line text="Marker interface identified on execution(void A.m())"/>
- <line text="A.m() running"/>
- </stderr>
- </run>
- </ajc-test>
- <ajc-test dir="java5/annotations/declare" title="declare @type - declare parents interactions (order 2) - source weaving">
- <compile files="BaseTypes.java,DecaDecpInteractions2.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
- <run class="BaseTypes">
- <stderr>
- <line text="Marker interface identified on execution(void A.m())"/>
- <line text="Color annotation identified on execution(void A.m())"/>
- <line text="A.m() running"/>
- <line text="Marker interface identified on execution(void A.m())"/>
- <line text="A.m() running"/>
- <line text="Marker interface identified on execution(void A.m())"/>
- <line text="A.m() running"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/declare" title="declare @type - declare parents interactions (order 3) - binary weaving">
- <weave classesFiles="BaseTypes.java" aspectsFiles="DecaDecpInteractions3.aj" options="-1.5,-Xlint:ignore"/>
- <run class="BaseTypes">
- <stderr>
- <line text="Marker interface identified on execution(void A.m())"/>
- <line text="Color annotation identified on execution(void A.m())"/>
- <line text="A.m() running"/>
- <line text="Marker interface identified on execution(void A.m())"/>
- <line text="Color annotation identified on execution(void A.m())"/>
- <line text="A.m() running"/>
- <line text="Marker interface identified on execution(void A.m())"/>
- <line text="Color annotation identified on execution(void A.m())"/>
- <line text="A.m() running"/>
- </stderr>
- </run>
- </ajc-test>
- <ajc-test dir="java5/annotations/declare" title="declare @type - declare parents interactions (order 3) - source weaving">
- <compile files="BaseTypes.java,DecaDecpInteractions3.aj" options="-1.5,-Xlint:ignore"/>
- <run class="BaseTypes">
- <stderr>
- <line text="Marker interface identified on execution(void A.m())"/>
- <line text="Color annotation identified on execution(void A.m())"/>
- <line text="A.m() running"/>
- <line text="Marker interface identified on execution(void A.m())"/>
- <line text="Color annotation identified on execution(void A.m())"/>
- <line text="A.m() running"/>
- <line text="Marker interface identified on execution(void A.m())"/>
- <line text="Color annotation identified on execution(void A.m())"/>
- <line text="A.m() running"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/declare" title="declare @type - declare parents interactions (order 4) - binary weaving">
- <weave classesFiles="BaseTypes.java" aspectsFiles="DecaDecpInteractions4.aj" options="-1.5,-Xlint:ignore"/>
- <run class="BaseTypes">
- <stderr>
- <line text="Marker interface identified on execution(void A.m())"/>
- <line text="Color annotation identified on execution(void A.m())"/>
- <line text="A.m() running"/>
- <line text="Marker interface identified on execution(void A.m())"/>
- <line text="Color annotation identified on execution(void A.m())"/>
- <line text="A.m() running"/>
- <line text="Marker interface identified on execution(void A.m())"/>
- <line text="Color annotation identified on execution(void A.m())"/>
- <line text="A.m() running"/>
- </stderr>
- </run>
- </ajc-test>
- <ajc-test dir="java5/annotations/declare" title="declare @type - declare parents interactions (order 4) - source weaving">
- <compile files="BaseTypes.java,DecaDecpInteractions4.aj" options="-1.5,-Xlint:ignore"/>
- <run class="BaseTypes">
- <stderr>
- <line text="Marker interface identified on execution(void A.m())"/>
- <line text="Color annotation identified on execution(void A.m())"/>
- <line text="A.m() running"/>
- <line text="Marker interface identified on execution(void A.m())"/>
- <line text="Color annotation identified on execution(void A.m())"/>
- <line text="A.m() running"/>
- <line text="Marker interface identified on execution(void A.m())"/>
- <line text="Color annotation identified on execution(void A.m())"/>
- <line text="A.m() running"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/declare" title="declare @type - annotating an already annotated type - binary weaving">
- <weave classesFiles="AnnotatedType.java" aspectsFiles="DecaTypeBin4.aj" options="-1.5,-Xlint:ignore"/>
- <run class="AnnotatedType">
- <stderr>
- <line text="Color identified on execution(void AnnotatedType.m())"/>
- <line text="Fruit identified on execution(void AnnotatedType.m())"/>
- <line text="m() running"/>
- </stderr>
- </run>
- </ajc-test>
- <ajc-test dir="java5/annotations/declare" title="declare @type - annotating an already annotated type - source weaving">
- <compile files="AnnotatedType.java,DecaTypeBin4.aj" options="-1.5,-Xlint:ignore"/>
- <run class="AnnotatedType">
- <stderr>
- <line text="Color identified on execution(void AnnotatedType.m())"/>
- <line text="Fruit identified on execution(void AnnotatedType.m())"/>
- <line text="m() running"/>
- </stderr>
- </run>
- </ajc-test>
-
-
- <!--ajc-test dir="java5/annotations/declare" title="declare @type - annotations with different targets - binary weaving">
- <weave classesFiles="BaseTypes.java" aspectsFiles="DecaTypeBin5.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
- <message kind="error" line="15" text="The annotation @ColorM is disallowed for this location"/>
- <message kind="error" line="16" text="The annotation @ColorC is disallowed for this location"/>
- <message kind="error" line="18" text="The annotation @ColorF is disallowed for this location"/>
- <message kind="error" line="19" text="The annotation @ColorP is disallowed for this location"/>
- <message kind="error" line="20" text="The annotation @ColorL is disallowed for this location"/>
- <message kind="error" line="21" text="The annotation @ColorPkg is disallowed for this location"/>
- </weave>
- <run class="BaseTypes">
- <stderr>
- <line text="ColorT identified on execution(void A.m())"/>
- <line text="A.m() running"/>
- <line text="A.m() running"/>
- <line text="A.m() running"/>
- </stderr>
- </run>
- </ajc-test-->
-
- <ajc-test dir="java5/annotations/declare" title="declare @type - annotations with different targets - source weaving">
- <compile files="BaseTypes.java,DecaTypeBin5.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
- <message kind="error" line="15" text="The annotation @ColorM is disallowed for this location"/>
- <message kind="error" line="16" text="The annotation @ColorC is disallowed for this location"/>
- <message king="error" line="17" text="A is not a valid target for annotation ColorA"/>
- <message kind="error" line="18" text="The annotation @ColorF is disallowed for this location"/>
- <message kind="error" line="19" text="The annotation @ColorP is disallowed for this location"/>
- <message kind="error" line="20" text="The annotation @ColorL is disallowed for this location"/>
- <message kind="error" line="21" text="The annotation @ColorPkg is disallowed for this location"/>
- </compile>
- </ajc-test>
-
- <!--ajc-test dir="java5/annotations/declare" title="declare @type - annotations with different targets (using type patterns) - binary weaving">
- <weave classesFiles="BaseTypes.java" aspectsFiles="DecaTypeBin6.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
- <message kind="warning" line="15" text="A is not a valid target for annotation ColorM"/>
- <message kind="warning" line="16" text="A is not a valid target for annotation ColorC"/>
- <message kind="warning" line="17" text="A is not a valid target for annotation ColorL"/>
- <message kind="warning" line="17" text="B is not a valid target for annotation ColorL"/>
- <message kind="warning" line="17" text="C is not a valid target for annotation ColorL"/>
- </weave>
- <run class="BaseTypes">
- <stderr>
- <line text="ColorT identified on execution(void A.m())"/>
- <line text="A.m() running"/>
- <line text="ColorT identified on execution(void A.m())"/>
- <line text="A.m() running"/>
- <line text="ColorT identified on execution(void A.m())"/>
- <line text="A.m() running"/>
- </stderr>
- </run>
- </ajc-test-->
-
- <ajc-test dir="java5/annotations/declare" title="declare @type - annotations with different targets (using type patterns) - source weaving">
- <compile files="BaseTypes.java,DecaTypeBin6.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
- <message kind="error" line="15" text="The annotation @ColorM is disallowed for this location"/>
- <message kind="error" line="16" text="The annotation @ColorC is disallowed for this location"/>
- <message kind="error" line="17" text="The annotation @ColorL is disallowed for this location"/>
- <message kind="error" line="18" text="The annotation @ColorF is disallowed for this location"/>
- </compile>
- </ajc-test>
-
-
- <ajc-test dir="java5/annotations/declare" title="declare @type - complex decp decAtType interactions - binary weaving">
- <weave classesFiles="BaseTypes.java" aspectsFiles="DecaTypeBin7.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
- </weave>
- <run class="BaseTypes">
- <stderr>
- <line text="Color identified on execution(void A.m())"/>
- <line text="Fruit identified on execution(void A.m())"/>
- <line text="Chocolate identified on execution(void A.m())"/>
- <line text="M1 at execution(void A.m())"/>
- <line text="M2 at execution(void A.m())"/>
- <line text="M3 at execution(void A.m())"/>
- <line text="A.m() running"/>
- <line text="Fruit identified on execution(void B.m())"/>
- <line text="Chocolate identified on execution(void B.m())"/>
- <line text="M1 at execution(void B.m())"/>
- <line text="M2 at execution(void B.m())"/>
- <line text="M3 at execution(void B.m())"/>
- <line text="B.m() running"/>
- <line text="Fruit identified on execution(void C.m())"/>
- <line text="Chocolate identified on execution(void C.m())"/>
- <line text="M1 at execution(void C.m())"/>
- <line text="M2 at execution(void C.m())"/>
- <line text="M3 at execution(void C.m())"/>
- <line text="C.m() running"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/declare" title="declare @type - complex decp decAtType interactions - source weaving">
- <compile files="BaseTypes.java,DecaTypeBin7.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
- <run class="BaseTypes">
- <stderr>
- <line text="Color identified on execution(void A.m())"/>
- <line text="Fruit identified on execution(void A.m())"/>
- <line text="Chocolate identified on execution(void A.m())"/>
- <line text="M1 at execution(void A.m())"/>
- <line text="M2 at execution(void A.m())"/>
- <line text="M3 at execution(void A.m())"/>
- <line text="A.m() running"/>
- <line text="Fruit identified on execution(void B.m())"/>
- <line text="Chocolate identified on execution(void B.m())"/>
- <line text="M1 at execution(void B.m())"/>
- <line text="M2 at execution(void B.m())"/>
- <line text="M3 at execution(void B.m())"/>
- <line text="B.m() running"/>
- <line text="Fruit identified on execution(void C.m())"/>
- <line text="Chocolate identified on execution(void C.m())"/>
- <line text="M1 at execution(void C.m())"/>
- <line text="M2 at execution(void C.m())"/>
- <line text="M3 at execution(void C.m())"/>
- <line text="C.m() running"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/declare" title="declare @type - trying to put annotation targetting annos on normal types - source weaving">
- <compile files="BaseTypes.java,DecaTypeBin8.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
- <message kind="error" line="8" text="A is not a valid target for annotation ColorA"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/declare" title="declare @type - trying to put annotation targetting annos on normal types - binary weaving">
- <weave classesFiles="BaseTypes.java" aspectsFiles="DecaTypeBin8.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
- <message kind="error" line="8" text="A is not a valid target for annotation ColorA"/>
- </weave>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/declare" title="declare @type - trying to put annotation targetting annos on normal types (uses pattern) - source weaving">
- <compile files="BaseTypes.java,DecaTypeBin9.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
- <message kind="warning" line="8" text="A is not a valid target for annotation ColorA"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/declare" title="declare @type - trying to put annotation targetting annos on normal types (uses pattern) - binary weaving">
- <weave classesFiles="BaseTypes.java" aspectsFiles="DecaTypeBin9.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
- <message kind="warning" line="8" text="A is not a valid target for annotation ColorA"/>
- </weave>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/declare" title="declare @type - covering enum and class element values - source weaving">
- <compile files="EnumAndClassValues.aj,FunkyAnnotations.java" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
- <run class="FunkyAnnotations">
- <stderr>
- <line text="hello world"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/declare" title="declare @type - covering enum and class element values - binary weaving">
- <weave aspectsFiles="EnumAndClassValues.aj" classesFiles="FunkyAnnotations.java" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
- <run class="FunkyAnnotations">
- <stderr>
- <line text="advice running: Red"/>
- <line text="advice running: class java.lang.Integer"/>
- <line text="method running"/>
- </stderr>
- </run>
- </ajc-test>
-
-
- <!-- ======================================================================================= -->
- <!-- declare annotation (@field) -->
- <!-- ======================================================================================= -->
-
- <ajc-test dir="java5/annotations/declare/atfield" title="declare @field - simple source weaving">
- <compile files="Base.java,Colored.java,AtField1.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
- <run class="Base">
- <stderr>
- <line text="Colored field access at set(int Base.publicIntField)"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/declare/atfield" title="declare @field - simple binary weaving">
- <weave classesFiles="Base.java,Colored.java" aspectsFiles="AtField1.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
- <run class="Base">
- <stderr>
- <line text="Colored field access at set(int Base.publicIntField)"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/declare/atfield" title="declare @field - two the same on one - source weaving">
- <compile files="Base.java,Colored.java,TwoOnOneField.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
- <message kind="warning" text="int Base.publicIntField - already has an annotation of type Colored"/>
- </compile>
- <run class="Base">
- <stderr>
- <line text="Colored field access at set(int Base.publicIntField)"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/declare/atfield" title="declare @field - two the same on one - binary weaving">
- <weave classesFiles="Base.java,Colored.java" aspectsFiles="TwoOnOneField.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
- <message kind="warning" text="int Base.publicIntField - already has an annotation of type Colored"/>
- </weave>
- <run class="Base">
- <stderr>
- <line text="Colored field access at set(int Base.publicIntField)"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/declare/atfield" title="declare @field - two different on one - source weaving">
- <compile files="Base.java,Colored.java,Fruit.java,TwoOnOneField2.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
- </compile>
- <run class="Base">
- <stderr>
- <line text="Colored field access at set(int Base.publicIntField)"/>
- <line text="Fruit field access at set(int Base.publicIntField)"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/declare/atfield" title="declare @field - two different on one - binary weaving">
- <weave classesFiles="Base.java,Colored.java,Fruit.java" aspectsFiles="TwoOnOneField2.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
- </weave>
- <run class="Base">
- <stderr>
- <line text="Colored field access at set(int Base.publicIntField)"/>
- <line text="Fruit field access at set(int Base.publicIntField)"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/declare/atfield" title="declare @field - wrong target - source weaving">
- <compile files="Base.java,Colored.java,WrongTarget.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
- <message kind="error" line="8" text="The annotation @MethodColoring is disallowed for this location"/>
- <message kind="error" line="9" text="The annotation @TypeColoring is disallowed for this location"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/declare/atfield" title="declare @field - right target - source weaving">
- <compile files="Base.java,Colored.java,RightTarget.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
- <run class="Base">
- <stderr>
- <line text="Colored field access at set(int Base.publicIntField)"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/declare/atfield" title="declare @field - right target - binary weaving">
- <weave classesFiles="Base.java,Colored.java" aspectsFiles="RightTarget.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
- <run class="Base">
- <stderr>
- <line text="Colored field access at set(int Base.publicIntField)"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/declare/atfield" title="declare @field - recursive application - source weaving">
- <compile files="Base.java,Colored.java,Fruit.java,RecursiveFields.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
- <run class="Base">
- <stderr>
- <line text="Fruit field access at set(int Base.publicIntField)"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/declare/atfield" title="declare @field - recursive application - binary weaving">
- <weave classesFiles="Base.java,Colored.java,Fruit.java" aspectsFiles="RecursiveFields.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
- <run class="Base">
- <stderr>
- <line text="Fruit field access at set(int Base.publicIntField)"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/declare/atfield" title="declare @field - recursive application (other order) - source weaving">
- <compile files="Base.java,Colored.java,Fruit.java,RecursiveFields2.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
- <run class="Base">
- <stderr>
- <line text="Fruit field access at set(int Base.publicIntField)"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/declare/atfield" title="declare @field - recursive application (other order) - binary weaving">
- <weave classesFiles="Base.java,Colored.java,Fruit.java" aspectsFiles="RecursiveFields2.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
- <run class="Base">
- <stderr>
- <line text="Fruit field access at set(int Base.publicIntField)"/>
- </stderr>
- </run>
- </ajc-test>
- <!-- incorrect target type for annotation on field -->
-
- <!-- incorrect target type for annotation on method -->
- <!-- two annotations on one method -->
- <!-- two of the same annotation on one method - error -->
- <!-- two of the same on one using pattern spec - lint -->
-
- <!-- need some incorrect signatures in the declare @statements - e.g. declare @constructor: public Base(int): XXX; will blow things up as it uses Base rather than new -->
- <!-- incorrect target type for annotation on ctor -->
- <!-- two annotations on one ctor -->
- <!-- two of the same annotation on one ctor - error -->
- <!-- two of the same on one using pattern spec - lint -->
-
- <ajc-test dir="java5/annotations/declare/atmethodctor" title="declare @method - simple source weaving">
- <compile files="Base.java,Colored.java,AtMethod1.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
- <run class="Base">
- <stderr>
- <line text="Colored method invocation at call(void Base.m1())"/>
- <line text="m1() running"/>
- <line text="m2() running"/>
- <line text="m3() running"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/declare/atmethodctor" title="declare @method - simple binary weaving">
- <weave classesFiles="Base.java,Colored.java" aspectsFiles="AtMethod1.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
- <run class="Base">
- <stderr>
- <line text="Colored method invocation at call(void Base.m1())"/>
- <line text="m1() running"/>
- <line text="m2() running"/>
- <line text="m3() running"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/declare/atmethodctor" title="declare @constructor - simple source weaving">
- <compile files="Base.java,Colored.java,AtCtor1.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
- <run class="Base">
- <stderr>
- <line text="Colored constructor invocation at call(Base(int))"/>
- <line text="m1() running"/>
- <line text="m2() running"/>
- <line text="m3() running"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/declare/atmethodctor" title="declare @constructor - simple binary weaving">
- <weave classesFiles="Base.java,Colored.java" aspectsFiles="AtCtor1.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
- <run class="Base">
- <stderr>
- <line text="Colored constructor invocation at call(Base(int))"/>
- <line text="m1() running"/>
- <line text="m2() running"/>
- <line text="m3() running"/>
- </stderr>
- </run>
- </ajc-test>
-
-
- <!-- These tests verify both @method and @ctor behavior - they are so similar it is OK to have them together... -->
-
- <ajc-test dir="java5/annotations/declare/atmethodctor" title="declare @method @ctor - wrong target - source weaving">
- <compile files="Base.java,Colored.java,WrongTarget.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
- <message kind="error" line="8" text="The annotation @MethodColoring is disallowed for this location"/>
- <message kind="error" line="9" text="The annotation @TypeColoring is disallowed for this location"/>
- <message kind="error" line="10" text="The annotation @MethodColoring is disallowed for this location"/>
- <message kind="error" line="11" text="The annotation @TypeColoring is disallowed for this location"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/declare/atmethodctor" title="declare @method @ctor - right target - source weaving">
- <compile files="Base.java,Colored.java,RightTarget.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
- <run class="Base">
- <stderr>
- <line text="Colored ctor call at call(Base(int))"/>
- <line text="Colored method call at call(void Base.m1())"/>
- <line text="m1() running"/>
- <line text="m2() running"/>
- <line text="m3() running"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/declare/atmethodctor" title="declare @method @ctor - right target - binary weaving">
- <weave classesFiles="Base.java,Colored.java" aspectsFiles="RightTarget.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
- <run class="Base">
- <stderr>
- <line text="Colored ctor call at call(Base(int))"/>
- <line text="Colored method call at call(void Base.m1())"/>
- <line text="m1() running"/>
- <line text="m2() running"/>
- <line text="m3() running"/>
- </stderr>
- </run>
- </ajc-test>
-
- <!-- check @method/@ctor/@field recursively applying, can only happen if a pattern for one of them includes an annotation -->
-
-
- <ajc-test dir="java5/annotations/declare/atmethodctor" title="declare @method @ctor - two the same on one - source weaving">
- <compile files="Base.java,Colored.java,TwoOnOneMember.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
- <message kind="warning" text="void Base.m1() - already has an annotation of type Colored"/>
- <message kind="warning" text="void Base.<init>(int) - already has an annotation of type Colored"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/declare/atmethodctor" title="declare @method @ctor - two the same on one - binary weaving">
- <weave classesFiles="Base.java,Colored.java" aspectsFiles="TwoOnOneMember.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
- <message kind="warning" text="void Base.m1() - already has an annotation of type Colored"/>
- <message kind="warning" text="void Base.<init>(int) - already has an annotation of type Colored"/>
- </weave>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/declare/atmethodctor" title="declare @method @ctor - two different on one - source weaving">
- <compile files="Base.java,Colored.java,Fruit.java,TwoOnOneMember2.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
- </compile>
- <run class="Base">
- <stderr>
- <line text="Colored ctor call at Base.java:11"/>
- <line text="Fruit ctor call at Base.java:11"/>
- <line text="Colored method call at Base.java:15"/>
- <line text="Fruit method call at Base.java:15"/>
- <line text="m1() running"/>
- <line text="m2() running"/>
- <line text="m3() running"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/declare/atmethodctor" title="declare @method @ctor - two different on one - binary weaving">
- <weave classesFiles="Base.java,Colored.java,Fruit.java" aspectsFiles="TwoOnOneMember2.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
- </weave>
- <run class="Base">
- <stderr>
- <line text="Colored ctor call at Base.java:11"/>
- <line text="Fruit ctor call at Base.java:11"/>
- <line text="Colored method call at Base.java:15"/>
- <line text="Fruit method call at Base.java:15"/>
- <line text="m1() running"/>
- <line text="m2() running"/>
- <line text="m3() running"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="java5/annotations/declare" title="declare all annotations on one class - source weaving">
- <compile files="DeathByAnnotations.aj" options="-1.5,-emacssym" xlintfile="ignoreTypeNotExposed.properties"/>
- <run class="p.q.DeathByAnnotations"/>
- </ajc-test>
-
- </suite>
|