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.

ajc174.xml 9.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]>
  2. <suite>
  3. <ajc-test dir="bugs174/ajdt_markers" title="ajdt markers">
  4. <compile files="Code.java" options="-1.5 -showWeaveInfo">
  5. </compile>
  6. </ajc-test>
  7. <ajc-test dir="bugs174/extra_inserts" title="extra inserts">
  8. <compile files="Code.java" options="-1.5">
  9. <message kind="warning" line="8" text="Call to foo made inside class Bar"/>
  10. <message kind="warning" line="15" text="Call to foo made inside class Boo"/>
  11. <message kind="warning" line="8" text="Call to foo made inside member booble"/>
  12. <message kind="warning" line="15" text="Call to foo made inside member m"/>
  13. <message kind="warning" line="8" text="Call to foo made inside member void Bar.booble()"/>
  14. <message kind="warning" line="15" text="Call to foo made inside member void Boo.m()"/>
  15. </compile>
  16. </ajc-test>
  17. <ajc-test dir="bugs174/pr419279" title="more configurable lint">
  18. <compile files="Code.java" options="-1.5">
  19. <message kind="warning" text="advice defined in Code has not been applied [Xlint:adviceDidNotMatch]"/>
  20. </compile>
  21. <compile files="Code.java" options="-1.5 -Xlint:adviceDidNotMatch=ignore">
  22. </compile>
  23. <compile files="Code.java" options="-1.5 -Xlint:adviceDidNotMatch=error">
  24. <message kind="error" text="advice defined in Code has not been applied [Xlint:adviceDidNotMatch]"/>
  25. </compile>
  26. <compile files="Code.java" options="-1.5 -Xlint:foo=bar">
  27. <message kind="error" text="invalid Xlint key: foo"/>
  28. </compile>
  29. <compile files="Code.java" options="-1.5 -Xlint:adviceDidNotMatch=wibble">
  30. <message kind="error" text="invalid Xlint message kind (must be one of ignore, warning, error): wibble"/>
  31. </compile>
  32. <compile files="Code.java" options="-1.5 -Xlint:adviceDidNotMatch=ignore{adviceDidNotMatch=error">
  33. <message kind="error" text="advice defined in Code has not been applied [Xlint:adviceDidNotMatch]"/>
  34. </compile>
  35. <compile files="Code.java" options="-1.5 -Xlint:adviceDidNotMatch=error{noGuardForLazyTjp=error">
  36. <message kind="error" text="advice defined in Code has not been applied [Xlint:adviceDidNotMatch]"/>
  37. <message kind="error" text="can not build thisJoinPoint lazily for this advice since it has no suitable guard [Xlint:noGuardForLazyTjp]"/>
  38. </compile>
  39. </ajc-test>
  40. <ajc-test dir="bugs174/pr418129" title="annotated itd">
  41. <compile files="Target.java" options="-1.5 -showWeaveInfo">
  42. <message kind="weave" text="Type 'Behavior' (Target.java) has intertyped method from 'Trait' (Target.java:'java.lang.String Behavior.hello()')"/>
  43. <message kind="weave" text="Type 'Target' (Target.java) has intertyped method from 'Trait' (Target.java:'java.lang.String Behavior.hello()')"/>
  44. <message kind="weave" text="'public java.lang.String Target.hello()' (Target.java) is annotated with @Tagged method annotation from 'Target$A' (Target.java:18)"/>
  45. </compile>
  46. <run class="Target">
  47. <stdout>
  48. <line text="@Tagged()"/>
  49. </stdout>
  50. </run>
  51. </ajc-test>
  52. <!-- declared with throws exception -->
  53. <ajc-test dir="bugs174/pr418129" title="annotated itd 2">
  54. <compile files="Target2.java" options="-1.5 -showWeaveInfo">
  55. <message kind="weave" text="Type 'Behavior' (Target2.java) has intertyped method from 'Trait' (Target2.java:'java.lang.String Behavior.hello()')"/>
  56. <message kind="weave" text="Type 'Target2' (Target2.java) has intertyped method from 'Trait' (Target2.java:'java.lang.String Behavior.hello()')"/>
  57. <message kind="weave" text="'public java.lang.String Target2.hello()' (Target2.java) is annotated with @Tagged method annotation from 'Target2$A' (Target2.java:18)"/>
  58. </compile>
  59. <run class="Target2">
  60. <stdout>
  61. <line text="@Tagged()"/>
  62. </stdout>
  63. </run>
  64. </ajc-test>
  65. <!-- already annotated with another annotation -->
  66. <ajc-test dir="bugs174/pr418129" title="annotated itd 3">
  67. <compile files="Target3.java" options="-1.5 -showWeaveInfo">
  68. <message kind="weave" text="Type 'Behavior' (Target3.java) has intertyped method from 'Trait' (Target3.java:'java.lang.String Behavior.hello()')"/>
  69. <message kind="weave" text="Type 'Target3' (Target3.java) has intertyped method from 'Trait' (Target3.java:'java.lang.String Behavior.hello()')"/>
  70. <message kind="weave" text="'public java.lang.String Target3.hello()' (Target3.java) is annotated with @Tagged method annotation from 'Target3$A' (Target3.java:16)"/>
  71. </compile>
  72. <run class="Target3">
  73. <stdout>
  74. <line text="2"/>
  75. <line text="@Wibble()"/>
  76. <line text="@Tagged()"/>
  77. </stdout>
  78. </run>
  79. </ajc-test>
  80. <!-- already annotated with the same annotation -->
  81. <ajc-test dir="bugs174/pr418129" title="annotated itd 4">
  82. <compile files="Target4.java" options="-1.5 -showWeaveInfo">
  83. <message kind="weave" text="Type 'Behavior' (Target4.java) has intertyped method from 'Trait' (Target4.java:'java.lang.String Behavior.hello()')"/>
  84. <message kind="weave" text="Type 'Target4' (Target4.java) has intertyped method from 'Trait' (Target4.java:'java.lang.String Behavior.hello()')"/>
  85. <!-- warning turned off as it gets confusing - when the itd on the interface is hit by a deca -->
  86. <!--
  87. <message kind="warning" text="java.lang.String Target4.hello() - already has an annotation of type Tagged, cannot add a second instance [Xlint:elementAlreadyAnnotated]"/>
  88. -->
  89. </compile>
  90. <run class="Target4">
  91. <stdout>
  92. <line text="1"/>
  93. <line text="@Tagged(value=31)" vm="1.5-13"/>
  94. <line text="@Tagged(31)" vm="14-"/>
  95. </stdout>
  96. </run>
  97. </ajc-test>
  98. <ajc-test dir="bugs174/pr413378" title="super itd ctor">
  99. <compile files="Code.java" options="-1.5 -showWeaveInfo">
  100. <message kind="weave" text="Type 'Child' (Code.java) has intertyped constructor from 'MyTest' (Code.java:'void Child.&lt;init&gt;(java.lang.String, int)')"/>
  101. </compile>
  102. <run class="Code">
  103. <stdout>
  104. <line text="Get Age:50"/>
  105. <line text="Child Name:Andy"/>
  106. </stdout>
  107. </run>
  108. </ajc-test>
  109. <ajc-test dir="bugs174/pr368046" title="classloader exclusion - 1">
  110. <compile files="Azpect.java" outjar="foo.jar" options="-1.4"/>
  111. <compile files="Code.java" classpath="$sandbox/foo.jar"/>
  112. <run class="Code" classpath="$sandbox/foo.jar" ltw="aop1.xml">
  113. <stdout>
  114. <line text="advice"/>
  115. <line text="running"/>
  116. </stdout>
  117. <stderr>
  118. <line text="AspectJ Weaver"/>
  119. <line text="register classloader"/>
  120. <line text="using configuration"/>
  121. <line text="register aspect"/>
  122. <line text="processing reweavable"/>
  123. </stderr>
  124. </run>
  125. </ajc-test>
  126. <ajc-test dir="bugs174/pr368046" title="classloader exclusion - 2">
  127. <compile files="Azpect.java" outjar="foo.jar" options="-1.4"/>
  128. <compile files="Code.java" classpath="$sandbox/foo.jar"/>
  129. <run class="Code" classpath="$sandbox/foo.jar" ltw="aop1.xml">
  130. <stdout>
  131. <line text="advice"/>
  132. <line text="running"/>
  133. </stdout>
  134. <stderr>
  135. <line text="AspectJ Weaver"/>
  136. <line text="register classloader"/>
  137. <line text="using configuration"/>
  138. <line text="no longer creating weavers for these classloaders: [foo]"/>
  139. <line text="register aspect"/>
  140. <line text="processing reweavable"/>
  141. </stderr>
  142. </run>
  143. </ajc-test>
  144. <ajc-test dir="bugs174/pr368046" title="classloader exclusion - 3">
  145. <compile files="Azpect.java" outjar="foo.jar" options="-1.4"/>
  146. <compile files="Code.java" classpath="$sandbox/foo.jar"/>
  147. <run class="Code" classpath="$sandbox/foo.jar" ltw="aop1.xml">
  148. <stdout>
  149. <line text="advice"/>
  150. <line text="running"/>
  151. </stdout>
  152. <stderr>
  153. <line text="AspectJ Weaver"/>
  154. <line text="register classloader"/>
  155. <line text="using configuration"/>
  156. <line text="register aspect"/>
  157. <line text="processing reweavable"/>
  158. </stderr>
  159. </run>
  160. </ajc-test>
  161. <ajc-test dir="bugs174/pr368046" title="classloader exclusion - 4">
  162. <compile files="Azpect.java" outjar="foo.jar" options="-1.4"/>
  163. <compile files="Code.java" classpath="$sandbox/foo.jar"/>
  164. <run class="Code" classpath="$sandbox/foo.jar" ltw="aop2.xml">
  165. <stdout>
  166. <line text="advice"/>
  167. <line text="running"/>
  168. </stdout>
  169. <stderr>
  170. <line text="AspectJ Weaver"/>
  171. <line text="register classloader"/>
  172. <line text="using configuration"/>
  173. <line text="no longer creating weavers for these classloaders: [com.foo.Bar]"/>
  174. <line text="register aspect"/>
  175. <line text="processing reweavable"/>
  176. </stderr>
  177. </run>
  178. </ajc-test>
  179. <ajc-test dir="bugs174/pr368046" title="classloader exclusion - 5">
  180. <compile files="Azpect.java" outjar="foo.jar" options="-1.4"/>
  181. <compile files="Code.java" classpath="$sandbox/foo.jar"/>
  182. <run class="Code" classpath="$sandbox/foo.jar" ltw="aop3.xml">
  183. <stdout>
  184. <line text="advice"/>
  185. <line text="running"/>
  186. </stdout>
  187. <stderr>
  188. <line text="AspectJ Weaver"/>
  189. <line text="register classloader"/>
  190. <line text="using configuration"/>
  191. <line text="no longer creating weavers for these classloaders: [org.aspectj.weaver.loadtime.WeavingURLClassLoader]"/>
  192. <line text="register aspect"/>
  193. <line text="processing reweavable"/>
  194. </stderr>
  195. </run>
  196. </ajc-test>
  197. </suite>