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.

ajc151.xml 20KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418
  1. <!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]>
  2. <!-- AspectJ v1.5.1 Tests -->
  3. <suite>
  4. <!-- atDecp begin -->
  5. <!-- something simple -->
  6. <ajc-test dir="bugs151/atDecp/case1" title="atDecp - simple">
  7. <compile files="MainClass.java" options="-1.5 -showWeaveInfo">
  8. <message kind="weave" text="Extending interface set for type 'moody.AnnotationMoodImplementor' (MainClass.java) to include 'moody.AnnotationMoodIndicator$Moody' (MainClass.java)"/>
  9. <message kind="weave" text="Type 'moody.AnnotationMoodImplementor' (MainClass.java) has intertyped method from 'moody.AnnotationMoodIndicator' (MainClass.java:'moody.Mood moody.AnnotationMoodIndicator$Moody.getMood()')"/>
  10. <message kind="weave" text="Type 'moody.AnnotationMoodImplementor' (MainClass.java) has intertyped method from 'moody.AnnotationMoodIndicator' (MainClass.java:'void moody.AnnotationMoodIndicator$Moody.setMood(moody.Mood)')"/>
  11. </compile>
  12. <run class="moody.MainClass">
  13. <stderr>
  14. <line text="ami0's mood is HAPPY"/>
  15. <line text="ami1's mood is now JOLLY"/>
  16. <line text="ami0's mood is still HAPPY"/>
  17. </stderr>
  18. </run>
  19. </ajc-test>
  20. <!-- applying parent based on annotation -->
  21. <ajc-test dir="bugs151/atDecp/case2" title="atDecp - annotation">
  22. <compile files="MainClass.java" options="-1.5 -showWeaveInfo">
  23. <message kind="weave" text="Extending interface set for type 'moody.AnnotationMoodImplementor' (MainClass.java) to include 'moody.AnnotationMoodIndicator$Moody' (MainClass.java)"/>
  24. <message kind="weave" text="Type 'moody.AnnotationMoodImplementor' (MainClass.java) has intertyped method from 'moody.AnnotationMoodIndicator' (MainClass.java:'moody.Mood moody.AnnotationMoodIndicator$Moody.getMood()')"/>
  25. <message kind="weave" text="Type 'moody.AnnotationMoodImplementor' (MainClass.java) has intertyped method from 'moody.AnnotationMoodIndicator' (MainClass.java:'void moody.AnnotationMoodIndicator$Moody.setMood(moody.Mood)')"/>
  26. </compile>
  27. <run class="moody.MainClass">
  28. <stderr>
  29. <line text="ami0's mood is HAPPY"/>
  30. <line text="ami1's mood is now JOLLY"/>
  31. <line text="ami0's mood is still HAPPY"/>
  32. </stderr>
  33. </run>
  34. </ajc-test>
  35. <!-- when interface is binary -->
  36. <ajc-test dir="bugs151/atDecp/case3" title="atDecp - binary interface">
  37. <compile files="Mood.java,Moody.java" outjar="moody.jar" options="-1.5"/>
  38. <compile files="MainClass.java" classpath="moody.jar" options="-1.5 -showWeaveInfo">
  39. <message kind="weave" text="Extending interface set for type 'theapp.AnnotationMoodImplementor' (MainClass.java) to include 'moody.Moody' (MainClass.java)"/>
  40. <message kind="weave" text="Type 'theapp.AnnotationMoodImplementor' (MainClass.java) has intertyped method from 'theapp.AnnotationMoodIndicator' (MainClass.java:'moody.Mood moody.Moody.getMood()')"/>
  41. <message kind="weave" text="Type 'theapp.AnnotationMoodImplementor' (MainClass.java) has intertyped method from 'theapp.AnnotationMoodIndicator' (MainClass.java:'void moody.Moody.setMood(moody.Mood)')"/>
  42. </compile>
  43. <run class="theapp.MainClass">
  44. <stderr>
  45. <line text="ami0's mood is HAPPY"/>
  46. <line text="ami1's mood is now JOLLY"/>
  47. <line text="ami0's mood is still HAPPY"/>
  48. </stderr>
  49. </run>
  50. </ajc-test>
  51. <!-- when interface is binary and implementation is not an inner -->
  52. <ajc-test dir="bugs151/atDecp/case4" title="atDecp - binary interface - 2">
  53. <compile files="Mood.java,Moody.java" outjar="moody.jar" options="-1.5"/>
  54. <compile files="MainClass.java,AnnotationMoodImplementor.java,TheAspect.java,MoodyImpl.java" classpath="moody.jar" options="-1.5 -showWeaveInfo">
  55. <message kind="weave" text="Extending interface set for type 'theapp.AnnotationMoodImplementor' (AnnotationMoodImplementor.java) to include 'moody.Moody' (TheAspect.java)"/>
  56. <message kind="weave" text="Type 'theapp.AnnotationMoodImplementor' (AnnotationMoodImplementor.java) has intertyped method from 'theapp.AnnotationMoodIndicator' (TheAspect.java:'moody.Mood moody.Moody.getMood()')"/>
  57. <message kind="weave" text="Type 'theapp.AnnotationMoodImplementor' (AnnotationMoodImplementor.java) has intertyped method from 'theapp.AnnotationMoodIndicator' (TheAspect.java:'void moody.Moody.setMood(moody.Mood)')"/>
  58. </compile>
  59. <run class="theapp.MainClass">
  60. <stderr>
  61. <line text="ami0's mood is HAPPY"/>
  62. <line text="ami1's mood is now JOLLY"/>
  63. <line text="ami0's mood is still HAPPY"/>
  64. </stderr>
  65. </run>
  66. </ajc-test>
  67. <!-- atDecp end -->
  68. <ajc-test dir="bugs151/pr126560" title="@AJ deow doesn't throw an invalidAbsoluteTypeName when specify type in the same package">
  69. <compile files="pkg1/C.java, pkg1/A.java" options="-1.5">
  70. <message kind="error" line="8" text="error"/>
  71. <message kind="warning" line="5" text="warning"/>
  72. </compile>
  73. </ajc-test>
  74. <ajc-test dir="bugs151/pr126560" title="@AJ deow doesn't throw an invalidAbsoluteTypeName when specify type in the same file">
  75. <compile files="pkg2/InOneFile.java" options="-1.5">
  76. <message kind="warning" line="14" text="call hello"/>
  77. <message kind="error" line="15" text="call hi"/>
  78. </compile>
  79. </ajc-test>
  80. <ajc-test dir="bugs151/pr98901" title="annotations and itds">
  81. <compile files="Failing.java" options="-1.5"/>
  82. <run class="Failing">
  83. <stderr>
  84. <line text="On TestInterface:@TestAnnotation(value=true)" vm="1.5-13"/>
  85. <line text="On TestInterface:@TestAnnotation(true)" vm="14-"/>
  86. <line text="On Failing:@TestAnnotation(value=true)" vm="1.5-13"/>
  87. <line text="On Failing:@TestAnnotation(true)" vm="14-"/>
  88. </stderr>
  89. </run>
  90. </ajc-test>
  91. <ajc-test dir="bugs151/pr98901" title="annotations and itds - 2">
  92. <compile files="Failing2.java" options="-1.5"/>
  93. <run class="Failing2">
  94. <stderr>
  95. <line text="On TestInterface:@TestAnnotation(value=true)" vm="1.5-13"/>
  96. <line text="On TestInterface:@TestAnnotation(true)" vm="14-"/>
  97. <line text="On Failing2:@TestAnnotation(value=true)" vm="1.5-13"/>
  98. <line text="On Failing2:@TestAnnotation(true)" vm="14-"/>
  99. </stderr>
  100. </run>
  101. </ajc-test>
  102. <ajc-test dir="bugs151/pr132926" pr="132926" title="crashing on annotation type resolving with asm - 1">
  103. <compile files="InputAnnotation.java,AffectedType.java" options="-1.5"/>
  104. </ajc-test>
  105. <ajc-test dir="bugs151/pr132926" pr="132926" title="crashing on annotation type resolving with asm - 2">
  106. <compile files="InputAnnotation.java" outjar="foo.jar" options="-1.5"/>
  107. <compile files="AffectedType.java" classpath="foo.jar" options="-1.5"/>
  108. </ajc-test>
  109. <ajc-test dir="bugs151/pr132926" pr="132926" title="crashing on annotation type resolving with asm - 3">
  110. <compile files="InputAnnotation2.java" outjar="foo.jar" options="-1.5"/>
  111. <compile files="AffectedType.java" classpath="foo.jar" options="-1.5">
  112. <message kind="error" line="9" text="AffectedType is not a valid target for annotation InputAnnotation, this annotation can only be applied to these element types {METHOD}"/>
  113. </compile>
  114. </ajc-test>
  115. <ajc-test dir="bugs151/pr133307" title="circular generics">
  116. <compile files="Broken.aj" options="-1.5"/>
  117. </ajc-test>
  118. <ajc-test dir="bugs151/pr123553" title="generic advice parameters">
  119. <compile files="A.java" options="-1.5"/>
  120. <run class="A"/>
  121. </ajc-test>
  122. <ajc-test dir="bugs151/pr133298" title="doubly annotating a method with declare">
  123. <compile files="DecA.java" options="-1.5"/>
  124. <run class="DecA">
  125. <stderr>
  126. <line text="There are 2 annotations on public void m()"/>
  127. <line text="1) One"/>
  128. <line text="2) Two"/>
  129. <line text="There are 2 annotations on public Target(int):"/>
  130. <line text="1) Four"/>
  131. <line text="2) Three"/>
  132. <line text="There are 2 annotations on public int x:"/>
  133. <line text="1) Five"/>
  134. <line text="2) Six"/>
  135. </stderr>
  136. </run>
  137. </ajc-test>
  138. <ajc-test dir="bugs151/pr133298" title="doubly annotating a method with declare - 2">
  139. <compile files="DecA2.java" options="-1.5"/>
  140. <run class="DecA2">
  141. <stderr>
  142. <line text="There are 2 annotations on public void Target.m()"/>
  143. <line text="1) One"/>
  144. <line text="2) Two"/>
  145. <line text="There are 2 annotations on public void A.m()"/>
  146. <line text="1) One"/>
  147. <line text="2) Two"/>
  148. </stderr>
  149. </run>
  150. </ajc-test>
  151. <ajc-test dir="bugs151/pr129566" title="arrayindexoutofbounds">
  152. <compile files="SkipList.java" options="-1.5"/>
  153. </ajc-test>
  154. <ajc-test dir="bugs151" title="member types in generic types">
  155. <compile files="pr122458.aj" options="-1.5 -emacssym"/>
  156. </ajc-test>
  157. <ajc-test dir="bugs151/pr127299" title="missing import gives funny message">
  158. <compile files="ModelErrorConversion.aj" options="-1.5"/>
  159. </ajc-test>
  160. <ajc-test dir="bugs151/pr122742" title="@AJ VerifyError with @AfterThrowing and thisJoinPoint argument">
  161. <compile files="AfterThrowingTest.java" options="-1.5"/>
  162. <run class="AfterThrowingTest">
  163. </run>
  164. </ajc-test>
  165. <ajc-test dir="bugs151/pr122742" title="@AJ VerifyError with @AfterReturning and thisJoinPoint argument">
  166. <compile files="AfterReturningTest.java" options="-1.5"/>
  167. <run class="AfterReturningTest">
  168. </run>
  169. </ajc-test>
  170. <ajc-test dir="bugs151/pr120527" title="incorrect unused interface message">
  171. <compile files="Bugs.aj" options="-warn:unusedPrivate"/>
  172. </ajc-test>
  173. <ajc-test dir="bugs151/pr123901" title="inlinevisitor NPE">
  174. <compile files="A.java,B.java" options="-1.5">
  175. <message kind="error" line="5" text="A cannot be resolved or is not a field"/>
  176. </compile>
  177. </ajc-test>
  178. <ajc-test dir="bugs151" title="member types in generic types - 2">
  179. <compile files="pr122458_2.aj" options="-1.5 -emacssym"/>
  180. <run class="pr122458_2"/>
  181. </ajc-test>
  182. <ajc-test dir="bugs151/pr123695" title="Internal nullptr exception with complex declare annotation">
  183. <compile files="InjectName.java,Main.java,MarkMyMethods.java,MarkMyMethodsAspect.java,NameAspect.java,Named.java,Read.java,Write.java" options="-1.5"/>
  184. </ajc-test>
  185. <ajc-test dir="bugs151/pr124105" title="hasMember problems with packages">
  186. <compile files="com/test/IOption.java,com/test/IXOption.java,com/test/IYOption.java,com/test/IZOption.java,com/test/MyBrokenXOption.java,com/test/MyXOption.java,com/test/OptionAspect.aj,com/test/OptionType.java" options="-1.5 -XhasMember">
  187. <message kind="error" line="4" text="IOption implementations must provide a constructor which accepts an OptionType"/>
  188. </compile>
  189. </ajc-test>
  190. <ajc-test dir="bugs151/pr124803" title="generics and different numbers of type variables">
  191. <compile files="Test.java,TestAspect.java" options="-1.5 -showWeaveInfo">
  192. <message kind="weave" text="Join point 'method-execution(void Test.foo(java.lang.Number))' in Type 'Test' (Test.java:12) advised by after advice from 'TestAspect' (TestAspect.java:4)"/>
  193. </compile>
  194. <run class="Test">
  195. <stderr>
  196. <line text="Aspects:execution(void Test.foo(Number))"/>
  197. </stderr>
  198. </run>
  199. </ajc-test>
  200. <ajc-test dir="bugs151/pr124803" title="generics and different numbers of type variables - classes">
  201. <compile files="Test2.java,TestAspect2.java" options="-1.5 -showWeaveInfo">
  202. <message kind="weave" text="Join point 'method-execution(void Test2.foo(java.lang.Number))' in Type 'Test2' (Test2.java:12) advised by after advice from 'TestAspect2' (TestAspect2.java:4)"/>
  203. <message kind="weave" text="Join point 'method-execution(void Generic1.foo(java.lang.Number))' in Type 'Generic1' (Test2.java:2) advised by after advice from 'TestAspect2' (TestAspect2.java:4) [with runtime test]"/>
  204. </compile>
  205. <run class="Test2">
  206. <stderr>
  207. <line text="Aspects:execution(void Test2.foo(Number))"/>
  208. </stderr>
  209. </run>
  210. </ajc-test>
  211. <ajc-test dir="bugs151/pr124808" title="parameterized collection fields matched via pointcut">
  212. <compile files="Test.java,TestAspect.java" options="-1.5"/>
  213. <run class="Test">
  214. <stderr>
  215. <line text="GO Aspects! get(Set Test.ints)"/>
  216. </stderr>
  217. </run>
  218. </ajc-test>
  219. <ajc-test dir="bugs151" title="calling inherited generic method from around advice">
  220. <compile files="pr124999.aj" options="-1.5"/>
  221. <run class="pr124999"/>
  222. </ajc-test>
  223. <ajc-test dir="bugs151/pr124654" title="generic aspects and annotations">
  224. <compile files="GenericAnnotation.java,TestSubAspect.java" options="-1.5"/>
  225. <run class="TestSubAspect">
  226. <stderr>
  227. <line text="Reference pointcut advice. interface MyAnnotation"/>
  228. <line text="Inlined pointcut advice. interface MyAnnotation"/>
  229. <line text="run running"/>
  230. </stderr>
  231. </run>
  232. </ajc-test>
  233. <ajc-test dir="bugs151" title="incorrectly referencing pointcuts">
  234. <compile files="pr122452.aj" options="-1.5">
  235. <message kind="warning" line="2" text="no match for this type name: Point [Xlint:invalidAbsoluteTypeName]"/>
  236. <message kind="warning" line="3" text="no match for this type name: related.Hello [Xlint:invalidAbsoluteTypeName]"/>
  237. <message kind="error" line="4" text="Syntax error on token &quot;*&quot;, &quot;(&quot; expected"/>
  238. </compile>
  239. </ajc-test>
  240. <ajc-test dir="bugs151" title="incorrectly referencing pointcuts - 2">
  241. <compile files="pr122452_2.aj" options="-1.5">
  242. <message kind="error" line="2" text="Syntax error on token &quot;*&quot;, &quot;(&quot; expected"/>
  243. </compile>
  244. </ajc-test>
  245. <ajc-test dir="bugs151/pr125080" title="mixing numbers of type parameters">
  246. <compile files="Test.java" options="-1.5"/>
  247. <run class="ConcreteAspect"/>
  248. </ajc-test>
  249. <ajc-test dir="bugs151/pr125080" title="mixing numbers of type parameters - 2">
  250. <compile files="Test2.java" options="-1.5"/>
  251. <run class="ConcreteAspect"/>
  252. </ajc-test>
  253. <ajc-test dir="bugs151/pr125295" title="new IProgramElement methods">
  254. <compile files="pkg/C.java,pkg/A.aj" options="-emacssym"/>
  255. </ajc-test>
  256. <ajc-test dir="bugs151/pr125475" title="define empty pointcut using an annotation">
  257. <compile files="TestEmptyPointcutAtAspect.java" options="-1.5"/>
  258. </ajc-test>
  259. <ajc-test dir="bugs151/pr125475" title="define empty pointcut using an annotation - 2">
  260. <compile files="TestEmptyPointcutAtAspect2.java" options="-1.5 -showWeaveInfo">
  261. <message kind="warning" line="10" text="advice defined in TestEmptyPointcutAtAspect2 has not been applied [Xlint:adviceDidNotMatch]"/>
  262. </compile>
  263. </ajc-test>
  264. <ajc-test dir="bugs151/pr125475" title="define empty pointcut using aop.xml">
  265. <compile files="Test.java TestAspect.aj"/>
  266. <run class="Test" ltw="aop.xml"/>
  267. </ajc-test>
  268. <ajc-test dir="bugs151/pr128744" title="broken ltw">
  269. <compile files="Hello.java World.java" options="-1.5" />
  270. <run class="Hello" ltw="aop.xml">
  271. <stdout>
  272. <line text="Hello"/>
  273. <line text="World"/>
  274. </stdout>
  275. </run>
  276. </ajc-test>
  277. <ajc-test dir="bugs151/pr125699" title="inherit advice with this() and thisJoinPoint">
  278. <compile files="Tracing.aj, TestTracing.aj, AtTestTracing.java" options="-1.5">
  279. <message kind="warning" line="13" text="advice defined in Tracing has not been applied [Xlint:adviceDidNotMatch]"/>
  280. <message kind="warning" line="8" text="advice defined in Tracing has not been applied [Xlint:adviceDidNotMatch]"/>
  281. <message kind="warning" line="3" text="advice defined in Tracing has not been applied [Xlint:adviceDidNotMatch]"/>
  282. </compile>
  283. </ajc-test>
  284. <ajc-test dir="bugs151/pr125699" title="inherit advice with this() and thisJoinPoint - 2">
  285. <compile files="Tracing.aj, SubAbstractTracing.aj, SubAtAj.java" options="-1.5">
  286. <message kind="warning" line="13" text="advice defined in Tracing has not been applied [Xlint:adviceDidNotMatch]"/>
  287. <message kind="warning" line="8" text="advice defined in Tracing has not been applied [Xlint:adviceDidNotMatch]"/>
  288. <message kind="warning" line="3" text="advice defined in Tracing has not been applied [Xlint:adviceDidNotMatch]"/>
  289. </compile>
  290. </ajc-test>
  291. <ajc-test dir="bugs151/pr125810" title="warning when inherited pointcut not made concrete">
  292. <compile files="SuperAspect.aj, SubAspect.aj, SubAtAspect.java" options="-1.5">
  293. <message kind="error" line="3" text="inherited abstract pointcut SuperAspect.scope() is not made concrete in SubAspect"/>
  294. <message kind="error" line="1" text="inherited abstract pointcut SuperAspect.scope() is not made concrete in SubAspect"/>
  295. <message kind="error" line="3" text="inherited abstract pointcut SuperAspect.scope() is not made concrete in SubAtAspect"/>
  296. <message kind="error" line="4" text="inherited abstract pointcut SuperAspect.scope() is not made concrete in SubAtAspect"/>
  297. </compile>
  298. </ajc-test>
  299. <ajc-test dir="bugs151" title="E extends Enum(E) again">
  300. <compile files="Pr126316.aj" options="-1.5"/>
  301. </ajc-test>
  302. <ajc-test dir="bugs151" title="@AJ without JoinPoint import">
  303. <compile files="pr121616.java" options="-1.5">
  304. <message kind="error" line="13" text="JoinPoint cannot be resolved to a type"/>
  305. </compile>
  306. </ajc-test>
  307. <ajc-test dir="bugs151/pr122370" title="@AJ declare parents retains field state">
  308. <compile files="moody/AnnotationMoodImplementor.java, moody/AnnotationMoodIndicator.java, moody/Mood.java, moody/MainClass.java" options="-1.5"/>
  309. <run class="moody.MainClass">
  310. <stdout>
  311. <line text="ami0's mood is HAPPY"/>
  312. <line text="ami1's mood is now JOLLY"/>
  313. <line text="ami0's mood is still HAPPY"/>
  314. </stdout>
  315. </run>
  316. </ajc-test>
  317. <ajc-test dir="bugs151" title="@AJ no npe with pointcut containing or, this and a wildcard">
  318. <compile files="pr128237.java" options="-1.5"/>
  319. </ajc-test>
  320. <ajc-test dir="bugs151" title="Generic aspects with annotation type parameters">
  321. <compile files="GenericAspectWithAnnotationTypeParameter.aj" options="-1.5"/>
  322. <run class="GenericAspectWithAnnotationTypeParameter">
  323. <stdout>
  324. <line text="annotation match - no binding"/>
  325. <line text="execution with annotation match"/>
  326. <line text="annotation match - binding"/>
  327. <line text="hello"/>
  328. </stdout>
  329. </run>
  330. </ajc-test>
  331. <ajc-test dir="bugs151" title="Pointcut interfaces">
  332. <compile files="pr130869.aj" options="-1.5">
  333. <message kind="warning" line="30" text="no directly runnable classes"/>
  334. </compile>
  335. </ajc-test>
  336. <ajc-test dir="bugs151" title="no ClassCastException with generic aspect and unknown type">
  337. <compile files="pr131933.aj" options="-1.5">
  338. <message kind="error" line="5" text="can't bind type name 'MyList'"/>
  339. </compile>
  340. </ajc-test>
  341. <!-- New features down here... when they arent big enough to have their own test file -->
  342. <ajc-test dir="features151/ptw" title="exposing withintype">
  343. <compile files="ExposedType.java" options="-1.5"/>
  344. <run class="ExposedType">
  345. <stderr>
  346. <line text="here I am execution(void ExposedTypeOne.foo()): for class ExposedTypeOne"/>
  347. <line text="here I am execution(void ExposedTypeTwo.foo()): for class ExposedTypeTwo"/>
  348. <line text="here I am execution(void ExposedTypeThree.foo()): for class ExposedTypeThree"/>
  349. </stderr>
  350. </run>
  351. </ajc-test>
  352. <ajc-test dir="features151/swallowedExceptions" title="swallowed exceptions">
  353. <compile files="SwallowedException.java" options="-Xlint:warning">
  354. <message kind="warning" line="11" text="Exception swallowed in catch block"/>
  355. </compile>
  356. </ajc-test>
  357. <ajc-test dir="features151/swallowedExceptions" title="swallowed exceptions with xlint">
  358. <compile files="SwallowedException.java">
  359. </compile>
  360. </ajc-test>
  361. </suite>