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

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