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.

ajc152.xml 28KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646
  1. <!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]>
  2. <!-- AspectJ v1.5.2 Tests -->
  3. <suite>
  4. <ajc-test dir="bugs152/pr135001" title="aspect libraries and asm">
  5. <compile files="AbstractAspect.java" outjar="lib.jar" options="-1.5"/>
  6. <compile files="Foo.java,ConcreteAspect.java" classpath="lib.jar" options="-1.5 -showWeaveInfo">
  7. <message kind="weave" text="Join point 'method-call(void Foo.foo())' in Type 'Foo' (Foo.java:3) advised by around advice from 'ConcreteAspect' (AbstractAspect.java:5)"/>
  8. </compile>
  9. <run class="Foo">
  10. <stderr>
  11. <line text="In the advice!"/>
  12. </stderr>
  13. </run>
  14. </ajc-test>
  15. <ajc-test dir="bugs152/pr122253" title="aspects14 - persingleton">
  16. <compile files="Singleton.java"/>
  17. <run class="Singleton">
  18. <stderr>
  19. <line text="hasAspect? true : true"/>
  20. <line text="aspectOf? SingletonInstance : SingletonInstance"/>
  21. <line text="hasAspect? true : true"/>
  22. <line text="aspectOf? SingletonInstance : SingletonInstance"/>
  23. </stderr>
  24. </run>
  25. </ajc-test>
  26. <ajc-test dir="bugs152/pr122253" title="aspects14 - percflow">
  27. <compile files="PerCflow.java"/>
  28. <run class="PerCflow">
  29. <stderr>
  30. <line text="before"/>
  31. <line text="hasAspect? false : false"/>
  32. <line text="aspectOf? null : null"/>
  33. <line text="during"/>
  34. <line text="hasAspect? true : true"/>
  35. <line text="aspectOf? PerCflowInstance : PerCflowInstance"/>
  36. <line text="after"/>
  37. <line text="hasAspect? false : false"/>
  38. <line text="aspectOf? null : null"/>
  39. </stderr>
  40. </run>
  41. </ajc-test>
  42. <ajc-test dir="bugs152/pr122253" title="aspects14 - perthis">
  43. <compile files="PerThis.java"/>
  44. <run class="PerThis">
  45. <stderr>
  46. <line text="before"/>
  47. <line text="hasAspect? false : false"/>
  48. <line text="aspectOf? null : null"/>
  49. <line text="during"/>
  50. <line text="hasAspect? true : true"/>
  51. <line text="aspectOf? PerThisInstance : PerThisInstance"/>
  52. <line text="after"/>
  53. <line text="hasAspect? false : false"/>
  54. <line text="aspectOf? null : null"/>
  55. </stderr>
  56. </run>
  57. </ajc-test>
  58. <ajc-test dir="bugs152/pr122253" title="aspects14 - pertypewithin">
  59. <compile files="PerTypeWithin.java"/>
  60. <run class="PerTypeWithin">
  61. <stderr>
  62. <line text="before"/>
  63. <line text="hasAspect? false : false"/>
  64. <line text="aspectOf? null : null"/>
  65. <line text="during"/>
  66. <line text="hasAspect? true : true"/>
  67. <line text="aspectOf? PerTypeWithinInstance : PerTypeWithinInstance"/>
  68. <line text="after"/>
  69. <line text="hasAspect? false : false"/>
  70. <line text="aspectOf? null : null"/>
  71. </stderr>
  72. </run>
  73. </ajc-test>
  74. <ajc-test dir="bugs152/pr126355" title="bizarre generic error with itds">
  75. <compile files="Pair.java" options="-1.5"/>
  76. <compile files="Test.java" options="-1.5"/>
  77. </ajc-test>
  78. <ajc-test dir="bugs152/pr126355" title="bizarre generic error with itds - 2">
  79. <compile files="Pair.java" options="-1.5"/>
  80. <compile files="Test.java" options="-1.5"/>
  81. </ajc-test>
  82. <ajc-test dir="bugs152/pr145018" title="ataj crashing with cflow, if and args">
  83. <compile files="Broken.aj" options="-1.5"/>
  84. <run class="Broken">
  85. <stderr>
  86. <line text="ahhh"/>
  87. </stderr>
  88. </run>
  89. </ajc-test>
  90. <ajc-test dir="bugs152/pr132349" title="ITD on inner type of generic type">
  91. <compile files="TopLevelType.java" options="-1.5"/>
  92. <run class="TopLevelType"/>
  93. </ajc-test>
  94. <ajc-test dir="bugs152/pr144602" title="atAJ perthis aspect verification error">
  95. <compile files="MyAspect.aj" options="-1.5"/>
  96. <run class="MyAspect"/>
  97. </ajc-test>
  98. <ajc-test dir="bugs152/pr132349" title="ITD on inner type of generic type - 2">
  99. <compile files="TopLevelType2.java" options="-1.5">
  100. <message kind="error" line="12"/> <!-- error message is currently crap - its a parser message -->
  101. </compile>
  102. </ajc-test>
  103. <ajc-test dir="bugs152/pr132349" title="ITD on inner type of generic type - 3">
  104. <compile files="TopLevelType3.java" options="-1.5">
  105. <message kind="error" line="12" text="Cannot make inter-type declarations on parameterized types"/>
  106. <message kind="error" line="7" text="The method someMethod() is undefined for the type TopLevelType3.NestedType"/>
  107. </compile>
  108. </ajc-test>
  109. <ajc-test dir="bugs152/pr135865" title="misbehaving declare annotation">
  110. <compile files="B.java,A.java" options="-1.5 -Xlint:ignore">
  111. <!--message kind="weave" text="Join point 'method-call(void B.foo())' in Type 'A' (A.java:32) advised by before advice from 'Aspect' (A.java:22) [with runtime test]"/>
  112. <message kind="weave" text="Join point 'method-call(void A.foo())' in Type 'A' (A.java:33) advised by before advice from 'Aspect' (A.java:22) [with runtime test]"/>
  113. <message kind="weave" text="' void B.goo()' (A.java:7) is annotated with @Ann method annotation from 'Aspect' (A.java:27)"/-->
  114. </compile>
  115. <run class="A">
  116. <stdout>
  117. <line text="Join point: call(void B.foo())"/>
  118. </stdout>
  119. </run>
  120. </ajc-test>
  121. <ajc-test dir="bugs152/pr135865" title="misbehaving declare annotation - 2">
  122. <compile files="A.java,B.java" options="-1.5 -Xlint:ignore">
  123. <!--message kind="weave" text="Join point 'method-call(void B.foo())' in Type 'A' (A.java:32) advised by before advice from 'Aspect' (A.java:22) [with runtime test]"/>
  124. <message kind="weave" text="Join point 'method-call(void A.foo())' in Type 'A' (A.java:33) advised by before advice from 'Aspect' (A.java:22) [with runtime test]"/>
  125. <message kind="weave" text="' void B.goo()' (A.java:7) is annotated with @Ann method annotation from 'Aspect' (A.java:27)"/-->
  126. </compile>
  127. <run class="A">
  128. <stdout>
  129. <line text="Join point: call(void B.foo())"/>
  130. </stdout>
  131. </run>
  132. </ajc-test>
  133. <ajc-test dir="bugs152/pr129704" title="annotations and generics leading to BCException">
  134. <compile files="A.java" options="-1.5"/>
  135. <run class="A">
  136. <stderr>
  137. <line text="@Marker()"/>
  138. </stderr>
  139. </run>
  140. </ajc-test>
  141. <ajc-test dir="bugs152/pr136026" title="verifyerror">
  142. <compile files="CflowOrder.java" options="-1.5"/>
  143. <run class="CflowOrder"/>
  144. </ajc-test>
  145. <ajc-test dir="bugs152/pr136026" title="verifyerror - 2">
  146. <compile files="CflowOrderOriginal.java" options="-1.5"/>
  147. <run class="bugs.CflowOrderOriginal">
  148. <stderr>
  149. <line text="Starting CflowOrder.main(..)"/>
  150. <line text="topAnnotated"/>
  151. <!--line text=" Join point: call(void bugs.CflowOrderOriginal.A.foo())"/>
  152. <line text=" Enclosing join point: execution(void bugs.CflowOrderOriginal.A.main(String[]))"/>
  153. <line text=" Annotation: @bugs.CflowOrderOriginal$Annotation(value=A.foo)"/-->
  154. <line text="nonTopAnnotated"/>
  155. <!--line text=" Join point: call(void bugs.CflowOrderOriginal.B.foo())"/>
  156. <line text=" Enclosing join point: execution(void bugs.CflowOrderOriginal.A.foo())"/>
  157. <line text=" Annotation: @bugs.CflowOrderOriginal$Annotation(value=B.foo)"/-->
  158. <line text="B.foo()"/>
  159. <line text="A.foo()"/>
  160. <line text="A.main(..)"/>
  161. <line text="Ending CflowOrder.main(..)"/>
  162. </stderr>
  163. </run>
  164. </ajc-test>
  165. <ajc-test dir="bugs152/pr136258" title="stack overflow">
  166. <compile files="StatisticsTypeImpl.java" options="-1.5"/>
  167. <run class="StatisticsTypeImpl"/>
  168. </ajc-test>
  169. <ajc-test dir="bugs152/pr138384" title="method too big">
  170. <compile files="BigMethod.java" options="-1.5"> <!-- will be 67628 bytes in the big method -->
  171. <message kind="error" line="1" text="problem generating method BigMethod.i_am_a_big_method : Code size too big: 67629"/>
  172. </compile>
  173. <!--run class="BigMethod"/-->
  174. </ajc-test>
  175. <ajc-test dir="bugs152/pr138798" title="atWithinCodeBug">
  176. <compile files="ErrorHandling.aj" options="-1.5"/>
  177. <run class="ErrorHandling">
  178. <stderr>
  179. <line text="Caught in foo"/>
  180. </stderr>
  181. </run>
  182. </ajc-test>
  183. <ajc-test dir="bugs152/pr138158" title="not at withincode - 1">
  184. <compile files="Boo.java" options="-1.5 -showWeaveInfo">
  185. <message kind="weave" text="Join point 'method-call(void Boo.m())' in Type 'Boo' (Boo.java:9) advised by before advice from 'X' (Boo.java:19)"/>
  186. </compile>
  187. <run class="Boo"/>
  188. </ajc-test>
  189. <ajc-test dir="bugs152/pr138158" title="not at within - 3">
  190. <compile files="Doo.java" options="-1.5 -showWeaveInfo">
  191. <message kind="weave" text="Join point 'method-call(void java.io.PrintStream.println(java.lang.String))' in Type 'Soo' (Doo.java:20) advised by before advice from 'X' (Doo.java:25)"/>
  192. </compile>
  193. <run class="Doo"/>
  194. </ajc-test>
  195. <ajc-test dir="bugs152/pr138158" title="not at withincode - 2">
  196. <compile files="Foo.java" options="-1.5 -showWeaveInfo">
  197. <message kind="weave" text="Join point 'method-call(void java.io.PrintStream.println(java.lang.String))' in Type 'Foo' (Foo.java:14) advised by before advice from 'X' (Foo.java:26)"/>
  198. <message kind="weave" text="Join point 'method-call(void java.io.PrintStream.println(java.lang.String))' in Type 'Foo' (Foo.java:18) advised by before advice from 'X' (Foo.java:23)"/>
  199. </compile>
  200. <run class="Foo"/>
  201. </ajc-test>
  202. <ajc-test dir="bugs152/pr137568" title="complicated generics declaration">
  203. <compile files="C.java" options="-emacssym -1.5"/>
  204. <run class="C"/>
  205. </ajc-test>
  206. <ajc-test dir="bugs152/pr138143" title="npe on duplicate method with ataj">
  207. <compile files="AspectClass.java" options="-1.5">
  208. <message kind="error" line="7" text="Duplicate method incomingMessage() in type AspectClass"/>
  209. <message kind="error" line="12" text="Duplicate method incomingMessage() in type AspectClass"/>
  210. </compile>
  211. </ajc-test>
  212. <ajc-test dir="bugs152/pr137496" title="pointcuts and generics - B">
  213. <compile files="B.java" options="-1.5 -showWeaveInfo">
  214. <!--message kind="weave" text="Join point 'method-call(java.lang.String C.pm(java.lang.String))' in Type 'B' (B.java:20) advised by before advice from 'X' (B.java:26)"/-->
  215. <message kind="weave" text="Join point 'method-call(java.lang.Object C.pm(java.lang.Object))' in Type 'B' (B.java:20) advised by before advice from 'X' (B.java:26)"/>
  216. <!--message kind="weave" text="Join point 'method-call(java.lang.String C.pm2(java.lang.String))' in Type 'B' (B.java:21) advised by before advice from 'X' (B.java:27)"/-->
  217. </compile>
  218. <run class="B">
  219. <stderr>
  220. <line text="advice"/>
  221. <line text="foo"/>
  222. </stderr>
  223. </run>
  224. </ajc-test>
  225. <ajc-test dir="bugs152/pr137496" title="pointcuts and generics - D">
  226. <compile files="D.java" options="-1.5 -showWeaveInfo">
  227. <message kind="weave" text="Join point 'method-call(java.lang.String CImpl.pm(java.lang.String))' in Type 'D' (D.java:20) advised by before advice from 'X' (D.java:26)"/>
  228. <message kind="weave" text="Join point 'method-call(java.lang.String CImpl.pm2(java.lang.String))' in Type 'D' (D.java:21) advised by before advice from 'X' (D.java:27)"/>
  229. </compile>
  230. <run class="D">
  231. <stderr>
  232. <line text="advice"/>
  233. <line text="foo"/>
  234. <line text="advice2"/>
  235. <line text="foo"/>
  236. </stderr>
  237. </run>
  238. </ajc-test>
  239. <ajc-test dir="bugs152/pr137496" title="pointcuts and generics - E">
  240. <compile files="E.java" options="-1.5 -showWeaveInfo">
  241. <message kind="weave" text="Join point 'method-call(java.lang.Object C.pm(java.lang.Object))' in Type 'E' (E.java:18) advised by before advice from 'X' (E.java:23)"/>
  242. </compile>
  243. <run class="E">
  244. <stderr>
  245. <line text="advice"/>
  246. <line text="foo"/>
  247. </stderr>
  248. </run>
  249. </ajc-test>
  250. <ajc-test dir="bugs152/pr137496" title="pointcuts and generics - F">
  251. <compile files="F.java" options="-1.5 -showWeaveInfo">
  252. <message kind="weave" text="Join point 'method-call(java.lang.Object C.pm(java.lang.Object))' in Type 'F' (F.java:18) advised by before advice from 'X' (F.java:23)"/>
  253. </compile>
  254. <run class="F">
  255. <stderr>
  256. <line text="advice"/>
  257. <line text="foo"/>
  258. </stderr>
  259. </run>
  260. </ajc-test>
  261. <ajc-test dir="bugs152/pr137496" title="pointcuts and generics - G">
  262. <compile files="G.java" options="-1.5 -showWeaveInfo">
  263. <message kind="warning" line="23" text="advice defined in X has not been applied [Xlint:adviceDidNotMatch]"/>
  264. </compile>
  265. <run class="G">
  266. <stderr>
  267. <line text="foo"/>
  268. </stderr>
  269. </run>
  270. </ajc-test>
  271. <ajc-test dir="bugs152/pr137496" title="pointcuts and generics - H">
  272. <compile files="H.java" options="-1.5 -showWeaveInfo">
  273. <message kind="weave" text="Join point 'method-call(java.lang.Object C.pm(java.lang.Object))' in Type 'H' (H.java:20) advised by around advice from 'X' (H.java:26)"/>
  274. </compile>
  275. <run class="H">
  276. <stderr>
  277. <line text="advice"/>
  278. </stderr>
  279. </run>
  280. </ajc-test>
  281. <ajc-test dir="bugs152/binaryDecp" title="incorrect overrides evaluation - 1.3">
  282. <compile files="SubClassLoader.java,SubSubClassLoader.java" options="-1.3" outjar="lib.jar"/>
  283. <compile files="X.aj" inpath="lib.jar" options="-showWeaveInfo">
  284. <message kind="weave" text="Setting superclass of type 'SubSubClassLoader' (SubSubClassLoader.java) to 'SubClassLoader' (X.aj)"/>
  285. </compile>
  286. </ajc-test>
  287. <ajc-test dir="bugs152/binaryDecp" title="incorrect overrides evaluation - 1.5">
  288. <compile files="SubClassLoader.java,SubSubClassLoader.java" options="-1.5" outjar="lib.jar"/>
  289. <compile files="X.aj" inpath="lib.jar" options="-showWeaveInfo">
  290. <message kind="weave" text="Setting superclass of type 'SubSubClassLoader' (SubSubClassLoader.java) to 'SubClassLoader' (X.aj)"/>
  291. </compile>
  292. </ajc-test>
  293. <ajc-test dir="bugs152/pr129282" title="no unnecessary declaration of thrown exception warning - 1">
  294. <compile files="MethodExecution.aj" options="-warn:+unusedThrown">
  295. <message kind="warning" line="30" text="The declared exception SQLException is not actually thrown by the method needsToThrow() from type C"/>
  296. </compile>
  297. </ajc-test>
  298. <ajc-test dir="bugs152/pr129282" title="no unnecessary declaration of thrown exception warning - 2">
  299. <compile files="MethodCall.aj" options="-warn:+unusedThrown">
  300. <message kind="warning" line="36" text="The declared exception FileNotFoundException is not actually thrown by the method m4() from type C1"/>
  301. </compile>
  302. </ajc-test>
  303. <ajc-test dir="bugs152/pr129282" title="no unnecessary declaration of thrown exception warning - 3">
  304. <compile files="InnerMethodCall.aj" options="-warn:+unusedThrown">
  305. <message kind="warning" line="44" text="The declared exception FileNotFoundException is not actually thrown by the method m4() from type C1"/>
  306. </compile>
  307. </ajc-test>
  308. <ajc-test dir="bugs152/pr129282" title="no unnecessary declaration of thrown exception warning - 4">
  309. <compile files="AdviceExecution.aj" options="-1.5 -warn:+unusedThrown"/>
  310. </ajc-test>
  311. <ajc-test dir="bugs152/pr129282" title="no unnecessary declaration of thrown exception warning - 5">
  312. <compile files="ExceptionHandler.aj" options="-warn:+unusedThrown">
  313. <message kind="warning" line="34" text="The declared exception MyException is not actually thrown by the method throwingMethod2() from type C"/>
  314. </compile>
  315. </ajc-test>
  316. <ajc-test dir="bugs152/pr129282" title="no unnecessary declaration of thrown exception warning - 6">
  317. <compile files="Initialization.aj" options="-warn:+unusedThrown"/>
  318. </ajc-test>
  319. <ajc-test dir="bugs152/pr129282" title="no unnecessary declaration of thrown exception warning - 7">
  320. <compile files="ConstructorCall.aj" options="-warn:+unusedThrown"/>
  321. </ajc-test>
  322. <ajc-test dir="bugs152/pr129282" title="no unnecessary declaration of thrown exception warning - 8">
  323. <compile files="ConstructorExecution.aj" options="-warn:+unusedThrown"/>
  324. </ajc-test>
  325. <ajc-test dir="bugs152/pr129282" title="no unnecessary declaration of thrown exception warning - 9">
  326. <compile files="MethodCallInDiffClass.aj" options="-warn:+unusedThrown"/>
  327. </ajc-test>
  328. <ajc-test dir="bugs152/pr129282" title="no unnecessary declaration of thrown exception warning - 10">
  329. <compile files="InnerMethodCall2.aj" options="-warn:+unusedThrown"/>
  330. </ajc-test>
  331. <ajc-test dir="bugs152/pr138215" pr="138215" title="Reference pointcut fails inside @DeclareWarning">
  332. <compile files="pr138215.aj" options="-1.5">
  333. <message kind="warning" line="17" text="no foos please"/>
  334. </compile>
  335. </ajc-test>
  336. <ajc-test dir="bugs152/pr138219" pr="138219" title="Can't use a FQ Reference pointcut in any pointcut expression referenced by a per-clause">
  337. <compile files="PerThisWithReference.aj,SomeOtherType.aj,RegularPCWithReference.aj" options="-1.5">
  338. </compile>
  339. <run class="PerThisWithReference">
  340. <stdout>
  341. <line text="before PerThisWithReference:1"/>
  342. <line text="before PerThisWithReference:2"/>
  343. </stdout>
  344. </run>
  345. </ajc-test>
  346. <ajc-test dir="bugs152/pr130722" pr="130722" title="FQ Reference pointcut from perclause ref pc">
  347. <compile files="test/Test.java,test/PointcutConsumer.aj,test1/PointcutProvider.aj"/>
  348. </ajc-test>
  349. <ajc-test dir="bugs152/pr138220" pr="138220" title="@Aspect with reference pointcut in perclause">
  350. <compile files="AtAspectWithPerClause.aj" options="-1.5">
  351. </compile>
  352. </ajc-test>
  353. <ajc-test dir="bugs152/pr144465" title="ltw with serialversionUID creation">
  354. <compile files="BigHorribleClass.java"/>
  355. <compile files="AnAspect.java"/>
  356. <run class="BigHorribleClass" ltw="aop1.xml">
  357. <stderr>
  358. <line text="weaveinfo Join point 'staticinitialization(void BigHorribleClass.&lt;clinit&gt;())'"/>
  359. <line text="SerialVersionUID is "/>
  360. </stderr>
  361. </run>
  362. </ajc-test>
  363. <ajc-test dir="bugs152/pr125480" title="aop.xml aspect inheriting abstract method ">
  364. <compile files="HelloWorld.java"/>
  365. <compile files="AbstractMethods.aj, ConcreteMethods.aj" options="-1.5"/>
  366. <run class="HelloWorld" ltw="aop-tracing.xml">
  367. <stdout>
  368. <line text="advice running"/>
  369. <line text="Hello World!"/>
  370. </stdout>
  371. </run>
  372. </ajc-test>
  373. <ajc-test dir="bugs152/pr125480/case2" title="aop.xml aspect inheriting abstract method - code style">
  374. <compile files="HelloWorld.java"/>
  375. <compile files="AbstractMethods.aj, ConcreteMethods.aj" options="-1.5"/>
  376. <run class="HelloWorld" ltw="aop-tracing.xml">
  377. <stdout>
  378. <line text="advice running"/>
  379. <line text="Hello World!"/>
  380. </stdout>
  381. </run>
  382. </ajc-test>
  383. <ajc-test dir="bugs152/pr142466" title="aop.xml aspect inheriting but not concretizing abstract method">
  384. <compile files="HelloWorld.java"/>
  385. <compile files="AbstractMethods.aj, ConcreteMethods.aj" options="-1.5"/>
  386. <run class="HelloWorld" ltw="aop-tracing.xml">
  387. <stderr>
  388. <line text="error Abstract method 'void ConcreteMethods.foo(int)' cannot be concretized in XML:"/>
  389. <line text="warning register definition failed"/>
  390. </stderr>
  391. <stdout>
  392. <line text="Hello World!"/>
  393. </stdout>
  394. </run>
  395. </ajc-test>
  396. <ajc-test dir="bugs152/pr142466/case2" title="aop.xml aspect inheriting but not concretizing abstract method - 2">
  397. <compile files="HelloWorld.java"/>
  398. <compile files="AbstractMethods.aj, ConcreteMethods.aj" options="-1.5"/>
  399. <run class="HelloWorld" ltw="aop-tracing.xml">
  400. <stderr>
  401. <line text="error Abstract method 'void AbstractMethods.test()' cannot be concretized in XML"/>
  402. <line text="warning register definition failed"/>
  403. </stderr>
  404. <stdout>
  405. <line text="Hello World!"/>
  406. </stdout>
  407. </run>
  408. </ajc-test>
  409. <ajc-test dir="bugs152/pr138223" pr="138223" title="Double at annotation matching (no binding)">
  410. <compile files="DoubleAnnotationMatching.aj" options="-1.5">
  411. </compile>
  412. <run class="DoubleAnnotationMatching">
  413. <stderr>
  414. <line text="advice running at execution(void Foo.a())"/>
  415. <line text="advice running at execution(void TxTrueFoo.a())"/>
  416. <line text="advice running at execution(void TxTrueFoo.b())"/>
  417. <line text="advice running at execution(void TxTrueFoo.c())"/>
  418. <line text="advice running at execution(void TxFalseFoo.a())"/>
  419. </stderr>
  420. </run>
  421. </ajc-test>
  422. <ajc-test dir="bugs152/pr138286" pr="138286" title="No ClassCastException with perThis">
  423. <compile files="A.aj" options="-1.5 -showWeaveInfo">
  424. <message kind="weave" text="Join point 'initialization(void A.&lt;init&gt;())' in Type 'A' (A.aj:9) advised by before advice from 'A' (A.aj:13) [with runtime test]"/>
  425. <message kind="weave" text="Join point 'initialization(void Soo.&lt;init&gt;())' in Type 'Soo' (A.aj:31) advised by before advice from 'A' (A.aj:13) [with runtime test]"/>
  426. <message kind="weave" text="Join point 'initialization(void Goo.&lt;init&gt;())' in Type 'Goo' (A.aj:27) advised by before advice from 'A' (A.aj:13) [with runtime test]"/>
  427. <message kind="weave" text="Join point 'initialization(void Foo.&lt;init&gt;())' in Type 'Foo' (A.aj:25) advised by before advice from 'A' (A.aj:13) [with runtime test]"/>
  428. <message kind="weave" text="Join point 'initialization(void Boo.&lt;init&gt;())' in Type 'Boo' (A.aj:29) advised by before advice from 'A' (A.aj:13) [with runtime test]"/>
  429. </compile>
  430. <run class="A">
  431. <stderr>
  432. <line text="class Foo"/>
  433. <line text="class Boo"/>
  434. <line text="class Boo"/> <!-- this one is because of the super() call in Soo's default ctor -->
  435. <line text="class Soo"/>
  436. </stderr>
  437. </run>
  438. </ajc-test>
  439. <ajc-test dir="bugs152/pr139749" pr="139749" title="Super calls in @AspectJ advice">
  440. <compile files="AroundAdvicePassingPjpAsArgToSuper.java" options="-1.5">
  441. </compile>
  442. <run class="a.b.c.AroundAdvicePassingPjpAsArgToSuper"/>
  443. </ajc-test>
  444. <ajc-test dir="bugs152/pr137235" pr="137235"
  445. title="directory with .jar extension: source and outjar">
  446. <compile files="directory.jar/Hello.java" outjar="directory.jar/run.custom"/>
  447. <run class="Hello" classpath="$sandbox/directory.jar/run.custom">
  448. <stdout>
  449. <line text="Hello Java"/>
  450. </stdout>
  451. </run>
  452. </ajc-test>
  453. <ajc-test dir="bugs152/pr137235" pr="137235"
  454. title="directory with .jar extension" >
  455. <compile files="directory.jar/Before.java" outjar="directory.jar/inOne.custom"/>
  456. <compile files="directory.jar/BeforeExec.aj" outjar="directory.jar/inTwo"/>
  457. <compile files="directory.jar/Rename.aj" outjar="directory.jar/weave.jar"/>
  458. <compile files="directory.jar/Hello.java" inpath="directory.jar/inOne.custom,directory.jar/inTwo" aspectpath="directory.jar/weave.jar" outjar="directory.jar/outJar.jar"/>
  459. <run class="Hello" classpath="$sandbox/directory.jar/outJar.jar,$sandbox/directory.jar/weave.jar">
  460. <stdout>
  461. <line text="Before call"/>
  462. <line text="Before execution"/>
  463. <line text="Hello AspectJ not just Java"/>
  464. </stdout>
  465. </run>
  466. </ajc-test>
  467. <ajc-test dir="bugs152/pr136393" title="NPE in makePreMethod">
  468. <compile files="World.aj" options="-1.5">
  469. <message kind="warning" line="10" text="this affected type is not exposed to the weaver: java.lang.String [Xlint:typeNotExposedToWeaver]"/>
  470. <message kind="error" line="11" text="h cannot be resolved"/>
  471. <message kind="error" line="16" text="Stystems cannot be resolved"/>
  472. </compile>
  473. </ajc-test>
  474. <ajc-test dir="bugs152/pr135068" title="ltw verifyerror">
  475. <compile files="C.java,Ajava.java" options="-1.5 -XnoInline"/>
  476. <run class="C"/>
  477. </ajc-test>
  478. <ajc-test dir="bugs152/pr135068" title="ltw verifyerror - 2">
  479. <compile files="C2.java,Ajava2.java" options="-1.5 -XnoInline">
  480. <message kind="error" line="13" text="advice can not be declared static"/>
  481. </compile>
  482. </ajc-test>
  483. <ajc-test dir="bugs152/pr135068" title="ltw verifyerror - 3">
  484. <compile files="t/C.java" options="-1.5"/>
  485. <compile files="t/Ajava.java" options="-1.5">
  486. <message kind="warning" line="13" text="advice defined"/>
  487. </compile>
  488. <run class="t.C" ltw="aop.xml"/>
  489. </ajc-test>
  490. <ajc-test dir="bugs152/pr135068" title="ltw verifyerror - 4">
  491. <compile files="t/C2.java" options="-1.5"/>
  492. <compile files="t/Ajava2.java" options="-1.5">
  493. <message kind="error" line="13" text="advice can not be declared static"/>
  494. </compile>
  495. </ajc-test>
  496. <ajc-test dir="bugs152/pr142165" title="broken concretization">
  497. <compile files="C.java" options="-1.5"/>
  498. <compile files="A.java" options="-1.5"/>
  499. <run class="C" ltw="aop.xml">
  500. <stderr>
  501. <line text="warning at Type 'AA' (no debug info available)::0 no match for this type name: SomeType [Xlint:invalidAbsoluteTypeName]"/>
  502. <line text="foo running"/>
  503. </stderr>
  504. </run>
  505. </ajc-test>
  506. <ajc-test dir="bugs152/pr142165" title="broken concretization - 2">
  507. <compile files="C.java" options="-1.5"/>
  508. <compile files="A.java" options="-1.5"/>
  509. <run class="C" ltw="aop2.xml">
  510. <stderr>
  511. <line text="foo running"/>
  512. </stderr>
  513. </run>
  514. </ajc-test>
  515. <ajc-test dir="bugs152/pr142165" title="broken concretization - 3">
  516. <compile files="C.java" options="-1.5"/>
  517. <compile files="A.java" options="-1.5"/>
  518. <run class="C" ltw="aop3.xml">
  519. <stderr>
  520. <line text="advice"/>
  521. <line text="foo running"/>
  522. </stderr>
  523. </run>
  524. </ajc-test>
  525. <ajc-test dir="bugs152/pr134425" title="super ITDs">
  526. <compile files="Derived.aj" options="-1.5"/>
  527. <run class="Derived"/>
  528. </ajc-test>
  529. <ajc-test dir="bugs152/pr128443" title="covariance and decp - 1">
  530. <compile files="Covariance.java" options="-1.5"/>
  531. </ajc-test>
  532. <ajc-test dir="bugs152" title="new IProgramElement handle methods">
  533. <compile files="pr141730.aj" options="-emacssym -1.5"/>
  534. </ajc-test>
  535. <ajc-test dir="bugs152" title="declare @method relationship">
  536. <compile files="pr143924.aj" options="-1.5 -showWeaveInfo -emacssym">
  537. <message kind="weave" text="'public void BankAccount.debit(String,long)' (pr143924.aj:7) is annotated with @Secured"/>
  538. </compile>
  539. </ajc-test>
  540. <!-- wont work whilst the compiler BuildArgParser.setDebugOptions is always switching debug on -->
  541. <ajc-test dir="bugs152/pr129408" title="long winded ataj messages">
  542. <compile files="AtAj.java" options="-XterminateAfterCompilation -g:none -1.5"/>
  543. <compile files="C.java" options="-g:none -1.5"/>
  544. <run class="C" ltw="aop.xml">
  545. <!-- should check for expected stderr output here -->
  546. </run>
  547. </ajc-test>
  548. <ajc-test dir="ltw"
  549. title="Ensure no weaving without included aspects"
  550. keywords="reweavable">
  551. <compile
  552. files="TestMain.java, Main.java"
  553. >
  554. </compile>
  555. <run class="TestMain" ltw="aop-optionsonly.xml">
  556. <stdout>
  557. <line text="Main.main"/>
  558. <line text="Main.test1"/>
  559. <line text="Main.test2"/>
  560. </stdout>
  561. <stderr>
  562. <line text="info AspectJ Weaver Version"/>
  563. <line text="info register classloader org.aspectj.weaver.loadtime.WeavingURLClassLoader"/>
  564. <line text="info using"/>
  565. <line text="info no aspects registered. Disabling weaver for class loader org.aspectj.weaver.loadtime.WeavingURLClassLoader"/>
  566. </stderr>
  567. </run>
  568. </ajc-test>
  569. </suite>