You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002
  1. <!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[
  2. ]>
  3. <!-- AspectJ v1.5.0 Tests -->
  4. <suite>
  5. <ajc-test dir="java5/bridgeMethods" pr="72766" title="Ignore bridge methods">
  6. <compile files="AspectX.aj" inpath="testcode.jar" options="-showWeaveInfo">
  7. <message kind="warning" line="7" text="pointcut did not match on the method call to a bridge method."/>
  8. <message kind="weave" text="(AspectX.aj:18) advised by before advice from 'AspectX'"/>
  9. <message kind="weave" text="(Number.java:5) advised by before advice from 'AspectX'"/>
  10. </compile>
  11. </ajc-test>
  12. <ajc-test dir="migration" title="load aspectj 1.2.1 aspects in aspectj 5">
  13. <compile files="Program.java" aspectpath="aspects121.jar">
  14. </compile>
  15. <run class="Program"/>
  16. </ajc-test>
  17. <ajc-test dir="bugs/java5/arrayCloning" pr="72150" vm="1.5"
  18. title="AJC possible bug with static nested classes">
  19. <compile files="A.java,C.java" options="-1.5,-showWeaveInfo">
  20. <message kind="weave" text="Type 'C' (C.java:14) advised by around advice from 'A' (A.java:2)"/>
  21. </compile>
  22. <run class="C"/>
  23. </ajc-test>
  24. <ajc-test dir="java5/pseudoKeywords"
  25. title="method called around in class">
  26. <compile files="MethodCalledAround.java">
  27. </compile>
  28. </ajc-test>
  29. <ajc-test dir="java5/pseudoKeywords"
  30. title="method called around in aspect">
  31. <compile files="MethodCalledAroundAspect.java">
  32. <message kind="error" line="2"/>
  33. </compile>
  34. </ajc-test>
  35. <ajc-test dir="bugs150/pr87376" title="structure model npe on type not found">
  36. <compile files="I.java,NPE.aj" options="-emacssym">
  37. <message kind="error" line="8" text="I cannot be resolved to a type"/>
  38. <message kind="error" line="10" text="I cannot be resolved to a type"/>
  39. </compile>
  40. </ajc-test>
  41. <ajc-test dir="decp" pr="80249" title="Order of types passed to compiler determines weaving behavior">
  42. <compile files="A.java,B.java,AspectX.java"/>
  43. <run class="B"/>
  44. <compile files="B.java,A.java,AspectX.java"/>
  45. <run class="B"/>
  46. </ajc-test>
  47. <ajc-test dir="decs" pr="42743" title="declare soft of runtime exception">
  48. <compile files="DeclareSoftRuntimeException.aj">
  49. <message kind="warning" line="3" text="MyRuntimeException will not be softened as it is already a RuntimeException"/>
  50. </compile>
  51. <run class="DeclareSoftRuntimeException">
  52. <stdout>
  53. <line text="MyRuntimeException"/>
  54. <line text="org.aspectj.lang.SoftException"/>
  55. <line text="MyRuntimeException"/>
  56. </stdout>
  57. </run>
  58. </ajc-test>
  59. <ajc-test dir="decs" pr="42743" title="declare soft w. catch block">
  60. <compile files="VerifyError.aj">
  61. </compile>
  62. <run class="VerifyError"/>
  63. </ajc-test>
  64. <ajc-test dir="bugs" pr="61568" title="Various kinds of ambiguous bindings">
  65. <compile files="AmbiguousBindings.aj">
  66. <message line="17" text="ambiguous binding of parameter(s) foo across '||' in pointcut"></message>
  67. <message line="19" text="ambiguous binding of parameter(s) foo across '||' in pointcut"></message>
  68. <message line="21" text="ambiguous binding of parameter(s) foo across '||' in pointcut"></message>
  69. <message line="23" text="ambiguous binding of parameter(s) x across '||' in pointcut"></message>
  70. <message line="25" text="ambiguous binding of parameter(s) foo across '||' in pointcut"></message>
  71. </compile>
  72. </ajc-test>
  73. <ajc-test dir="bugs" pr="61658" title="ambiguous args">
  74. <compile files="PR61658.java">
  75. <message line="17" text="ambiguous binding of parameter(s) a, b across '||' in pointcut"></message>
  76. </compile>
  77. </ajc-test>
  78. <ajc-test dir="bugs150" pr="78021" title="Injecting exception into while loop with break statement causes catch block to be ignored">
  79. <compile files="PR78021.java"/>
  80. <run class="PR78021"/>
  81. </ajc-test>
  82. <ajc-test dir="bugs150" pr="79554" title="Return in try-block disables catch-block if final-block is present">
  83. <compile files="PR79554.java"/>
  84. <run class="PR79554"/>
  85. </ajc-test>
  86. <ajc-test dir="bugs150" pr="82570" title="Weaved code does not include debug lines">
  87. <compile files="PR82570_1.java"/>
  88. </ajc-test>
  89. <ajc-test dir="bugs150" pr="83303" title="compiler error when mixing inheritance, overriding and polymorphism">
  90. <compile files="PR83303.java"/>
  91. </ajc-test>
  92. <ajc-test dir="bugs150" pr="83563" title="pertypewithin() handing of inner classes (1)">
  93. <compile files="PR83563_1.java"/>
  94. <run class="PR83563_1"/>
  95. </ajc-test>
  96. <ajc-test dir="bugs150" pr="83563" title="pertypewithin() handing of inner classes (2)">
  97. <compile files="PR83563_2.java"/>
  98. <run class="PR83563_2"/>
  99. </ajc-test>
  100. <ajc-test dir="bugs150" pr="83645" title="pertypewithin({interface}) illegal field modifier">
  101. <compile files="PR83645.java"/>
  102. <run class="PR83645"/>
  103. </ajc-test>
  104. <ajc-test dir="bugs150" title="bad asm for enums" vm="1.5">
  105. <compile files="Rainbow.java" options="-emacssym,-1.5"/>
  106. </ajc-test>
  107. <!-- Annotation binding tests -->
  108. <ajc-test dir="java5/annotations/binding" vm="1.5" title="call annotation binding 1">
  109. <compile files="CallAnnBinding.aj" options="-1.5"/>
  110. <run class="CallAnnBinding"/>
  111. </ajc-test>
  112. <ajc-test dir="java5/annotations/binding" vm="1.5" title="call annotation binding 2">
  113. <compile files="CallAnnBinding2.aj" options="-1.5"/>
  114. <run class="CallAnnBinding2"/>
  115. </ajc-test>
  116. <ajc-test dir="java5/annotations/binding" vm="1.5" title="call annotation binding 3">
  117. <compile files="CallAnnBinding3.aj" options="-1.5"/>
  118. <run class="CallAnnBinding3"/>
  119. </ajc-test>
  120. <ajc-test dir="java5/annotations/binding" vm="1.5" title="call annotation binding 4">
  121. <compile files="CallAnnBinding4.aj" options="-1.5"/>
  122. <run class="CallAnnBinding4"/>
  123. </ajc-test>
  124. <ajc-test dir="java5/annotations/binding" vm="1.5" title="call annotation binding 5">
  125. <compile files="CallAnnBinding5.aj" options="-1.5"/>
  126. <run class="CallAnnBinding5"/>
  127. </ajc-test>
  128. <ajc-test dir="java5/annotations/binding" vm="1.5" title="call annotation binding 6">
  129. <compile files="CallAnnBinding6.aj" options="-1.5"/>
  130. <run class="CallAnnBinding6"/>
  131. </ajc-test>
  132. <ajc-test dir="java5/annotations/binding" vm="1.5" title="call annotation binding 7">
  133. <compile files="CallAnnBinding7.aj" options="-1.5"/>
  134. <run class="CallAnnBinding7"/>
  135. </ajc-test>
  136. <ajc-test dir="java5/annotations/binding" vm="1.5" title="@target annotation binding 1">
  137. <compile files="AtTarget1.aj" options="-1.5"/>
  138. <run class="AtTarget1"/>
  139. </ajc-test>
  140. <ajc-test dir="java5/annotations/binding" vm="1.5" title="@target annotation binding 2">
  141. <compile files="AtTarget2.aj" options="-1.5"/>
  142. <run class="AtTarget2"/>
  143. </ajc-test>
  144. <ajc-test dir="java5/annotations/binding" vm="1.5" title="@target annotation binding 3">
  145. <compile files="AtTarget3.aj" options="-1.5"/>
  146. <run class="AtTarget3"/>
  147. </ajc-test>
  148. <ajc-test dir="java5/annotations/binding" vm="1.5" title="@target annotation binding 4">
  149. <compile files="AtTarget4.aj" options="-1.5"/>
  150. <run class="AtTarget4"/>
  151. </ajc-test>
  152. <ajc-test dir="java5/annotations/binding/usingPackageNames" vm="1.5" title="@target annotation binding 5">
  153. <compile files="MyAspect.aj,MyAnnotation.java,MyClass.java" options="-1.5"/>
  154. <run class="test.MyClass"/>
  155. </ajc-test>
  156. <ajc-test dir="java5/annotations/binding" vm="1.5" title="@this annotation binding 1">
  157. <compile files="AtThis1.aj" options="-1.5"/>
  158. <run class="AtThis1"/>
  159. </ajc-test>
  160. <ajc-test dir="java5/annotations/binding" vm="1.5" title="@this annotation binding 2">
  161. <compile files="AtThis2.aj" options="-1.5"/>
  162. <run class="AtThis2"/>
  163. </ajc-test>
  164. <ajc-test dir="java5/annotations/binding" vm="1.5" title="@this annotation binding 3">
  165. <compile files="AtThis3.aj" options="-1.5"/>
  166. <run class="AtThis3"/>
  167. </ajc-test>
  168. <ajc-test dir="java5/annotations/binding" vm="1.5" title="@this annotation binding 4">
  169. <compile files="AtThis4.aj" options="-1.5"/>
  170. <run class="AtThis4"/>
  171. </ajc-test>
  172. <ajc-test dir="java5/annotations/binding" vm="1.5" title="@this annotation binding 5">
  173. <compile files="AtThis5.aj" options="-1.5"/>
  174. <run class="AtThis5"/>
  175. </ajc-test>
  176. <ajc-test dir="java5/annotations/binding" vm="1.5" title="@args annotation binding 1">
  177. <compile files="AtArgs1.aj" options="-1.5"/>
  178. <run class="AtArgs1"/>
  179. </ajc-test>
  180. <ajc-test dir="java5/annotations/binding" vm="1.5" title="@args annotation binding 2">
  181. <compile files="AtArgs2.aj" options="-1.5"/>
  182. <run class="AtArgs2"/>
  183. </ajc-test>
  184. <ajc-test dir="java5/annotations/binding" vm="1.5" title="@args annotation binding 3">
  185. <compile files="AtArgs3.aj" options="-1.5"/>
  186. <run class="AtArgs3"/>
  187. </ajc-test>
  188. <ajc-test dir="java5/annotations/binding" vm="1.5" title="@args annotation binding 4">
  189. <compile files="AtArgs4.aj" options="-1.5"/>
  190. <run class="AtArgs4"/>
  191. </ajc-test>
  192. <ajc-test dir="java5/annotations/binding" vm="1.5" title="@args annotation binding 5">
  193. <compile files="AtArgs5.aj" options="-1.5"/>
  194. <run class="AtArgs5"/>
  195. </ajc-test>
  196. <ajc-test dir="java5/annotations/binding" vm="1.5" title="execution and @annotation">
  197. <compile files="ExecutionAnnBinding1.aj" options="-1.5"/>
  198. <run class="ExecutionAnnBinding1"/>
  199. </ajc-test>
  200. <ajc-test dir="java5/annotations/binding" vm="1.5" title="set and @annotation">
  201. <compile files="FieldAnnBinding1.aj" options="-1.5"/>
  202. <run class="FieldAnnBinding1"/>
  203. </ajc-test>
  204. <ajc-test dir="java5/annotations/binding" vm="1.5" title="get and @annotation">
  205. <compile files="FieldAnnBinding2.aj" options="-1.5"/>
  206. <run class="FieldAnnBinding2"/>
  207. </ajc-test>
  208. <ajc-test dir="java5/annotations/binding" vm="1.5" title="get and @annotation with arrays">
  209. <compile files="FieldAnnBinding3.aj" options="-1.5"/>
  210. <run class="FieldAnnBinding3"/>
  211. </ajc-test>
  212. <ajc-test dir="java5/annotations/binding" vm="1.5" title="cons call and @annotation">
  213. <compile files="CtorAnnBinding1.aj" options="-1.5"/>
  214. <run class="CtorAnnBinding1"/>
  215. </ajc-test>
  216. <ajc-test dir="java5/annotations/binding" vm="1.5" title="cons exe and @annotation">
  217. <compile files="CtorAnnBinding2.aj" options="-1.5"/>
  218. <run class="CtorAnnBinding2"/>
  219. </ajc-test>
  220. <ajc-test dir="java5/annotations/binding" vm="1.5" title="staticinit and @annotation">
  221. <compile files="StaticInitBinding.aj" options="-1.5"/>
  222. <run class="StaticInitBinding"/>
  223. </ajc-test>
  224. <ajc-test dir="java5/annotations/binding" vm="1.5" title="preinit and @annotation">
  225. <compile files="PreInitBinding.aj" options="-1.5"/>
  226. <run class="PreInitBinding"/>
  227. </ajc-test>
  228. <ajc-test dir="java5/annotations/binding" vm="1.5" title="init and @annotation">
  229. <compile files="InitBinding.aj" options="-1.5"/>
  230. <run class="InitBinding"/>
  231. </ajc-test>
  232. <ajc-test dir="java5/annotations/binding" vm="1.5" title="adviceexecution and @annotation">
  233. <compile files="AdviceExecBinding.aj" options="-1.5"/>
  234. <run class="AdviceExecBinding"/>
  235. </ajc-test>
  236. <ajc-test dir="java5/annotations/binding" vm="1.5" title="handler and @annotation">
  237. <compile files="HandlerBinding.aj" options="-1.5"/>
  238. <run class="HandlerBinding"/>
  239. </ajc-test>
  240. <ajc-test dir="java5/annotations/binding" vm="1.5" title="@withincode() and call(* println(..))">
  241. <compile files="WithinCodeBinding1.aj" options="-1.5"/>
  242. <run class="WithinCodeBinding1"/>
  243. </ajc-test>
  244. <ajc-test dir="java5/annotations/binding" vm="1.5" title="@within">
  245. <compile files="WithinBinding1.aj" options="-1.5"/>
  246. <run class="WithinBinding1"/>
  247. </ajc-test>
  248. <ajc-test dir="java5/annotations/binding" vm="1.5" title="@within - multiple types">
  249. <compile files="WithinBinding2.aj" options="-1.5"/>
  250. <run class="WithinBinding2"/>
  251. </ajc-test>
  252. <ajc-test dir="java5/annotations/binding/complexExample" vm="1.5" title="packages and no binding">
  253. <compile files="A.java,B.java,Color.java,X.java" options="-1.5"/>
  254. <run class="a.b.c.A"/>
  255. </ajc-test>
  256. <ajc-test dir="java5/annotations/binding/complexExample" vm="1.5" title="packages and binding">
  257. <compile files="A.java,B.java,Color.java,X2.java" options="-1.5"/>
  258. <run class="a.b.c.A"/>
  259. </ajc-test>
  260. <ajc-test dir="java5/annotations/binding" vm="1.5" title="binding with static methods">
  261. <compile files="StaticMethods.java" options="-1.5"/>
  262. <run class="StaticMethods"/>
  263. </ajc-test>
  264. <ajc-test dir="java5/annotations" vm="1.5" title="annotation matching on call">
  265. <weave classesFiles="AnnotatedType.java,SimpleAnnotation.java,SimpleAnnotation2.java"
  266. aspectsFiles="AnnotationAspect02.aj"
  267. options="-1.5,-showWeaveInfo">
  268. <message kind="weave" text="Type 'AnnotatedType' (AnnotatedType.java:3) advised by before advice from 'AnnotationAspect02' (AnnotationAspect02.aj:4)"/>
  269. <message kind="weave" text="Type 'AnnotatedType' (AnnotatedType.java:3) advised by before advice from 'AnnotationAspect02' (AnnotationAspect02.aj:2)"/>
  270. <message kind="weave" text="Type 'AnnotatedType' (AnnotatedType.java:4) advised by before advice from 'AnnotationAspect02' (AnnotationAspect02.aj:4)"/>
  271. </weave>
  272. </ajc-test>
  273. <ajc-test dir="java5/annotations" vm="1.5" title="at annotation matching">
  274. <weave classesFiles="AnnotatedType.java,SimpleAnnotation.java,SimpleAnnotation2.java"
  275. aspectsFiles="AnnotationAspect03.aj"
  276. options="-1.5,-showWeaveInfo">
  277. <message kind="warning" line="8" text="@annotation matched here"/>
  278. </weave>
  279. </ajc-test>
  280. <ajc-test dir="java5/annotations/within_code" vm="1.5" title="annotations and within(code)">
  281. <weave classesFiles="TestingAnnotations.java"
  282. aspectsFiles="WithinAndWithinCodeTests.java"
  283. options="-1.5,-showWeaveInfo">
  284. <message kind="warning" line="31" text="@within match on non-inherited annotation"/>
  285. <message kind="warning" line="39" text="@within match on non-inherited annotation"/>
  286. <message kind="warning" line="39" text="@within match on inheritable annotation"/>
  287. <message kind="warning" line="43" text="@within match on inheritable annotation"/>
  288. <message kind="warning" line="32" text="@withincode match"/>
  289. </weave>
  290. </ajc-test>
  291. <ajc-test dir="java5/annotations/within" vm="1.5" title="annotations and within">
  292. <weave classesFiles="PlainWithin.java"
  293. aspectsFiles="PlainWithinTests.java"
  294. options="-1.5,-showWeaveInfo">
  295. <message kind="warning" line="21" text="positive within match on annotation"/>
  296. <message kind="warning" line="25" text="negative within match on annotation"/>
  297. </weave>
  298. </ajc-test>
  299. <ajc-test dir="java5/annotations/thisOrtarget" vm="1.5" title="must have runtime retention">
  300. <compile options="-1.5" files="TestingAnnotations.java,NotRuntimeRetention.aj">
  301. <message kind="error" line="7" text="Annotation type MyClassRetentionAnnotation does not have runtime retention"/>
  302. <message kind="error" line="13" text="Annotation type MyClassRetentionAnnotation does not have runtime retention"/>
  303. </compile>
  304. </ajc-test>
  305. <ajc-test dir="java5/annotations/thisOrtarget" vm="1.5" title="inheritable or not">
  306. <compile options="-1.5" files="TestingAnnotations.java,ThisOrTargetTests.aj">
  307. </compile>
  308. <run class="TestingAnnotations"/>
  309. </ajc-test>
  310. <ajc-test dir="java5/annotations/thisOrtarget" vm="1.5" title="use of @this/target in deow">
  311. <compile options="-1.5" files="TestingAnnotations.java,DeclareEoW.java">
  312. <message kind="error" line="3" text="this() pointcut designator cannot be used in declare statement"/>
  313. <message kind="error" line="5" text="target() pointcut designator cannot be used in declare statement"/>
  314. </compile>
  315. </ajc-test>
  316. <ajc-test dir="java5/annotations/args" vm="1.5" title="@args tests">
  317. <compile options="-1.5" files="TestingArgsAnnotations.java,AtArgsAspect.java">
  318. </compile>
  319. <run class="TestingArgsAnnotations"/>
  320. </ajc-test>
  321. <ajc-test dir="java5/annotations/args" vm="1.5" title="use of @args in deow">
  322. <compile options="-1.5" files="TestingArgsAnnotations.java,DeclareEoW.java">
  323. <message kind="error" line="3" text="args() pointcut designator cannot be used in declare statement"/>
  324. </compile>
  325. </ajc-test>
  326. <ajc-test dir="java5/annotations" vm="1.5" title="compiling an annotation">
  327. <compile options="-1.5" files="SimpleAnnotation.java">
  328. </compile>
  329. </ajc-test>
  330. <ajc-test dir="java5/annotations" vm="1.5" title="compiling annotated file">
  331. <compile options="-1.5" files="SimpleAnnotation.java,AnnotatedType.java">
  332. </compile>
  333. </ajc-test>
  334. <ajc-test dir="java5/annotations/within" vm="1.5" title="annotations and within (src)">
  335. <compile files="PlainWithin.java,PlainWithinTests.java"
  336. aspectsFiles="PlainWithinTests.java"
  337. options="-1.5">
  338. <message kind="warning" line="21" text="positive within match on annotation"/>
  339. <message kind="warning" line="25" text="negative within match on annotation"/>
  340. </compile>
  341. </ajc-test>
  342. <ajc-test dir="java5/annotations/attarget" vm="1.5" title="losing annotations...">
  343. <compile options="-1.5" files="Program.java,AtTargetAspect.java">
  344. </compile>
  345. </ajc-test>
  346. <ajc-test dir="java5/annotations" vm="1.5" title="no itds on annotation types">
  347. <compile files="AnnotatedType.java,SimpleAnnotation.java,SimpleAnnotation2.java,AnnotationAspect01.aj"
  348. options="-1.5">
  349. <message kind="error" line="4" text="can't make inter-type constructor declarations"/>
  350. <message kind="error" line="8" text="can't make inter-type method declarations"/>
  351. <message kind="error" line="13" text="can't make inter-type field declarations"/>
  352. </compile>
  353. </ajc-test>
  354. <ajc-test dir="java5/annotations" vm="1.5" title="no declare parents on annotation types">
  355. <compile files="AnnotatedType.java,SimpleAnnotation.java,SimpleAnnotation2.java,AnnotationAspect04.aj"
  356. options="-1.5">
  357. <message kind="error" line="7" text="can't use declare parents to alter supertype of annotation type SimpleAnnotation"/>
  358. <message kind="error" line="10" text="can't use declare parents to make 'java.lang.annotation.Annotation' the parent of type"/>
  359. <message kind="error" line="4" text="can't use declare parents to make annotation type SimpleAnnotation implement an interface"/>
  360. </compile>
  361. </ajc-test>
  362. <ajc-test dir="java5/annotations" vm="1.5" title="declare parents wildcards matching annotation types">
  363. <compile files="AnnotatedType.java,SimpleAnnotation.java,SimpleAnnotation2.java,AnnotationAspect05.aj"
  364. options="-1.5">
  365. <message kind="warning" line="4" text="annotation type SimpleAnnotation2 matches a declare parents type pattern but is being ignored"/>
  366. <message kind="warning" line="4" text="annotation type SimpleAnnotation matches a declare parents type pattern but is being ignored"/>
  367. </compile>
  368. </ajc-test>
  369. <ajc-test dir="java5/annotations/binding/complexExample" vm="1.5" title="annotated any pattern">
  370. <compile files="A.java,B.java,C.java,Color.java,X3.java"
  371. options="-1.5">
  372. </compile>
  373. <run class="g.h.i.C"/>
  374. <run class="a.b.c.A"/>
  375. </ajc-test>
  376. <ajc-test dir="java5/annotations/binding/complexExample" vm="1.5" title="annotation not imported">
  377. <compile files="A.java,B.java,C.java,Color.java,X4.java"
  378. options="-1.5">
  379. <message kind="warning" line="6" text="no match for this type name: Color"/>
  380. </compile>
  381. <run class="a.b.c.A"/>
  382. </ajc-test>
  383. <ajc-test dir="java5/annotations/itds" vm="1.5" title="nasty annotation and itds test">
  384. <compile files="AnnotationsAndITDs.aj" options="-1.5">
  385. <message kind="warning" line="25" text="execution(@SomeAnnotation ...)"/>
  386. <message kind="warning" line="28" text="execution(@SomeAnnotation ...)"/>
  387. <message kind="warning" line="52" text="execution(@SomeAnnotation ...)"/>
  388. <message kind="warning" line="53" text="execution(@SomeAnnotation ...)"/>
  389. <message kind="warning" line="17" text="execution(@SomeAnnotation ...new(..)"/>
  390. <message kind="warning" line="20" text="execution(@SomeAnnotation ...new(..)"/>
  391. <message kind="warning" line="45" text="execution(@SomeAnnotation ...new(..)"/>
  392. <message kind="warning" line="46" text="execution(@SomeAnnotation ...new(..)"/>
  393. <message kind="warning" line="70" text="set(@SomeAnnotation...)"/>
  394. <message kind="warning" line="71" text="set(@SomeAnnotation...)"/>
  395. <message kind="warning" line="76" text="set(@SomeAnnotation...)"/>
  396. <message kind="warning" line="77" text="set(@SomeAnnotation...)"/>
  397. <message kind="warning" line="175" text="si(@SomeAnnotation...)"/>
  398. <message kind="warning" line="180" text="si(@SomeAnnotation...)"/>
  399. </compile>
  400. <run class="AnnotationsAndITDs">
  401. <stdout>
  402. <line text="@type System"/>
  403. <line text="hello AnnotationsAndITDs"/>
  404. <line text="goodbye String"/>
  405. <line text="x Object"/>
  406. <line text="y Integer"/>
  407. <line text="method bar has 1 params, first param annotation is @ParamAnnotation"/>
  408. <line text="d Double"/>
  409. <line text="f Double"/>
  410. <line text="@type System"/>
  411. <line text="@cons String"/>
  412. <line text="@cons String"/>
  413. <line text="@method ITDMe2"/>
  414. <line text="@method ITDMe2"/>
  415. <line text="@field ITDMe2"/>
  416. <line text="@field ITDMe2"/>
  417. </stdout>
  418. </run>
  419. </ajc-test>
  420. <!-- ======================================================================================= -->
  421. <!-- Autoboxing tests -->
  422. <!-- ======================================================================================= -->
  423. <ajc-test dir="java5/autoboxing" vm="1.5" title="simple boxing test">
  424. <compile files="AutoboxingB.java,AutoboxingC.java,AutoboxingD.java,AutoboxingF.java,AutoboxingI.java,AutoboxingJ.java,AutoboxingS.java,AutoboxingZ.java,SimpleAutoboxing.java,SimpleAutoboxingAspect.aj"
  425. options="-1.5,-showWeaveInfo">
  426. <message kind="weave" text="Type 'SimpleAutoboxing' (SimpleAutoboxing.java:7) advised by before advice from 'SimpleAutoboxingAspect' (SimpleAutoboxingAspect.aj:8)"/>
  427. <message kind="weave" text="Type 'SimpleAutoboxing' (SimpleAutoboxing.java:7) advised by before advice from 'SimpleAutoboxingAspect' (SimpleAutoboxingAspect.aj:4)"/>
  428. </compile>
  429. <run class="SimpleAutoboxing">
  430. <stderr>
  431. <line text="Matching by Integer:20000"/>
  432. <line text="Matching by int:20000"/>
  433. <line text="method_takes_Integer=20000"/>
  434. </stderr>
  435. </run>
  436. </ajc-test>
  437. <ajc-test dir="java5/autoboxing" vm="1.5" title="integer boxing">
  438. <compile files="AutoboxingB.java,AutoboxingC.java,AutoboxingD.java,AutoboxingF.java,AutoboxingI.java,AutoboxingJ.java,AutoboxingS.java,AutoboxingZ.java,SimpleAutoboxing.java,AspectInteger.aj"
  439. options="-1.5,-showWeaveInfo">
  440. <message kind="weave" text="Type 'AutoboxingI' (AutoboxingI.java:11) advised by before advice from 'AspectInteger' (AspectInteger.aj:8)"/>
  441. <message kind="weave" text="Type 'AutoboxingI' (AutoboxingI.java:11) advised by before advice from 'AspectInteger' (AspectInteger.aj:4)"/>
  442. <message kind="weave" text="Type 'AutoboxingI' (AutoboxingI.java:12) advised by before advice from 'AspectInteger' (AspectInteger.aj:8)"/>
  443. <message kind="weave" text="Type 'AutoboxingI' (AutoboxingI.java:12) advised by before advice from 'AspectInteger' (AspectInteger.aj:4)"/>
  444. <message kind="weave" text="Type 'AutoboxingI' (AutoboxingI.java:13) advised by before advice from 'AspectInteger' (AspectInteger.aj:8)"/>
  445. <message kind="weave" text="Type 'AutoboxingI' (AutoboxingI.java:13) advised by before advice from 'AspectInteger' (AspectInteger.aj:4)"/>
  446. <message kind="weave" text="Type 'AutoboxingI' (AutoboxingI.java:14) advised by before advice from 'AspectInteger' (AspectInteger.aj:8)"/>
  447. <message kind="weave" text="Type 'AutoboxingI' (AutoboxingI.java:14) advised by before advice from 'AspectInteger' (AspectInteger.aj:4)"/>
  448. </compile>
  449. <run class="AutoboxingI">
  450. <stderr>
  451. <line text="Matching by Integer:10000"/>
  452. <line text="Matching by int:10000"/>
  453. <line text="method_takes_Integer=10000"/>
  454. <line text="Matching by Integer:20000"/>
  455. <line text="Matching by int:20000"/>
  456. <line text="method_takes_Integer=20000"/>
  457. <line text="Matching by Integer:30000"/>
  458. <line text="Matching by int:30000"/>
  459. <line text="method_takes_int=30000"/>
  460. <line text="Matching by Integer:40000"/>
  461. <line text="Matching by int:40000"/>
  462. <line text="method_takes_int=40000"/>
  463. </stderr>
  464. </run>
  465. </ajc-test>
  466. <ajc-test dir="java5/autoboxing" vm="1.5" title="char boxing">
  467. <compile files="AutoboxingB.java,AutoboxingC.java,AutoboxingD.java,AutoboxingF.java,AutoboxingI.java,AutoboxingJ.java,AutoboxingS.java,AutoboxingZ.java,SimpleAutoboxing.java,AspectChar.aj"
  468. options="-1.5,-showWeaveInfo">
  469. <message kind="weave" text="Type 'AutoboxingC' (AutoboxingC.java:11) advised by before advice from 'AspectChar' (AspectChar.aj:8)"/>
  470. <message kind="weave" text="Type 'AutoboxingC' (AutoboxingC.java:11) advised by before advice from 'AspectChar' (AspectChar.aj:4)"/>
  471. <message kind="weave" text="Type 'AutoboxingC' (AutoboxingC.java:12) advised by before advice from 'AspectChar' (AspectChar.aj:8)"/>
  472. <message kind="weave" text="Type 'AutoboxingC' (AutoboxingC.java:12) advised by before advice from 'AspectChar' (AspectChar.aj:4)"/>
  473. <message kind="weave" text="Type 'AutoboxingC' (AutoboxingC.java:13) advised by before advice from 'AspectChar' (AspectChar.aj:8)"/>
  474. <message kind="weave" text="Type 'AutoboxingC' (AutoboxingC.java:13) advised by before advice from 'AspectChar' (AspectChar.aj:4)"/>
  475. <message kind="weave" text="Type 'AutoboxingC' (AutoboxingC.java:14) advised by before advice from 'AspectChar' (AspectChar.aj:8)"/>
  476. <message kind="weave" text="Type 'AutoboxingC' (AutoboxingC.java:14) advised by before advice from 'AspectChar' (AspectChar.aj:4)"/>
  477. </compile>
  478. <run class="AutoboxingC">
  479. <stderr>
  480. <line text="Character:1"/>
  481. <line text="char:1"/>
  482. <line text="method_takes_Character=1"/>
  483. <line text="Character:2"/>
  484. <line text="char:2"/>
  485. <line text="method_takes_Character=2"/>
  486. <line text="Character:3"/>
  487. <line text="char:3"/>
  488. <line text="method_takes_char=3"/>
  489. <line text="Character:4"/>
  490. <line text="char:4"/>
  491. <line text="method_takes_char=4"/>
  492. </stderr>
  493. </run>
  494. </ajc-test>
  495. <ajc-test dir="java5/autoboxing" vm="1.5" title="double boxing">
  496. <compile files="AutoboxingB.java,AutoboxingC.java,AutoboxingD.java,AutoboxingF.java,AutoboxingI.java,AutoboxingJ.java,AutoboxingS.java,AutoboxingZ.java,SimpleAutoboxing.java,AspectDouble.aj"
  497. options="-1.5,-showWeaveInfo">
  498. <message kind="weave" text="Type 'AutoboxingD' (AutoboxingD.java:11) advised by before advice from 'AspectDouble' (AspectDouble.aj:8)"/>
  499. <message kind="weave" text="Type 'AutoboxingD' (AutoboxingD.java:11) advised by before advice from 'AspectDouble' (AspectDouble.aj:4)"/>
  500. <message kind="weave" text="Type 'AutoboxingD' (AutoboxingD.java:12) advised by before advice from 'AspectDouble' (AspectDouble.aj:8)"/>
  501. <message kind="weave" text="Type 'AutoboxingD' (AutoboxingD.java:12) advised by before advice from 'AspectDouble' (AspectDouble.aj:4)"/>
  502. <message kind="weave" text="Type 'AutoboxingD' (AutoboxingD.java:13) advised by before advice from 'AspectDouble' (AspectDouble.aj:8)"/>
  503. <message kind="weave" text="Type 'AutoboxingD' (AutoboxingD.java:13) advised by before advice from 'AspectDouble' (AspectDouble.aj:4)"/>
  504. <message kind="weave" text="Type 'AutoboxingD' (AutoboxingD.java:14) advised by before advice from 'AspectDouble' (AspectDouble.aj:8)"/>
  505. <message kind="weave" text="Type 'AutoboxingD' (AutoboxingD.java:14) advised by before advice from 'AspectDouble' (AspectDouble.aj:4)"/>
  506. </compile>
  507. <run class="AutoboxingD">
  508. <stderr>
  509. <line text="Double:100.0"/>
  510. <line text="double:100.0"/>
  511. <line text="method_takes_Double=100.0"/>
  512. <line text="Double:200.0"/>
  513. <line text="double:200.0"/>
  514. <line text="method_takes_Double=200.0"/>
  515. <line text="Double:300.0"/>
  516. <line text="double:300.0"/>
  517. <line text="method_takes_double=300.0"/>
  518. <line text="Double:400.0"/>
  519. <line text="double:400.0"/>
  520. <line text="method_takes_double=400.0"/>
  521. </stderr>
  522. </run>
  523. </ajc-test>
  524. <ajc-test dir="java5/autoboxing" vm="1.5" title="float boxing">
  525. <compile files="AutoboxingB.java,AutoboxingC.java,AutoboxingD.java,AutoboxingF.java,AutoboxingI.java,AutoboxingJ.java,AutoboxingS.java,AutoboxingZ.java,SimpleAutoboxing.java,AspectFloat.aj"
  526. options="-1.5,-showWeaveInfo">
  527. <message kind="weave" text="Type 'AutoboxingF' (AutoboxingF.java:11) advised by before advice from 'AspectFloat' (AspectFloat.aj:8)"/>
  528. <message kind="weave" text="Type 'AutoboxingF' (AutoboxingF.java:11) advised by before advice from 'AspectFloat' (AspectFloat.aj:4)"/>
  529. <message kind="weave" text="Type 'AutoboxingF' (AutoboxingF.java:12) advised by before advice from 'AspectFloat' (AspectFloat.aj:8)"/>
  530. <message kind="weave" text="Type 'AutoboxingF' (AutoboxingF.java:12) advised by before advice from 'AspectFloat' (AspectFloat.aj:4)"/>
  531. <message kind="weave" text="Type 'AutoboxingF' (AutoboxingF.java:13) advised by before advice from 'AspectFloat' (AspectFloat.aj:8)"/>
  532. <message kind="weave" text="Type 'AutoboxingF' (AutoboxingF.java:13) advised by before advice from 'AspectFloat' (AspectFloat.aj:4)"/>
  533. <message kind="weave" text="Type 'AutoboxingF' (AutoboxingF.java:14) advised by before advice from 'AspectFloat' (AspectFloat.aj:8)"/>
  534. <message kind="weave" text="Type 'AutoboxingF' (AutoboxingF.java:14) advised by before advice from 'AspectFloat' (AspectFloat.aj:4)"/>
  535. </compile>
  536. <run class="AutoboxingF">
  537. <stderr>
  538. <line text="Float:100.0"/>
  539. <line text="float:100.0"/>
  540. <line text="method_takes_Float=100.0"/>
  541. <line text="Float:200.0"/>
  542. <line text="float:200.0"/>
  543. <line text="method_takes_Float=200.0"/>
  544. <line text="Float:300.0"/>
  545. <line text="float:300.0"/>
  546. <line text="method_takes_float=300.0"/>
  547. <line text="Float:400.0"/>
  548. <line text="float:400.0"/>
  549. <line text="method_takes_float=400.0"/>
  550. </stderr>
  551. </run>
  552. </ajc-test>
  553. <ajc-test dir="java5/autoboxing" vm="1.5" title="short boxing">
  554. <compile files="AutoboxingB.java,AutoboxingC.java,AutoboxingD.java,AutoboxingF.java,AutoboxingI.java,AutoboxingJ.java,AutoboxingS.java,AutoboxingZ.java,SimpleAutoboxing.java,AspectShort.aj"
  555. options="-1.5,-showWeaveInfo">
  556. <message kind="weave" text="Type 'AutoboxingS' (AutoboxingS.java:11) advised by before advice from 'AspectShort' (AspectShort.aj:8)"/>
  557. <message kind="weave" text="Type 'AutoboxingS' (AutoboxingS.java:11) advised by before advice from 'AspectShort' (AspectShort.aj:4)"/>
  558. <message kind="weave" text="Type 'AutoboxingS' (AutoboxingS.java:12) advised by before advice from 'AspectShort' (AspectShort.aj:8)"/>
  559. <message kind="weave" text="Type 'AutoboxingS' (AutoboxingS.java:12) advised by before advice from 'AspectShort' (AspectShort.aj:4)"/>
  560. <message kind="weave" text="Type 'AutoboxingS' (AutoboxingS.java:13) advised by before advice from 'AspectShort' (AspectShort.aj:8)"/>
  561. <message kind="weave" text="Type 'AutoboxingS' (AutoboxingS.java:13) advised by before advice from 'AspectShort' (AspectShort.aj:4)"/>
  562. <message kind="weave" text="Type 'AutoboxingS' (AutoboxingS.java:14) advised by before advice from 'AspectShort' (AspectShort.aj:8)"/>
  563. <message kind="weave" text="Type 'AutoboxingS' (AutoboxingS.java:14) advised by before advice from 'AspectShort' (AspectShort.aj:4)"/>
  564. </compile>
  565. <run class="AutoboxingS">
  566. <stderr>
  567. <line text="Short:100"/>
  568. <line text="short:100"/>
  569. <line text="method_takes_Short=100"/>
  570. <line text="Short:200"/>
  571. <line text="short:200"/>
  572. <line text="method_takes_Short=200"/>
  573. <line text="Short:300"/>
  574. <line text="short:300"/>
  575. <line text="method_takes_short=300"/>
  576. <line text="Short:400"/>
  577. <line text="short:400"/>
  578. <line text="method_takes_short=400"/>
  579. </stderr>
  580. </run>
  581. </ajc-test>
  582. <ajc-test dir="java5/autoboxing" vm="1.5" title="long boxing">
  583. <compile files="AutoboxingB.java,AutoboxingC.java,AutoboxingD.java,AutoboxingF.java,AutoboxingI.java,AutoboxingJ.java,AutoboxingS.java,AutoboxingZ.java,SimpleAutoboxing.java,AspectLong.aj"
  584. options="-1.5,-showWeaveInfo">
  585. <message kind="weave" text="Type 'AutoboxingJ' (AutoboxingJ.java:11) advised by before advice from 'AspectLong' (AspectLong.aj:8)"/>
  586. <message kind="weave" text="Type 'AutoboxingJ' (AutoboxingJ.java:11) advised by before advice from 'AspectLong' (AspectLong.aj:4)"/>
  587. <message kind="weave" text="Type 'AutoboxingJ' (AutoboxingJ.java:12) advised by before advice from 'AspectLong' (AspectLong.aj:8)"/>
  588. <message kind="weave" text="Type 'AutoboxingJ' (AutoboxingJ.java:12) advised by before advice from 'AspectLong' (AspectLong.aj:4)"/>
  589. <message kind="weave" text="Type 'AutoboxingJ' (AutoboxingJ.java:13) advised by before advice from 'AspectLong' (AspectLong.aj:8)"/>
  590. <message kind="weave" text="Type 'AutoboxingJ' (AutoboxingJ.java:13) advised by before advice from 'AspectLong' (AspectLong.aj:4)"/>
  591. <message kind="weave" text="Type 'AutoboxingJ' (AutoboxingJ.java:14) advised by before advice from 'AspectLong' (AspectLong.aj:8)"/>
  592. <message kind="weave" text="Type 'AutoboxingJ' (AutoboxingJ.java:14) advised by before advice from 'AspectLong' (AspectLong.aj:4)"/>
  593. </compile>
  594. <run class="AutoboxingJ">
  595. <stderr>
  596. <line text="Long:1000000"/>
  597. <line text="long:1000000"/>
  598. <line text="method_takes_Long=1000000"/>
  599. <line text="Long:2000000"/>
  600. <line text="long:2000000"/>
  601. <line text="method_takes_Long=2000000"/>
  602. <line text="Long:3000000"/>
  603. <line text="long:3000000"/>
  604. <line text="method_takes_long=3000000"/>
  605. <line text="Long:4000000"/>
  606. <line text="long:4000000"/>
  607. <line text="method_takes_long=4000000"/>
  608. </stderr>
  609. </run>
  610. </ajc-test>
  611. <ajc-test dir="java5/autoboxing" vm="1.5" title="boolean boxing">
  612. <compile files="AutoboxingB.java,AutoboxingC.java,AutoboxingD.java,AutoboxingF.java,AutoboxingI.java,AutoboxingJ.java,AutoboxingS.java,AutoboxingZ.java,SimpleAutoboxing.java,AspectBoolean.aj"
  613. options="-1.5,-showWeaveInfo">
  614. <message kind="weave" text="Type 'AutoboxingZ' (AutoboxingZ.java:9) advised by before advice from 'AspectBoolean' (AspectBoolean.aj:8)"/>
  615. <message kind="weave" text="Type 'AutoboxingZ' (AutoboxingZ.java:9) advised by before advice from 'AspectBoolean' (AspectBoolean.aj:4)"/>
  616. <message kind="weave" text="Type 'AutoboxingZ' (AutoboxingZ.java:10) advised by before advice from 'AspectBoolean' (AspectBoolean.aj:8)"/>
  617. <message kind="weave" text="Type 'AutoboxingZ' (AutoboxingZ.java:10) advised by before advice from 'AspectBoolean' (AspectBoolean.aj:4)"/>
  618. <message kind="weave" text="Type 'AutoboxingZ' (AutoboxingZ.java:11) advised by before advice from 'AspectBoolean' (AspectBoolean.aj:8)"/>
  619. <message kind="weave" text="Type 'AutoboxingZ' (AutoboxingZ.java:11) advised by before advice from 'AspectBoolean' (AspectBoolean.aj:4)"/>
  620. <message kind="weave" text="Type 'AutoboxingZ' (AutoboxingZ.java:12) advised by before advice from 'AspectBoolean' (AspectBoolean.aj:8)"/>
  621. <message kind="weave" text="Type 'AutoboxingZ' (AutoboxingZ.java:12) advised by before advice from 'AspectBoolean' (AspectBoolean.aj:4)"/>
  622. </compile>
  623. <run class="AutoboxingZ">
  624. <stderr>
  625. <line text="Boolean:false"/>
  626. <line text="boolean:false"/>
  627. <line text="method_takes_Boolean=false"/>
  628. <line text="Boolean:false"/>
  629. <line text="boolean:false"/>
  630. <line text="method_takes_Boolean=false"/>
  631. <line text="Boolean:false"/>
  632. <line text="boolean:false"/>
  633. <line text="method_takes_boolean=false"/>
  634. <line text="Boolean:false"/>
  635. <line text="boolean:false"/>
  636. <line text="method_takes_boolean=false"/>
  637. </stderr>
  638. </run>
  639. </ajc-test>
  640. <ajc-test dir="java5/autoboxing" vm="1.5" title="byte boxing">
  641. <compile files="AutoboxingB.java,AutoboxingC.java,AutoboxingD.java,AutoboxingF.java,AutoboxingI.java,AutoboxingJ.java,AutoboxingS.java,AutoboxingZ.java,SimpleAutoboxing.java,AspectByte.aj"
  642. options="-1.5,-showWeaveInfo">
  643. <message kind="weave" text="Type 'AutoboxingB' (AutoboxingB.java:11) advised by before advice from 'AspectByte' (AspectByte.aj:8)"/>
  644. <message kind="weave" text="Type 'AutoboxingB' (AutoboxingB.java:11) advised by before advice from 'AspectByte' (AspectByte.aj:4)"/>
  645. <message kind="weave" text="Type 'AutoboxingB' (AutoboxingB.java:12) advised by before advice from 'AspectByte' (AspectByte.aj:8)"/>
  646. <message kind="weave" text="Type 'AutoboxingB' (AutoboxingB.java:12) advised by before advice from 'AspectByte' (AspectByte.aj:4)"/>
  647. <message kind="weave" text="Type 'AutoboxingB' (AutoboxingB.java:13) advised by before advice from 'AspectByte' (AspectByte.aj:8)"/>
  648. <message kind="weave" text="Type 'AutoboxingB' (AutoboxingB.java:13) advised by before advice from 'AspectByte' (AspectByte.aj:4)"/>
  649. <message kind="weave" text="Type 'AutoboxingB' (AutoboxingB.java:14) advised by before advice from 'AspectByte' (AspectByte.aj:8)"/>
  650. <message kind="weave" text="Type 'AutoboxingB' (AutoboxingB.java:14) advised by before advice from 'AspectByte' (AspectByte.aj:4)"/>
  651. </compile>
  652. <run class="AutoboxingB">
  653. <stderr>
  654. <line text="Byte:1"/>
  655. <line text="byte:1"/>
  656. <line text="method_takes_Byte=1"/>
  657. <line text="Byte:50"/>
  658. <line text="byte:50"/>
  659. <line text="method_takes_Byte=50"/>
  660. <line text="Byte:3"/>
  661. <line text="byte:3"/>
  662. <line text="method_takes_byte=3"/>
  663. <line text="Byte:52"/>
  664. <line text="byte:52"/>
  665. <line text="method_takes_byte=52"/>
  666. </stderr>
  667. </run>
  668. </ajc-test>
  669. <ajc-test dir="java5/autoboxing" vm="1.5" title="boxing in after returning">
  670. <compile files="AutoboxingB.java,AutoboxingC.java,AutoboxingD.java,AutoboxingF.java,AutoboxingI.java,AutoboxingJ.java,AutoboxingS.java,AutoboxingZ.java,SimpleAutoboxing.java,AspectAfterReturning.aj"
  671. options="-1.5,-showWeaveInfo">
  672. <message kind="weave" text="Type 'AspectAfterReturning' (AspectAfterReturning.aj:18) advised by afterReturning advice from 'AspectAfterReturning' (AspectAfterReturning.aj:4)"/>
  673. <message kind="weave" text="Type 'AspectAfterReturning' (AspectAfterReturning.aj:18) advised by afterReturning advice from 'AspectAfterReturning' (AspectAfterReturning.aj:8)"/>
  674. <message kind="weave" text="Type 'AspectAfterReturning' (AspectAfterReturning.aj:18) advised by afterReturning advice from 'AspectAfterReturning' (AspectAfterReturning.aj:12)"/>
  675. <message kind="weave" text="Type 'AspectAfterReturning' (AspectAfterReturning.aj:19) advised by afterReturning advice from 'AspectAfterReturning' (AspectAfterReturning.aj:4)"/>
  676. <message kind="weave" text="Type 'AspectAfterReturning' (AspectAfterReturning.aj:19) advised by afterReturning advice from 'AspectAfterReturning' (AspectAfterReturning.aj:8)"/>
  677. <message kind="weave" text="Type 'AspectAfterReturning' (AspectAfterReturning.aj:19) advised by afterReturning advice from 'AspectAfterReturning' (AspectAfterReturning.aj:12)"/>
  678. </compile>
  679. <run class="AspectAfterReturning">
  680. <stderr>
  681. <line text="Returning I=5"/>
  682. <line text="Returning Integer=5"/>
  683. <line text="Returning Object=5"/>
  684. <line text="Returning I=10"/>
  685. <line text="Returning Integer=10"/>
  686. <line text="Returning Object=10"/>
  687. </stderr>
  688. </run>
  689. </ajc-test>
  690. <!-- ======================================================================================= -->
  691. <!-- Covariance tests -->
  692. <!-- ======================================================================================= -->
  693. <ajc-test dir="java5/covariance" vm="1.5" title="covariance 1">
  694. <compile options="-1.5,-showWeaveInfo" files="CovBaseProgram01.java,CovAspect01.aj">
  695. <message kind="weave" text="Type 'CovBaseProgram01' (CovBaseProgram01.java:26) advised by before advice from 'CovAspect01' (CovAspect01.aj:5)"/>
  696. <message kind="weave" text="Type 'CovBaseProgram01' (CovBaseProgram01.java:27) advised by before advice from 'CovAspect01' (CovAspect01.aj:5)"/>
  697. </compile>
  698. </ajc-test>
  699. <ajc-test dir="java5/covariance" vm="1.5" title="covariance 2">
  700. <compile options="-1.5,-showWeaveInfo" files="CovBaseProgram01.java,CovAspect02.aj">
  701. <message kind="weave" text="Type 'CovBaseProgram01' (CovBaseProgram01.java:26) advised by before advice from 'CovAspect02' (CovAspect02.aj:5)"/>
  702. <message kind="weave" text="Type 'CovBaseProgram01' (CovBaseProgram01.java:27) advised by before advice from 'CovAspect02' (CovAspect02.aj:5)"/>
  703. </compile>
  704. </ajc-test>
  705. <ajc-test dir="java5/covariance" vm="1.5" title="covariance 3">
  706. <compile options="-1.5,-showWeaveInfo" files="CovBaseProgram01.java,CovAspect03.aj">
  707. <message kind="weave" text="Type 'CovBaseProgram01' (CovBaseProgram01.java:26) advised by before advice from 'CovAspect03' (CovAspect03.aj:5)"/>
  708. <message kind="weave" text="Type 'CovBaseProgram01' (CovBaseProgram01.java:27) advised by before advice from 'CovAspect03' (CovAspect03.aj:5)"/>
  709. </compile>
  710. </ajc-test>
  711. <ajc-test dir="java5/covariance" vm="1.5" title="covariance 4">
  712. <compile options="-1.5,-showWeaveInfo" files="CovBaseProgram02.java,CovAspect04.aj">
  713. <message kind="weave" text="Type 'CovBaseProgram02' (CovBaseProgram02.java:30) advised by before advice from 'CovAspect04' (CovAspect04.aj:5)"/>
  714. </compile>
  715. </ajc-test>
  716. <ajc-test dir="java5/covariance" vm="1.5" title="covariance 5">
  717. <compile options="-1.5,-showWeaveInfo" files="CovBaseProgram01.java,CovAspect05.aj">
  718. <message kind="weave" text="Type 'CovBaseProgram01' (CovBaseProgram01.java:26) advised by before advice from 'CovAspect05' (CovAspect05.aj:5)"/>
  719. <message kind="weave" text="Type 'CovBaseProgram01' (CovBaseProgram01.java:27) advised by before advice from 'CovAspect05' (CovAspect05.aj:5)"/>
  720. </compile>
  721. </ajc-test>
  722. <ajc-test dir="java5/covariance" vm="1.5" title="covariance 6">
  723. <compile options="-1.5,-showWeaveInfo" files="CovBaseProgram01.java,CovAspect06.aj">
  724. <message kind="warning" line="3" text="does not match because declaring type is Super"/>
  725. </compile>
  726. </ajc-test>
  727. <ajc-test dir="java5/covariance" vm="1.5" title="covariance 7">
  728. <compile options="-1.5,-showWeaveInfo" files="CovBaseProgram01.java,CovAspect07.aj">
  729. <message kind="weave" text="Type 'CovBaseProgram01' (CovBaseProgram01.java:27) advised by before advice from 'CovAspect07' (CovAspect07.aj:5)"/>
  730. <message kind="warning" line="3" text="does not match because declaring type is Super"/>
  731. </compile>
  732. </ajc-test>
  733. <ajc-test dir="java5/covariance" vm="1.5" title="covariance 8">
  734. <compile options="-1.5,-showWeaveInfo" files="CovBaseProgram01.java,CovAspect08.aj">
  735. <message kind="weave" text="Type 'CovBaseProgram01' (CovBaseProgram01.java:27) advised by before advice from 'CovAspect08' (CovAspect08.aj:11)"/>
  736. <message kind="weave" text="Type 'CovBaseProgram01' (CovBaseProgram01.java:27) advised by before advice from 'CovAspect08' (CovAspect08.aj:5)"/>
  737. </compile>
  738. </ajc-test>
  739. <ajc-test dir="java5/covariance" vm="1.5" title="covariance 9">
  740. <compile options="-1.5,-showWeaveInfo" files="CovBaseProgram01.java,CovAspect09.aj">
  741. </compile>
  742. </ajc-test>
  743. <ajc-test dir="java5/covariance" vm="1.5" title="covariance 10">
  744. <compile options="-1.5,-showWeaveInfo" files="CovBaseProgram01.java,CovAspect10.aj">
  745. <message kind="weave" text="Type 'CovBaseProgram01' (CovBaseProgram01.java:26) advised by before advice from 'CovAspect10' (CovAspect10.aj:5)"/>
  746. <message kind="weave" text="Type 'CovBaseProgram01' (CovBaseProgram01.java:27) advised by before advice from 'CovAspect10' (CovAspect10.aj:5)"/>
  747. </compile>
  748. </ajc-test>
  749. <!-- ======================================================================================= -->
  750. <!-- Enum tests -->
  751. <!-- ======================================================================================= -->
  752. <ajc-test dir="java5/enums" vm="1.5" title="cant itd constructor on enum">
  753. <compile files="SimpleEnum.java,SimpleEnum2.java,EnumAspect01.aj" options="-1.5">
  754. <message kind="error" line="2" text="can't make inter-type constructor declarations on enum types"/>
  755. </compile>
  756. </ajc-test>
  757. <ajc-test dir="java5/enums" vm="1.5" title="cant itd field or method on enum">
  758. <compile files="SimpleEnum.java,SimpleEnum2.java,EnumAspect02.aj" options="-1.5">
  759. <message kind="error" line="2" text="can't make inter-type method declarations on enum types"/>
  760. <message kind="error" line="6" text="can't make inter-type field declarations on enum types"/>
  761. </compile>
  762. </ajc-test>
  763. <ajc-test dir="java5/enums" vm="1.5" title="declare parents and enums">
  764. <compile files="SimpleEnum.java,SimpleEnum2.java,EnumAspect03.aj" options="-1.5">
  765. <message kind="error" line="5" text="can't use declare parents to make enum type SimpleEnum implement an interface"/>
  766. <message kind="error" line="8" text="can't use declare parents to alter supertype of enum type SimpleEnum"/>
  767. <message kind="error" line="11" text="can't use declare parents to make 'java.lang.Enum' the parent of type EnumAspect03$D"/>
  768. </compile>
  769. </ajc-test>
  770. <ajc-test dir="java5/enums" vm="1.5" title="wildcard enum match in itd">
  771. <compile files="SimpleEnum.java,SimpleEnum2.java,EnumAspect04.aj" options="-1.5">
  772. <message kind="warning" line="5" text="enum type SimpleEnum2 matches a declare parents type pattern but is being ignored"/>
  773. <message kind="warning" line="5" text="enum type SimpleEnum matches a declare parents type pattern but is being ignored"/>
  774. </compile>
  775. </ajc-test>
  776. <!-- ======================================================================================= -->
  777. <!-- pertypewithin tests -->
  778. <!-- ======================================================================================= -->
  779. <ajc-test dir="java5/pertypewithin" title="basic ptw test">
  780. <compile files="A.java,B.java,C.java,D.java,Main.java,X.java"/>
  781. <run class="p.A">
  782. <stderr>
  783. <line text="hi from A"/>
  784. <line text="after() returning from a method call to sayhi()"/>
  785. <line text="hi from A"/>
  786. <line text="after() returning from a method call to sayhi()"/>
  787. <line text="Tests in A have passed"/>
  788. <line text="callcount = 2"/>
  789. </stderr>
  790. </run>
  791. </ajc-test>
  792. <ajc-test dir="java5/pertypewithin" title="ptw hasAspect">
  793. <compile files="A.java,B.java,C.java,D.java,Main.java,X.java"/>
  794. <run class="p.B">
  795. <stderr>
  796. <line text="hi from B"/>
  797. <line text="after() returning from a method call to sayhi()"/>
  798. <line text="hi from B"/>
  799. <line text="after() returning from a method call to sayhi()"/>
  800. <line text="hi from B"/>
  801. <line text="after() returning from a method call to sayhi()"/>
  802. <line text="callcount = 3"/>
  803. </stderr>
  804. </run>
  805. </ajc-test>
  806. <ajc-test dir="java5/pertypewithin" title="ptw aspectOf">
  807. <compile files="A.java,B.java,C.java,D.java,Main.java,X.java"/>
  808. <run class="p.C"/>
  809. </ajc-test>
  810. <ajc-test dir="java5/pertypewithin" title="ptw multi-aspects">
  811. <compile files="P.java,Q.java,R.java"/>
  812. <run class="P">
  813. <stderr>
  814. <line text="Q reporting 2"/>
  815. <line text="R reporting 3"/>
  816. </stderr>
  817. </run>
  818. </ajc-test>
  819. <ajc-test dir="java5/pertypewithin" title="ptw binary">
  820. <weave classesFiles="G.java" aspectsFiles="H.java"/>
  821. <run class="G">
  822. <stderr>
  823. <line text="advice running"/>
  824. </stderr>
  825. </run>
  826. </ajc-test>
  827. <ajc-test dir="java5/pertypewithin" title="ptw binary aspect">
  828. <compile files="H.java" outjar="aspects.jar">
  829. <message kind="warning" line="1" text="no match for this type name: G"/>
  830. </compile>
  831. <compile files="G.java" aspectpath="aspects.jar"/>
  832. <run class="G">
  833. <stderr>
  834. <line text="advice running"/>
  835. </stderr>
  836. </run>
  837. </ajc-test>
  838. <!-- ======================================================================================= -->
  839. <!-- varargs tests -->
  840. <!-- ======================================================================================= -->
  841. <ajc-test dir="java5/varargs" vm="1.5" title="varargs not matched by Object[] (call)">
  842. <compile files="SimpleVarargs.java,VarargsAspect01.aj" options="-1.5,-showWeaveInfo">
  843. </compile>
  844. </ajc-test>
  845. <ajc-test dir="java5/varargs" vm="1.5" title="varargs not matched by Object[] (exe)">
  846. <compile files="SimpleVarargs.java,VarargsAspect02.aj" options="-1.5,-showWeaveInfo">
  847. </compile>
  848. </ajc-test>
  849. <ajc-test dir="java5/varargs" vm="1.5" title="varargs not matched by Object[] (init)">
  850. <compile files="SimpleVarargs.java,VarargsAspect03.aj" options="-1.5,-showWeaveInfo">
  851. </compile>
  852. </ajc-test>
  853. <ajc-test dir="java5/varargs" vm="1.5" title="varargs not matched by Object[] (withincode)">
  854. <compile files="SimpleVarargs.java,VarargsAspect04.aj" options="-1.5,-showWeaveInfo">
  855. </compile>
  856. </ajc-test>
  857. <ajc-test dir="java5/varargs" vm="1.5" title="call with varargs signature">
  858. <compile files="SimpleVarargs.java,VarargsAspect05.aj" options="-1.5,-showWeaveInfo">
  859. <message kind="weave" text="Type 'SimpleVarargs' (SimpleVarargs.java:20) advised by before advice from 'VarargsAspect05' (VarargsAspect05.aj:3)"/>
  860. <message kind="weave" text="Type 'SimpleVarargs' (SimpleVarargs.java:21) advised by before advice from 'VarargsAspect05' (VarargsAspect05.aj:3)"/>
  861. <message kind="weave" text="Type 'SimpleVarargs' (SimpleVarargs.java:22) advised by before advice from 'VarargsAspect05' (VarargsAspect05.aj:3)"/>
  862. </compile>
  863. </ajc-test>
  864. <ajc-test dir="java5/varargs" vm="1.5" title="call with varargs multi-signature">
  865. <compile files="SimpleVarargs.java,VarargsAspect06.aj" options="-1.5,-showWeaveInfo">
  866. <message kind="weave" text="Type 'SimpleVarargs' (SimpleVarargs.java:25) advised by before advice from 'VarargsAspect06' (VarargsAspect06.aj:3)"/>
  867. <message kind="weave" text="Type 'SimpleVarargs' (SimpleVarargs.java:26) advised by before advice from 'VarargsAspect06' (VarargsAspect06.aj:3)"/>
  868. <message kind="weave" text="Type 'SimpleVarargs' (SimpleVarargs.java:27) advised by before advice from 'VarargsAspect06' (VarargsAspect06.aj:3)"/>
  869. </compile>
  870. </ajc-test>
  871. <ajc-test dir="java5/suppressedWarnings" vm="1.5" title="suppressing non-matching advice warnings">
  872. <compile files="Suppression1.aj" options="-1.5,-showWeaveInfo">
  873. <message kind="warning" line="13"/>
  874. <message kind="warning" line="21"/>
  875. </compile>
  876. </ajc-test>
  877. <ajc-test dir="java5/suppressedWarnings" vm="1.5" title="suppressing non-matching advice warnings when multiple source files involved">
  878. <compile files="A.java,A1.aj,A2.aj,A3.aj" options="-1.5,-showWeaveInfo">
  879. <message kind="warning" line="4" file="A1.aj"/>
  880. <message kind="warning" line="4" file="A2.aj"/>
  881. <message kind="warning" line="11" file="A2.aj"/>
  882. <message kind="warning" line="4" file="A3.aj"/>
  883. <message kind="warning" line="11" file="A3.aj"/>
  884. </compile>
  885. </ajc-test>
  886. <!-- ======================================================================================= -->
  887. <!-- annotated aspect members -->
  888. <!-- ======================================================================================= -->
  889. <ajc-test dir="java5/annotations/aspectMembers" title="annotated annotations (@Target)">
  890. <compile files="a/Annotations.java,a/Foo.java" options="-1.5">
  891. <message kind="error" line="16" text="The annotation @MethodAnnotation is disallowed for this location"/>
  892. </compile>
  893. </ajc-test>
  894. <ajc-test dir="java5/annotations/aspectMembers" title="simple annotated aspect members">
  895. <compile files="a/Annotations.java,a/AnnotatedAspect.aj" options="-1.5">
  896. <message kind="warning" line="4" text="annotated type"/>
  897. <message kind="warning" line="6" text="annotated field"/>
  898. <message kind="warning" line="8" text="annotated method"/>
  899. <message kind="warning" line="11" text="annotated constructor"/>
  900. </compile>
  901. </ajc-test>
  902. <ajc-test dir="java5/annotations/aspectMembers" title="simple annotated aspect members with bad target">
  903. <compile files="a/Annotations.java,a/AnnotatedAspect02.aj" options="-1.5">
  904. <message kind="error" line="3" text="The annotation @MethodAnnotation is disallowed for this location"/>
  905. <message kind="error" line="6" text="The annotation @TypeAnnotation is disallowed for this location"/>
  906. <message kind="error" line="8" text="The annotation @FieldAnnotation is disallowed for this location"/>
  907. <message kind="error" line="10" text="The annotation @AnnotationAnnotation is disallowed for this location"/>
  908. </compile>
  909. </ajc-test>
  910. <ajc-test dir="java5/annotations/aspectMembers" title="annotated itds">
  911. <compile files="a/Annotations.java,a/AnnotatedAspect03.aj" options="-1.5">
  912. <message kind="warning" line="4" text="annotated type"/>
  913. <message kind="warning" line="6" text="annotated field"/>
  914. <message kind="warning" line="8" text="annotated field"/>
  915. <message kind="warning" line="10" text="annotated method"/>
  916. <message kind="warning" line="12" text="annotated constructor"/>
  917. </compile>
  918. </ajc-test>
  919. <ajc-test dir="java5/annotations/aspectMembers" title="annotated itds with bad target">
  920. <compile files="a/Annotations.java,a/AnnotatedAspect04.aj" options="-1.5">
  921. <message kind="error" line="6" text="The annotation @ConstructorAnnotation is disallowed for this location"/>
  922. <message kind="error" line="8" text="The annotation @FieldAnnotation is disallowed for this location"/>
  923. <message kind="error" line="10" text="The annotation @TypeAnnotation is disallowed for this location"/>
  924. <!-- known limitation...
  925. <message kind="error" line="12" text="The annotation @MethodAnnotation is disallowed for this location"/>
  926. -->
  927. </compile>
  928. </ajc-test>
  929. <ajc-test dir="java5/annotations/aspectMembers" title="annotated advice">
  930. <compile files="a/Annotations.java,a/AnnotatedAspect05.aj" options="-1.5">
  931. <message kind="warning" line="17"/>
  932. </compile>
  933. <run class="a.AnnotatedAspect05"/>
  934. </ajc-test>
  935. <ajc-test dir="java5/annotations/aspectMembers" title="annotated advice with bad target">
  936. <compile files="a/Annotations.java,a/AnnotatedAspect06.aj" options="-1.5">
  937. <message kind="error" line="6" text="The annotation @ConstructorAnnotation is disallowed for this location"/>
  938. </compile>
  939. </ajc-test>
  940. <ajc-test dir="java5/annotations/aspectMembers" title="annotated pointcut">
  941. <compile files="a/Annotations.java,a/AnnotatedAspect07.aj" options="-1.5">
  942. </compile>
  943. </ajc-test>
  944. <ajc-test dir="java5/annotations/aspectMembers" title="annotated declare statements">
  945. <compile files="a/Annotations.java,a/AnnotatedAspect08.aj" options="-1.5">
  946. </compile>
  947. </ajc-test>
  948. <!-- ======================================================================================= -->
  949. <!-- ajdk examples -->
  950. <!-- ======================================================================================= -->
  951. <ajc-test dir="java5/annotations/ajdkExamples" title="ajdk: annotating aspects chapter">
  952. <compile files="AnnotatingAspects.aj" options="-1.5">
  953. </compile>
  954. </ajc-test>
  955. <ajc-test dir="java5/annotations/ajdkExamples" title="ajdk: annotating aspects chapter, ex 2">
  956. <compile files="SuppressAj.aj" options="-1.5">
  957. </compile>
  958. </ajc-test>
  959. <ajc-test dir="java5/annotations/ajdkExamples" title="ajdk: annotation pattern matching">
  960. <compile files="AnnotationPatternMatching.aj,org/xyz/OrgXYZAnnotation.java" options="-1.5">
  961. <message kind="warning" line="25" text="@Immutable"/>
  962. <message kind="warning" line="25" text="!@Persistent"/>
  963. <message kind="warning" line="29" text="!@Persistent"/>
  964. <message kind="warning" line="31" text="!@Persistent"/>
  965. <message kind="warning" line="33" text="!@Persistent"/>
  966. <message kind="warning" line="29" text="@Foo @Goo"/>
  967. <message kind="warning" line="29" text="@(Foo || Goo)"/>
  968. <message kind="warning" line="31" text="@(Foo || Goo)"/>
  969. <message kind="warning" line="33" text="@(org.xyz..*)"/>
  970. </compile>
  971. </ajc-test>
  972. <ajc-test dir="java5/annotations/ajdkExamples" title="ajdk: annotation type pattern matching">
  973. <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">
  974. <message kind="warning" line="23" text="(@Immutable *)"/>
  975. <message kind="warning" line="32" text="(@Immutable *)"/>
  976. <message kind="warning" line="3" text="(@Immutable *)"/>
  977. <message kind="warning" line="5" text="(@Immutable *)"/>
  978. <message kind="warning" line="8" text="(@Immutable *)"/>
  979. <message kind="warning" line="25" text="(!@Immutable *)"/>
  980. <message kind="warning" line="27" text="(!@Immutable *)"/>
  981. <message kind="warning" line="29" text="(!@Immutable *)"/>
  982. <message kind="warning" line="5" text="(!@Immutable *)"/>
  983. <message kind="warning" line="6" text="(!@Immutable *)"/>
  984. <message kind="warning" line="2" text="(!@Immutable *)"/>
  985. <message kind="warning" line="2" text="(!@Immutable *)"/>
  986. <message kind="warning" line="5" text="(!@Immutable *)"/>
  987. <message kind="warning" line="3" text="@Immutable (org.xyz.* || org.abc.*)"/>
  988. <message kind="warning" line="5" text="@Immutable (org.xyz.* || org.abc.*)"/>
  989. <message kind="warning" line="8" text="@Immutable (org.xyz.* || org.abc.*)"/>
  990. <message kind="warning" line="32" text="((@Immutable Foo+) || Goo)"/>
  991. <message kind="warning" line="27" text="((@Immutable Foo+) || Goo)"/>
  992. <message kind="warning" line="3" text="@(Immutable || NonPersistent) org.xyz..*"/>
  993. <message kind="warning" line="6" text="@(Immutable || NonPersistent) org.xyz..*"/>
  994. <message kind="warning" line="8" text="@(Immutable || NonPersistent) org.xyz..*"/>
  995. <message kind="warning" line="8" text="@Immutable @NonPersistent org.xyz..*"/>
  996. <message kind="warning" line="6" text="@(@Inherited *) org.xyz..*"/>
  997. <message kind="warning" line="8" text="@(@Inherited *) org.xyz..*"/>
  998. </compile>
  999. </ajc-test>
  1000. <ajc-test dir="java5/annotations/ajdkExamples" title="ajdk: annotations in sig patterns">
  1001. <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">
  1002. <message kind="warning" line="32" text="@SensitiveData * *"/>
  1003. <message kind="warning" line="7" text="@SensitiveData * *"/>
  1004. <message kind="warning" line="13" text="@SensitiveData * *"/>
  1005. <message kind="warning" line="7" text="@SensitiveData List org.xyz..*.*"/>
  1006. <message kind="warning" line="11" text="(@SensitiveData *) org.xyz..*.*"/>
  1007. <message kind="warning" line="13" text="(@SensitiveData *) org.xyz..*.*"/>
  1008. <message kind="warning" line="50" text="@Foo (@Goo *) (@Hoo *).*"/>
  1009. <message kind="warning" line="38" text="@Persisted @Classified * *"/>
  1010. <message kind="warning" line="44" text="@Oneway * *(..)"/>
  1011. <message kind="warning" line="18" text="@Transaction * (@Persisted org.xyz..*).*(..)"/>
  1012. <message kind="warning" line="52" text="* *.*(@Immutable *,..)"/>
  1013. <message kind="warning" line="53" text="* *.*(@Immutable *,..)"/>
  1014. <message kind="warning" line="54" text="* *.*(@Immutable *,..)"/>
  1015. <message kind="warning" line="62" text="within(@Secure *)"/>
  1016. <message kind="warning" line="63" text="within(@Secure *)"/>
  1017. <message kind="warning" line="66" text="staticinitialization(@Persisted *)"/>
  1018. <message kind="warning" line="17" text="staticinitialization(@Persisted *)"/>
  1019. <message kind="warning" line="56" text="call(@Oneway * *(..))"/>
  1020. <message kind="warning" line="28" text="execution(public (@Immutable *) org.xyz..*.*(..))"/>
  1021. <message kind="warning" line="26" text="set(@Cachable * *)"/>
  1022. <message kind="warning" line="80" text="handler(!@Catastrophic *)"/>
  1023. </compile>
  1024. </ajc-test>
  1025. <ajc-test dir="java5/annotations/ajdkExamples" title="ajdk: runtime annotations">
  1026. <compile files="RuntimeTypeMatching.aj" options="-1.5">
  1027. <message kind="warning" line="121" text="@within(Foo)"/>
  1028. <message kind="warning" line="122" text="@within(Foo)"/>
  1029. </compile>
  1030. <run class="RuntimeTypeMatching">
  1031. <stdout>
  1032. <line text="This information is TOP-SECRET"/>
  1033. <line text="@target(Classified) at call(void A.a())"/>
  1034. <line text="@this(Foo) at execution(void B.b())"/>
  1035. <line text="Classified data being passed at call(void B.callA(A))"/>
  1036. <line text="Classified data being passed at execution(void B.callA(A))"/>
  1037. <line text="This information is TOP-SECRET"/>
  1038. <line text="@target(Classified) at call(Class java.lang.Object.getClass())"/>
  1039. <line text="1 @Foo()"/>
  1040. <line text="1 @Foo()"/>
  1041. <line text="1 @Classified(classification=TOP-SECRET)"/>
  1042. <line text="This information is TOP-SECRET"/>
  1043. <line text="Entering critical join point with priority 3"/>
  1044. <line text="Entering critical join point with reflectively obtained priority 3"/>
  1045. <line text="@target(Classified) at call(void A.a())"/>
  1046. <line text="@this(Foo) at execution(void B.callA(A))"/>
  1047. <line text="(Class) Transaction required at execution(void ByeByeEJB.method1())"/>
  1048. <line text="(Method) Transaction required at execution(void ByeByeEJB.method1())"/>
  1049. <line text="(Class) Transaction required at execution(void ByeByeEJB.method2())"/>
  1050. <line text="(Method) Transaction required at execution(void ByeByeEJB.method2())"/>
  1051. <line text="(Class) Transaction required at execution(void ByeByeEJB.method3())"/>
  1052. </stdout>
  1053. </run>
  1054. </ajc-test>
  1055. <ajc-test dir="java5/annotations/ajdkExamples" title="ajdk: @retention checking">
  1056. <compile files="RetentionTime.aj" options="-1.5">
  1057. <message kind="error" line="8" text="Annotation type Goo does not have runtime retention"/>
  1058. <message kind="error" line="13" text="Annotation type Goo does not have runtime retention"/>
  1059. <message kind="error" line="18" text="Annotation type Goo does not have runtime retention"/>
  1060. </compile>
  1061. </ajc-test>
  1062. <ajc-test dir="java5/annotations/ajdkExamples" title="ajdk: @inherited">
  1063. <compile files="AnnotationInheritance.aj" options="-1.5">
  1064. <message kind="warning" line="16" text="annotatedMethodCall()"/>
  1065. <message kind="warning" line="16" text="c1MethodCall()"/>
  1066. <message kind="warning" line="17" text="c1MethodCall()"/>
  1067. </compile>
  1068. </ajc-test>
  1069. <ajc-test dir="java5/annotations/ajdkExamples" title="ajdk: deow-ann">
  1070. <compile files="DeclaresWithAnnotations.aj,org/xyz/model/Model.java" options="-1.5">
  1071. <message kind="warning" line="27" text="Expensive operation called from within performance critical section"/>
  1072. <message kind="error" line="26" text="Untrusted code should not call the model classes directly"/>
  1073. </compile>
  1074. </ajc-test>
  1075. <ajc-test dir="java5/annotations/ajdkExamples" title="ajdk: decp-ann">
  1076. <compile files="DecpAnnotations.aj" options="-1.5">
  1077. </compile>
  1078. <run class="DecpAnnotations">
  1079. <stdout>
  1080. <line text="Test Foo is not secured: PASS"/>
  1081. <line text="Test Goo is secured: PASS"/>
  1082. <line text="goo credentials: none"/>
  1083. <line text="Test BankAccount is not secured: PASS"/>
  1084. <line text="Test PrivateBankAccount is not secured: PASS"/>
  1085. <line text="Test BusinessBankAccount is secured: PASS"/>
  1086. </stdout>
  1087. </run>
  1088. </ajc-test>
  1089. <ajc-test dir="java5/annotations/ajdkExamples" title="ajdk: dec precedence">
  1090. <compile files="PrecedenceAnnotations.aj" options="-1.5">
  1091. </compile>
  1092. <run class="PrecedenceAnnotations">
  1093. <stdout>
  1094. <line text="@Security S2"/>
  1095. <line text="S1"/>
  1096. <line text="@Performance P2"/>
  1097. <line text="P1"/>
  1098. </stdout>
  1099. </run>
  1100. </ajc-test>
  1101. <ajc-test dir="java5/annotations/ajdkExamples" title="ajdk: dec annotation">
  1102. <compile files="DeclareAnnotation.aj,org/xyz/model/Model.java" options="-1.5">
  1103. <message kind="warning" line="3" text="@BusinessDomain"/>
  1104. <message kind="warning" line="43" text="@Secured"/>
  1105. <message kind="warning" line="44" text="@Secured"/>
  1106. <message kind="warning" line="55" text="@Secured"/>
  1107. <message kind="warning" line="62" text="@Persisted"/>
  1108. <message kind="warning" line="68" text="@Persisted"/>
  1109. <message kind="warning" line="41" text="@Secured"/>
  1110. <message kind="warning" line="51" text="@Secured"/>
  1111. </compile>
  1112. <run class="DeclareAnnotation"/>
  1113. </ajc-test>
  1114. <ajc-test dir="java5/covariance/ajdk" title="ajdk: covariance">
  1115. <compile files="AJDKExamples.aj" options="-1.5">
  1116. <message kind="warning" line="43" text="call(* whoAreYou())"/>
  1117. <message kind="warning" line="44" text="call(* whoAreYou())"/>
  1118. <message kind="warning" line="43" text="call(* A.whoAreYou())"/>
  1119. <message kind="warning" line="44" text="call(* A.whoAreYou())"/>
  1120. <message kind="warning" line="43" text="call(A whoAreYou())"/>
  1121. <message kind="warning" line="44" text="call(A whoAreYou())"/>
  1122. <message kind="warning" line="44" text="call(A+ B.whoAreYou())"/>
  1123. <message kind="warning" line="44" text="call(B whoAreYou())"/>
  1124. <message kind="warning" line="44" text="call(B B.whoAreYou())"/>
  1125. </compile>
  1126. </ajc-test>
  1127. <ajc-test dir="java5/varargs/ajdk" title="ajdk: varargs">
  1128. <compile files="AJDKExamples.aj,org/xyz/Foo.java,org/xyz/Goo.java,org/xyz/Hoo.java" options="-1.5">
  1129. <message kind="warning" line="8" text="call vararg match"/>
  1130. <message kind="warning" line="14" text="execution vararg match"/>
  1131. <message kind="warning" line="5" text="init vararg match"/>
  1132. <message kind="warning" line="6" text="init vararg match"/>
  1133. <message kind="warning" line="27" text="single vararg"/>
  1134. <message kind="warning" line="28" text="single String[]"/>
  1135. <message kind="warning" line="18" text="single String[]"/>
  1136. </compile>
  1137. <run class="AJDKExamples">
  1138. <stdout>
  1139. <line text="Matched at call(void X.foo(int, String[]))"/>
  1140. </stdout>
  1141. </run>
  1142. </ajc-test>
  1143. <ajc-test dir="java5/pertypewithin/ajdk" title="ajdk: ptw">
  1144. <compile files="AJDKExamples.aj" options="-1.5"/>
  1145. <run class="org.xyz.foo.AJDKExamples">
  1146. <stdout>
  1147. <line text="true"/>
  1148. <line text="true"/>
  1149. <line text="There are 2 As"/>
  1150. <line text="There are 3 Bs"/>
  1151. </stdout>
  1152. </run>
  1153. </ajc-test>
  1154. <!-- ======================================================================================= -->
  1155. <!-- declare annotation -->
  1156. <!-- ======================================================================================= -->
  1157. <ajc-test dir="java5/annotations/declare" title="basic declare annotation parse test">
  1158. <compile files="BasicParseTest.aj" options="-1.5">
  1159. </compile>
  1160. </ajc-test>
  1161. <!-- ======================================================================================= -->
  1162. <!-- declare annotation (@type) -->
  1163. <!-- ======================================================================================= -->
  1164. <ajc-test dir="java5/annotations/declare" title="declare @type 1">
  1165. <compile files="DecaType1.java" options="-1.5"/>
  1166. <run class="DecaType1">
  1167. <stderr>
  1168. <line text="annotation is @MyAnnotation()"/>
  1169. </stderr>
  1170. </run>
  1171. </ajc-test>
  1172. <ajc-test dir="java5/annotations/declare" title="declare @type 2">
  1173. <compile files="DecaType2.java" options="-1.5,-Xlint:ignore" >
  1174. </compile>
  1175. <run class="DecaType2">
  1176. <stderr>
  1177. <line text="annotation on DecaType2 is @MyAnnotation()"/>
  1178. <line text="annotation on X is @MyAnnotation()"/>
  1179. <line text="annotation on MyAnnotation is @MyAnnotation()"/>
  1180. </stderr>
  1181. </run>
  1182. </ajc-test>
  1183. <ajc-test dir="java5/annotations/declare" title="declare @type - with matching pointcut">
  1184. <compile files="DecaType3.java" options="-1.5"/>
  1185. <run class="DecaType3">
  1186. <stderr>
  1187. <line text="hello world"/>
  1188. <line text="advice running"/>
  1189. </stderr>
  1190. </run>
  1191. </ajc-test>
  1192. <ajc-test dir="java5/annotations/declare" title="declare @type - binary weaving">
  1193. <weave classesFiles="BaseTypes.java"
  1194. aspectsFiles="DecaTypeBin1.aj,Colored.java"
  1195. options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
  1196. </weave>
  1197. <run class="BaseTypes">
  1198. <stderr>
  1199. <line text="Color identified on class X"/>
  1200. <line text="A.m() running"/>
  1201. <line text="A.m() running"/>
  1202. <line text="A.m() running"/>
  1203. </stderr>
  1204. </run>
  1205. </ajc-test>
  1206. <ajc-test dir="java5/annotations/declare" title="declare @type - complex annotation - binary weaving">
  1207. <weave classesFiles="BaseTypes.java" aspectsFiles="DecaTypeBin2.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
  1208. <run class="BaseTypes">
  1209. <stderr>
  1210. <line text="ComplexAnnotation identified on execution(void A.m())"/>
  1211. <line text="A.m() running"/>
  1212. <line text="A.m() running"/>
  1213. <line text="A.m() running"/>
  1214. </stderr>
  1215. </run>
  1216. </ajc-test>
  1217. <ajc-test dir="java5/annotations/declare" title="declare @type - complex annotation - source weaving">
  1218. <compile files="BaseTypes.java,DecaTypeBin2.aj" options="-1.5"/>
  1219. <run class="BaseTypes">
  1220. <stderr>
  1221. <line text="ComplexAnnotation identified on execution(void A.m())"/>
  1222. <line text="A.m() running"/>
  1223. <line text="A.m() running"/>
  1224. <line text="A.m() running"/>
  1225. </stderr>
  1226. </run>
  1227. </ajc-test>
  1228. <ajc-test dir="java5/annotations/declare" title="declare @type - two annotations hit one type - source weaving">
  1229. <compile files="BaseTypes.java,DecaTypeBin3.aj" options="-1.5"/>
  1230. <run class="BaseTypes">
  1231. <stderr>
  1232. <line text="Color identified on execution(void A.m())"/>
  1233. <line text="Fruit identified on execution(void A.m())"/>
  1234. <line text="A.m() running"/>
  1235. <line text="A.m() running"/>
  1236. <line text="A.m() running"/>
  1237. </stderr>
  1238. </run>
  1239. </ajc-test>
  1240. <ajc-test dir="java5/annotations/declare" title="declare @type - two annotations hit one type - binary weaving">
  1241. <weave classesFiles="BaseTypes.java" aspectsFiles="DecaTypeBin3.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
  1242. <run class="BaseTypes">
  1243. <stderr>
  1244. <line text="Color identified on execution(void A.m())"/>
  1245. <line text="Fruit identified on execution(void A.m())"/>
  1246. <line text="A.m() running"/>
  1247. <line text="A.m() running"/>
  1248. <line text="A.m() running"/>
  1249. </stderr>
  1250. </run>
  1251. </ajc-test>
  1252. <ajc-test dir="java5/annotations/declare" title="declare @type - declare parents interactions (order 1) - binary weaving">
  1253. <weave classesFiles="BaseTypes.java" aspectsFiles="DecaDecpInteractions1.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
  1254. <run class="BaseTypes">
  1255. <stderr>
  1256. <line text="Marker interface identified on execution(void A.m())"/>
  1257. <line text="Color annotation identified on execution(void A.m())"/>
  1258. <line text="A.m() running"/>
  1259. <line text="Marker interface identified on execution(void A.m())"/>
  1260. <line text="A.m() running"/>
  1261. <line text="Marker interface identified on execution(void A.m())"/>
  1262. <line text="A.m() running"/>
  1263. </stderr>
  1264. </run>
  1265. </ajc-test>
  1266. <ajc-test dir="java5/annotations/declare" title="declare @type - declare parents interactions (order 1) - source weaving">
  1267. <compile files="BaseTypes.java,DecaDecpInteractions1.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
  1268. <run class="BaseTypes">
  1269. <stderr>
  1270. <line text="Marker interface identified on execution(void A.m())"/>
  1271. <line text="Color annotation identified on execution(void A.m())"/>
  1272. <line text="A.m() running"/>
  1273. <line text="Marker interface identified on execution(void A.m())"/>
  1274. <line text="A.m() running"/>
  1275. <line text="Marker interface identified on execution(void A.m())"/>
  1276. <line text="A.m() running"/>
  1277. </stderr>
  1278. </run>
  1279. </ajc-test>
  1280. <ajc-test dir="java5/annotations/declare" title="declare @type - declare parents interactions (order 2) - binary weaving">
  1281. <weave classesFiles="BaseTypes.java" aspectsFiles="DecaDecpInteractions2.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
  1282. <run class="BaseTypes">
  1283. <stderr>
  1284. <line text="Marker interface identified on execution(void A.m())"/>
  1285. <line text="Color annotation identified on execution(void A.m())"/>
  1286. <line text="A.m() running"/>
  1287. <line text="Marker interface identified on execution(void A.m())"/>
  1288. <line text="A.m() running"/>
  1289. <line text="Marker interface identified on execution(void A.m())"/>
  1290. <line text="A.m() running"/>
  1291. </stderr>
  1292. </run>
  1293. </ajc-test>
  1294. <ajc-test dir="java5/annotations/declare" title="declare @type - declare parents interactions (order 2) - source weaving">
  1295. <compile files="BaseTypes.java,DecaDecpInteractions2.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
  1296. <run class="BaseTypes">
  1297. <stderr>
  1298. <line text="Marker interface identified on execution(void A.m())"/>
  1299. <line text="Color annotation identified on execution(void A.m())"/>
  1300. <line text="A.m() running"/>
  1301. <line text="Marker interface identified on execution(void A.m())"/>
  1302. <line text="A.m() running"/>
  1303. <line text="Marker interface identified on execution(void A.m())"/>
  1304. <line text="A.m() running"/>
  1305. </stderr>
  1306. </run>
  1307. </ajc-test>
  1308. <ajc-test dir="java5/annotations/declare" title="declare @type - declare parents interactions (order 3) - binary weaving">
  1309. <weave classesFiles="BaseTypes.java" aspectsFiles="DecaDecpInteractions3.aj" options="-1.5,-Xlint:ignore"/>
  1310. <run class="BaseTypes">
  1311. <stderr>
  1312. <line text="Marker interface identified on execution(void A.m())"/>
  1313. <line text="Color annotation identified on execution(void A.m())"/>
  1314. <line text="A.m() running"/>
  1315. <line text="Marker interface identified on execution(void A.m())"/>
  1316. <line text="Color annotation identified on execution(void A.m())"/>
  1317. <line text="A.m() running"/>
  1318. <line text="Marker interface identified on execution(void A.m())"/>
  1319. <line text="Color annotation identified on execution(void A.m())"/>
  1320. <line text="A.m() running"/>
  1321. </stderr>
  1322. </run>
  1323. </ajc-test>
  1324. <ajc-test dir="java5/annotations/declare" title="declare @type - declare parents interactions (order 3) - source weaving">
  1325. <compile files="BaseTypes.java,DecaDecpInteractions3.aj" options="-1.5,-Xlint:ignore"/>
  1326. <run class="BaseTypes">
  1327. <stderr>
  1328. <line text="Marker interface identified on execution(void A.m())"/>
  1329. <line text="Color annotation identified on execution(void A.m())"/>
  1330. <line text="A.m() running"/>
  1331. <line text="Marker interface identified on execution(void A.m())"/>
  1332. <line text="Color annotation identified on execution(void A.m())"/>
  1333. <line text="A.m() running"/>
  1334. <line text="Marker interface identified on execution(void A.m())"/>
  1335. <line text="Color annotation identified on execution(void A.m())"/>
  1336. <line text="A.m() running"/>
  1337. </stderr>
  1338. </run>
  1339. </ajc-test>
  1340. <ajc-test dir="java5/annotations/declare" title="declare @type - declare parents interactions (order 4) - binary weaving">
  1341. <weave classesFiles="BaseTypes.java" aspectsFiles="DecaDecpInteractions4.aj" options="-1.5,-Xlint:ignore"/>
  1342. <run class="BaseTypes">
  1343. <stderr>
  1344. <line text="Marker interface identified on execution(void A.m())"/>
  1345. <line text="Color annotation identified on execution(void A.m())"/>
  1346. <line text="A.m() running"/>
  1347. <line text="Marker interface identified on execution(void A.m())"/>
  1348. <line text="Color annotation identified on execution(void A.m())"/>
  1349. <line text="A.m() running"/>
  1350. <line text="Marker interface identified on execution(void A.m())"/>
  1351. <line text="Color annotation identified on execution(void A.m())"/>
  1352. <line text="A.m() running"/>
  1353. </stderr>
  1354. </run>
  1355. </ajc-test>
  1356. <ajc-test dir="java5/annotations/declare" title="declare @type - declare parents interactions (order 4) - source weaving">
  1357. <compile files="BaseTypes.java,DecaDecpInteractions4.aj" options="-1.5,-Xlint:ignore"/>
  1358. <run class="BaseTypes">
  1359. <stderr>
  1360. <line text="Marker interface identified on execution(void A.m())"/>
  1361. <line text="Color annotation identified on execution(void A.m())"/>
  1362. <line text="A.m() running"/>
  1363. <line text="Marker interface identified on execution(void A.m())"/>
  1364. <line text="Color annotation identified on execution(void A.m())"/>
  1365. <line text="A.m() running"/>
  1366. <line text="Marker interface identified on execution(void A.m())"/>
  1367. <line text="Color annotation identified on execution(void A.m())"/>
  1368. <line text="A.m() running"/>
  1369. </stderr>
  1370. </run>
  1371. </ajc-test>
  1372. <ajc-test dir="java5/annotations/declare" title="declare @type - annotating an already annotated type - binary weaving">
  1373. <weave classesFiles="AnnotatedType.java" aspectsFiles="DecaTypeBin4.aj" options="-1.5,-Xlint:ignore"/>
  1374. <run class="AnnotatedType">
  1375. <stderr>
  1376. <line text="Color identified on execution(void AnnotatedType.m())"/>
  1377. <line text="Fruit identified on execution(void AnnotatedType.m())"/>
  1378. <line text="m() running"/>
  1379. </stderr>
  1380. </run>
  1381. </ajc-test>
  1382. <ajc-test dir="java5/annotations/declare" title="declare @type - annotating an already annotated type - source weaving">
  1383. <compile files="AnnotatedType.java,DecaTypeBin4.aj" options="-1.5,-Xlint:ignore"/>
  1384. <run class="AnnotatedType">
  1385. <stderr>
  1386. <line text="Color identified on execution(void AnnotatedType.m())"/>
  1387. <line text="Fruit identified on execution(void AnnotatedType.m())"/>
  1388. <line text="m() running"/>
  1389. </stderr>
  1390. </run>
  1391. </ajc-test>
  1392. <!--ajc-test dir="java5/annotations/declare" title="declare @type - annotations with different targets - binary weaving">
  1393. <weave classesFiles="BaseTypes.java" aspectsFiles="DecaTypeBin5.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
  1394. <message kind="error" line="15" text="The annotation @ColorM is disallowed for this location"/>
  1395. <message kind="error" line="16" text="The annotation @ColorC is disallowed for this location"/>
  1396. <message kind="error" line="18" text="The annotation @ColorF is disallowed for this location"/>
  1397. <message kind="error" line="19" text="The annotation @ColorP is disallowed for this location"/>
  1398. <message kind="error" line="20" text="The annotation @ColorL is disallowed for this location"/>
  1399. <message kind="error" line="21" text="The annotation @ColorPkg is disallowed for this location"/>
  1400. </weave>
  1401. <run class="BaseTypes">
  1402. <stderr>
  1403. <line text="ColorT identified on execution(void A.m())"/>
  1404. <line text="A.m() running"/>
  1405. <line text="A.m() running"/>
  1406. <line text="A.m() running"/>
  1407. </stderr>
  1408. </run>
  1409. </ajc-test-->
  1410. <ajc-test dir="java5/annotations/declare" title="declare @type - annotations with different targets - source weaving">
  1411. <compile files="BaseTypes.java,DecaTypeBin5.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
  1412. <message kind="error" line="15" text="The annotation @ColorM is disallowed for this location"/>
  1413. <message kind="error" line="16" text="The annotation @ColorC is disallowed for this location"/>
  1414. <message king="error" line="17" text="A is not a valid target for annotation ColorA"/>
  1415. <message kind="error" line="18" text="The annotation @ColorF is disallowed for this location"/>
  1416. <message kind="error" line="19" text="The annotation @ColorP is disallowed for this location"/>
  1417. <message kind="error" line="20" text="The annotation @ColorL is disallowed for this location"/>
  1418. <message kind="error" line="21" text="The annotation @ColorPkg is disallowed for this location"/>
  1419. </compile>
  1420. </ajc-test>
  1421. <!--ajc-test dir="java5/annotations/declare" title="declare @type - annotations with different targets (using type patterns) - binary weaving">
  1422. <weave classesFiles="BaseTypes.java" aspectsFiles="DecaTypeBin6.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
  1423. <message kind="warning" line="15" text="A is not a valid target for annotation ColorM"/>
  1424. <message kind="warning" line="16" text="A is not a valid target for annotation ColorC"/>
  1425. <message kind="warning" line="17" text="A is not a valid target for annotation ColorL"/>
  1426. <message kind="warning" line="17" text="B is not a valid target for annotation ColorL"/>
  1427. <message kind="warning" line="17" text="C is not a valid target for annotation ColorL"/>
  1428. </weave>
  1429. <run class="BaseTypes">
  1430. <stderr>
  1431. <line text="ColorT identified on execution(void A.m())"/>
  1432. <line text="A.m() running"/>
  1433. <line text="ColorT identified on execution(void A.m())"/>
  1434. <line text="A.m() running"/>
  1435. <line text="ColorT identified on execution(void A.m())"/>
  1436. <line text="A.m() running"/>
  1437. </stderr>
  1438. </run>
  1439. </ajc-test-->
  1440. <ajc-test dir="java5/annotations/declare" title="declare @type - annotations with different targets (using type patterns) - source weaving">
  1441. <compile files="BaseTypes.java,DecaTypeBin6.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
  1442. <message kind="error" line="15" text="The annotation @ColorM is disallowed for this location"/>
  1443. <message kind="error" line="16" text="The annotation @ColorC is disallowed for this location"/>
  1444. <message kind="error" line="17" text="The annotation @ColorL is disallowed for this location"/>
  1445. <message kind="error" line="18" text="The annotation @ColorF is disallowed for this location"/>
  1446. </compile>
  1447. </ajc-test>
  1448. <ajc-test dir="java5/annotations/declare" title="declare @type - complex decp decAtType interactions - binary weaving">
  1449. <weave classesFiles="BaseTypes.java" aspectsFiles="DecaTypeBin7.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
  1450. </weave>
  1451. <run class="BaseTypes">
  1452. <stderr>
  1453. <line text="Color identified on execution(void A.m())"/>
  1454. <line text="Fruit identified on execution(void A.m())"/>
  1455. <line text="Chocolate identified on execution(void A.m())"/>
  1456. <line text="M1 at execution(void A.m())"/>
  1457. <line text="M2 at execution(void A.m())"/>
  1458. <line text="M3 at execution(void A.m())"/>
  1459. <line text="A.m() running"/>
  1460. <line text="Fruit identified on execution(void B.m())"/>
  1461. <line text="Chocolate identified on execution(void B.m())"/>
  1462. <line text="M1 at execution(void B.m())"/>
  1463. <line text="M2 at execution(void B.m())"/>
  1464. <line text="M3 at execution(void B.m())"/>
  1465. <line text="B.m() running"/>
  1466. <line text="Fruit identified on execution(void C.m())"/>
  1467. <line text="Chocolate identified on execution(void C.m())"/>
  1468. <line text="M1 at execution(void C.m())"/>
  1469. <line text="M2 at execution(void C.m())"/>
  1470. <line text="M3 at execution(void C.m())"/>
  1471. <line text="C.m() running"/>
  1472. </stderr>
  1473. </run>
  1474. </ajc-test>
  1475. <ajc-test dir="java5/annotations/declare" title="declare @type - complex decp decAtType interactions - source weaving">
  1476. <compile files="BaseTypes.java,DecaTypeBin7.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
  1477. <run class="BaseTypes">
  1478. <stderr>
  1479. <line text="Color identified on execution(void A.m())"/>
  1480. <line text="Fruit identified on execution(void A.m())"/>
  1481. <line text="Chocolate identified on execution(void A.m())"/>
  1482. <line text="M1 at execution(void A.m())"/>
  1483. <line text="M2 at execution(void A.m())"/>
  1484. <line text="M3 at execution(void A.m())"/>
  1485. <line text="A.m() running"/>
  1486. <line text="Fruit identified on execution(void B.m())"/>
  1487. <line text="Chocolate identified on execution(void B.m())"/>
  1488. <line text="M1 at execution(void B.m())"/>
  1489. <line text="M2 at execution(void B.m())"/>
  1490. <line text="M3 at execution(void B.m())"/>
  1491. <line text="B.m() running"/>
  1492. <line text="Fruit identified on execution(void C.m())"/>
  1493. <line text="Chocolate identified on execution(void C.m())"/>
  1494. <line text="M1 at execution(void C.m())"/>
  1495. <line text="M2 at execution(void C.m())"/>
  1496. <line text="M3 at execution(void C.m())"/>
  1497. <line text="C.m() running"/>
  1498. </stderr>
  1499. </run>
  1500. </ajc-test>
  1501. <ajc-test dir="java5/annotations/declare" title="declare @type - trying to put annotation targetting annos on normal types - source weaving">
  1502. <compile files="BaseTypes.java,DecaTypeBin8.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
  1503. <message kind="error" line="8" text="A is not a valid target for annotation ColorA"/>
  1504. </compile>
  1505. </ajc-test>
  1506. <ajc-test dir="java5/annotations/declare" title="declare @type - trying to put annotation targetting annos on normal types - binary weaving">
  1507. <weave classesFiles="BaseTypes.java" aspectsFiles="DecaTypeBin8.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
  1508. <message kind="error" line="8" text="A is not a valid target for annotation ColorA"/>
  1509. </weave>
  1510. </ajc-test>
  1511. <ajc-test dir="java5/annotations/declare" title="declare @type - trying to put annotation targetting annos on normal types (uses pattern) - source weaving">
  1512. <compile files="BaseTypes.java,DecaTypeBin9.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
  1513. <message kind="warning" line="8" text="A is not a valid target for annotation ColorA"/>
  1514. </compile>
  1515. </ajc-test>
  1516. <ajc-test dir="java5/annotations/declare" title="declare @type - trying to put annotation targetting annos on normal types (uses pattern) - binary weaving">
  1517. <weave classesFiles="BaseTypes.java" aspectsFiles="DecaTypeBin9.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
  1518. <message kind="warning" line="8" text="A is not a valid target for annotation ColorA"/>
  1519. </weave>
  1520. </ajc-test>
  1521. <ajc-test dir="java5/annotations/declare" title="declare @type - covering enum and class element values - source weaving">
  1522. <compile files="EnumAndClassValues.aj,FunkyAnnotations.java" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
  1523. <run class="FunkyAnnotations">
  1524. <stderr>
  1525. <line text="hello world"/>
  1526. </stderr>
  1527. </run>
  1528. </ajc-test>
  1529. <ajc-test dir="java5/annotations/declare" title="declare @type - covering enum and class element values - binary weaving">
  1530. <weave aspectsFiles="EnumAndClassValues.aj" classesFiles="FunkyAnnotations.java" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
  1531. <run class="FunkyAnnotations">
  1532. <stderr>
  1533. <line text="advice running: Red"/>
  1534. <line text="advice running: class java.lang.Integer"/>
  1535. <line text="method running"/>
  1536. </stderr>
  1537. </run>
  1538. </ajc-test>
  1539. <!-- ======================================================================================= -->
  1540. <!-- declare annotation (@field) -->
  1541. <!-- ======================================================================================= -->
  1542. <ajc-test dir="java5/annotations/declare/atfield" title="declare @field - simple source weaving">
  1543. <compile files="Base.java,Colored.java,AtField1.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
  1544. <run class="Base">
  1545. <stderr>
  1546. <line text="Colored field access at set(int Base.publicIntField)"/>
  1547. </stderr>
  1548. </run>
  1549. </ajc-test>
  1550. <ajc-test dir="java5/annotations/declare/atfield" title="declare @field - simple binary weaving">
  1551. <weave classesFiles="Base.java,Colored.java" aspectsFiles="AtField1.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
  1552. <run class="Base">
  1553. <stderr>
  1554. <line text="Colored field access at set(int Base.publicIntField)"/>
  1555. </stderr>
  1556. </run>
  1557. </ajc-test>
  1558. <ajc-test dir="java5/annotations/declare/atfield" title="declare @field - two the same on one - source weaving">
  1559. <compile files="Base.java,Colored.java,TwoOnOneField.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
  1560. <message kind="warning" text="int Base.publicIntField - already has an annotation of type Colored"/>
  1561. </compile>
  1562. <run class="Base">
  1563. <stderr>
  1564. <line text="Colored field access at set(int Base.publicIntField)"/>
  1565. </stderr>
  1566. </run>
  1567. </ajc-test>
  1568. <ajc-test dir="java5/annotations/declare/atfield" title="declare @field - two the same on one - binary weaving">
  1569. <weave classesFiles="Base.java,Colored.java" aspectsFiles="TwoOnOneField.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
  1570. <message kind="warning" text="int Base.publicIntField - already has an annotation of type Colored"/>
  1571. </weave>
  1572. <run class="Base">
  1573. <stderr>
  1574. <line text="Colored field access at set(int Base.publicIntField)"/>
  1575. </stderr>
  1576. </run>
  1577. </ajc-test>
  1578. <ajc-test dir="java5/annotations/declare/atfield" title="declare @field - two different on one - source weaving">
  1579. <compile files="Base.java,Colored.java,Fruit.java,TwoOnOneField2.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
  1580. </compile>
  1581. <run class="Base">
  1582. <stderr>
  1583. <line text="Colored field access at set(int Base.publicIntField)"/>
  1584. <line text="Fruit field access at set(int Base.publicIntField)"/>
  1585. </stderr>
  1586. </run>
  1587. </ajc-test>
  1588. <ajc-test dir="java5/annotations/declare/atfield" title="declare @field - two different on one - binary weaving">
  1589. <weave classesFiles="Base.java,Colored.java,Fruit.java" aspectsFiles="TwoOnOneField2.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
  1590. </weave>
  1591. <run class="Base">
  1592. <stderr>
  1593. <line text="Colored field access at set(int Base.publicIntField)"/>
  1594. <line text="Fruit field access at set(int Base.publicIntField)"/>
  1595. </stderr>
  1596. </run>
  1597. </ajc-test>
  1598. <ajc-test dir="java5/annotations/declare/atfield" title="declare @field - wrong target - source weaving">
  1599. <compile files="Base.java,Colored.java,WrongTarget.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
  1600. <message kind="error" line="8" text="The annotation @MethodColoring is disallowed for this location"/>
  1601. <message kind="error" line="9" text="The annotation @TypeColoring is disallowed for this location"/>
  1602. </compile>
  1603. </ajc-test>
  1604. <ajc-test dir="java5/annotations/declare/atfield" title="declare @field - right target - source weaving">
  1605. <compile files="Base.java,Colored.java,RightTarget.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
  1606. <run class="Base">
  1607. <stderr>
  1608. <line text="Colored field access at set(int Base.publicIntField)"/>
  1609. </stderr>
  1610. </run>
  1611. </ajc-test>
  1612. <ajc-test dir="java5/annotations/declare/atfield" title="declare @field - right target - binary weaving">
  1613. <weave classesFiles="Base.java,Colored.java" aspectsFiles="RightTarget.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
  1614. <run class="Base">
  1615. <stderr>
  1616. <line text="Colored field access at set(int Base.publicIntField)"/>
  1617. </stderr>
  1618. </run>
  1619. </ajc-test>
  1620. <ajc-test dir="java5/annotations/declare/atfield" title="declare @field - recursive application - source weaving">
  1621. <compile files="Base.java,Colored.java,Fruit.java,RecursiveFields.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
  1622. <run class="Base">
  1623. <stderr>
  1624. <line text="Fruit field access at set(int Base.publicIntField)"/>
  1625. </stderr>
  1626. </run>
  1627. </ajc-test>
  1628. <ajc-test dir="java5/annotations/declare/atfield" title="declare @field - recursive application - binary weaving">
  1629. <weave classesFiles="Base.java,Colored.java,Fruit.java" aspectsFiles="RecursiveFields.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
  1630. <run class="Base">
  1631. <stderr>
  1632. <line text="Fruit field access at set(int Base.publicIntField)"/>
  1633. </stderr>
  1634. </run>
  1635. </ajc-test>
  1636. <ajc-test dir="java5/annotations/declare/atfield" title="declare @field - recursive application (other order) - source weaving">
  1637. <compile files="Base.java,Colored.java,Fruit.java,RecursiveFields2.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
  1638. <run class="Base">
  1639. <stderr>
  1640. <line text="Fruit field access at set(int Base.publicIntField)"/>
  1641. </stderr>
  1642. </run>
  1643. </ajc-test>
  1644. <ajc-test dir="java5/annotations/declare/atfield" title="declare @field - recursive application (other order) - binary weaving">
  1645. <weave classesFiles="Base.java,Colored.java,Fruit.java" aspectsFiles="RecursiveFields2.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
  1646. <run class="Base">
  1647. <stderr>
  1648. <line text="Fruit field access at set(int Base.publicIntField)"/>
  1649. </stderr>
  1650. </run>
  1651. </ajc-test>
  1652. <!-- incorrect target type for annotation on field -->
  1653. <!-- incorrect target type for annotation on method -->
  1654. <!-- two annotations on one method -->
  1655. <!-- two of the same annotation on one method - error -->
  1656. <!-- two of the same on one using pattern spec - lint -->
  1657. <!-- 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 -->
  1658. <!-- incorrect target type for annotation on ctor -->
  1659. <!-- two annotations on one ctor -->
  1660. <!-- two of the same annotation on one ctor - error -->
  1661. <!-- two of the same on one using pattern spec - lint -->
  1662. <ajc-test dir="java5/annotations/declare/atmethodctor" title="declare @method - simple source weaving">
  1663. <compile files="Base.java,Colored.java,AtMethod1.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
  1664. <run class="Base">
  1665. <stderr>
  1666. <line text="Colored method invocation at call(void Base.m1())"/>
  1667. <line text="m1() running"/>
  1668. <line text="m2() running"/>
  1669. <line text="m3() running"/>
  1670. </stderr>
  1671. </run>
  1672. </ajc-test>
  1673. <ajc-test dir="java5/annotations/declare/atmethodctor" title="declare @method - simple binary weaving">
  1674. <weave classesFiles="Base.java,Colored.java" aspectsFiles="AtMethod1.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
  1675. <run class="Base">
  1676. <stderr>
  1677. <line text="Colored method invocation at call(void Base.m1())"/>
  1678. <line text="m1() running"/>
  1679. <line text="m2() running"/>
  1680. <line text="m3() running"/>
  1681. </stderr>
  1682. </run>
  1683. </ajc-test>
  1684. <ajc-test dir="java5/annotations/declare/atmethodctor" title="declare @constructor - simple source weaving">
  1685. <compile files="Base.java,Colored.java,AtCtor1.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
  1686. <run class="Base">
  1687. <stderr>
  1688. <line text="Colored constructor invocation at call(Base(int))"/>
  1689. <line text="m1() running"/>
  1690. <line text="m2() running"/>
  1691. <line text="m3() running"/>
  1692. </stderr>
  1693. </run>
  1694. </ajc-test>
  1695. <ajc-test dir="java5/annotations/declare/atmethodctor" title="declare @constructor - simple binary weaving">
  1696. <weave classesFiles="Base.java,Colored.java" aspectsFiles="AtCtor1.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
  1697. <run class="Base">
  1698. <stderr>
  1699. <line text="Colored constructor invocation at call(Base(int))"/>
  1700. <line text="m1() running"/>
  1701. <line text="m2() running"/>
  1702. <line text="m3() running"/>
  1703. </stderr>
  1704. </run>
  1705. </ajc-test>
  1706. <!-- These tests verify both @method and @ctor behavior - they are so similar it is OK to have them together... -->
  1707. <ajc-test dir="java5/annotations/declare/atmethodctor" title="declare @method @ctor - wrong target - source weaving">
  1708. <compile files="Base.java,Colored.java,WrongTarget.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
  1709. <message kind="error" line="8" text="The annotation @MethodColoring is disallowed for this location"/>
  1710. <message kind="error" line="9" text="The annotation @TypeColoring is disallowed for this location"/>
  1711. <message kind="error" line="10" text="The annotation @MethodColoring is disallowed for this location"/>
  1712. <message kind="error" line="11" text="The annotation @TypeColoring is disallowed for this location"/>
  1713. </compile>
  1714. </ajc-test>
  1715. <ajc-test dir="java5/annotations/declare/atmethodctor" title="declare @method @ctor - right target - source weaving">
  1716. <compile files="Base.java,Colored.java,RightTarget.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
  1717. <run class="Base">
  1718. <stderr>
  1719. <line text="Colored ctor call at call(Base(int))"/>
  1720. <line text="Colored method call at call(void Base.m1())"/>
  1721. <line text="m1() running"/>
  1722. <line text="m2() running"/>
  1723. <line text="m3() running"/>
  1724. </stderr>
  1725. </run>
  1726. </ajc-test>
  1727. <ajc-test dir="java5/annotations/declare/atmethodctor" title="declare @method @ctor - right target - binary weaving">
  1728. <weave classesFiles="Base.java,Colored.java" aspectsFiles="RightTarget.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
  1729. <run class="Base">
  1730. <stderr>
  1731. <line text="Colored ctor call at call(Base(int))"/>
  1732. <line text="Colored method call at call(void Base.m1())"/>
  1733. <line text="m1() running"/>
  1734. <line text="m2() running"/>
  1735. <line text="m3() running"/>
  1736. </stderr>
  1737. </run>
  1738. </ajc-test>
  1739. <!-- check @method/@ctor/@field recursively applying, can only happen if a pattern for one of them includes an annotation -->
  1740. <ajc-test dir="java5/annotations/declare/atmethodctor" title="declare @method @ctor - two the same on one - source weaving">
  1741. <compile files="Base.java,Colored.java,TwoOnOneMember.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
  1742. <message kind="warning" text="void Base.m1() - already has an annotation of type Colored"/>
  1743. <message kind="warning" text="void Base.&lt;init&gt;(int) - already has an annotation of type Colored"/>
  1744. </compile>
  1745. </ajc-test>
  1746. <ajc-test dir="java5/annotations/declare/atmethodctor" title="declare @method @ctor - two the same on one - binary weaving">
  1747. <weave classesFiles="Base.java,Colored.java" aspectsFiles="TwoOnOneMember.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
  1748. <message kind="warning" text="void Base.m1() - already has an annotation of type Colored"/>
  1749. <message kind="warning" text="void Base.&lt;init&gt;(int) - already has an annotation of type Colored"/>
  1750. </weave>
  1751. </ajc-test>
  1752. <ajc-test dir="java5/annotations/declare/atmethodctor" title="declare @method @ctor - two different on one - source weaving">
  1753. <compile files="Base.java,Colored.java,Fruit.java,TwoOnOneMember2.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
  1754. </compile>
  1755. <run class="Base">
  1756. <stderr>
  1757. <line text="Colored ctor call at Base.java:11"/>
  1758. <line text="Fruit ctor call at Base.java:11"/>
  1759. <line text="Colored method call at Base.java:15"/>
  1760. <line text="Fruit method call at Base.java:15"/>
  1761. <line text="m1() running"/>
  1762. <line text="m2() running"/>
  1763. <line text="m3() running"/>
  1764. </stderr>
  1765. </run>
  1766. </ajc-test>
  1767. <ajc-test dir="java5/annotations/declare/atmethodctor" title="declare @method @ctor - two different on one - binary weaving">
  1768. <weave classesFiles="Base.java,Colored.java,Fruit.java" aspectsFiles="TwoOnOneMember2.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
  1769. </weave>
  1770. <run class="Base">
  1771. <stderr>
  1772. <line text="Colored ctor call at Base.java:11"/>
  1773. <line text="Fruit ctor call at Base.java:11"/>
  1774. <line text="Colored method call at Base.java:15"/>
  1775. <line text="Fruit method call at Base.java:15"/>
  1776. <line text="m1() running"/>
  1777. <line text="m2() running"/>
  1778. <line text="m3() running"/>
  1779. </stderr>
  1780. </run>
  1781. </ajc-test>
  1782. <ajc-test dir="java5/annotations/declare" title="declare all annotations on one class - source weaving">
  1783. <compile files="DeathByAnnotations.aj" options="-1.5,-emacssym" xlintfile="ignoreTypeNotExposed.properties"/>
  1784. <run class="p.q.DeathByAnnotations"/>
  1785. </ajc-test>
  1786. </suite>