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.

ajc150.xml 123KB

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