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.

ajc190.xml 9.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. <!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]>
  2. <suite>
  3. <ajc-test dir="bugs190/paramannos" title="param annos negative">
  4. <compile files="Code.java" options="-1.9 -showWeaveInfo">
  5. <message kind="weave" text="Join point 'constructor-execution(void Code.&lt;init&gt;(java.lang.Object))' in Type 'Code' (Code.java:8) advised by before advice from 'X' (Code.java:12)"/>
  6. </compile>
  7. </ajc-test>
  8. <ajc-test dir="bugs190/modules/aaa" title="build a module">
  9. <compile files="module-info.java com/foo1/C1.java" options="-1.9"/>
  10. </ajc-test>
  11. <ajc-test dir="bugs190/modules/bbb" title="run a module - classpath">
  12. <compile files="module-info.java aaa/bbb/A.java" options="-1.9"/>
  13. <run class="aaa.bbb.A">
  14. <stdout>
  15. <line text="A running"/>
  16. </stdout>
  17. </run>
  18. </ajc-test>
  19. <ajc-test dir="bugs190/modules/bbb" title="run a module - modulepath">
  20. <compile files="module-info.java aaa/bbb/A.java" options="-1.9"/>
  21. <run modulepath="$sandbox" module="my.module/aaa.bbb.A">
  22. <stdout>
  23. <line text="A running"/>
  24. </stdout>
  25. </run>
  26. </ajc-test>
  27. <ajc-test dir="bugs190/modules/bbb" title="package and run a module - modulepath">
  28. <compile files="module-info.java aaa/bbb/A.java" options="-1.9" outjar="my.module.jar"/>
  29. <file deletefile="module-info.java"/>
  30. <file deletefile="aaa"/>
  31. <run modulepath="my.module.jar" module="my.module/aaa.bbb.A">
  32. <stdout>
  33. <line text="A running"/>
  34. </stdout>
  35. </run>
  36. </ajc-test>
  37. <ajc-test dir="bugs190/modules/ccc" title="compile regular code using module code">
  38. <compile files="module-info.java aaa/bbb/A.java" options="-1.9" outjar="modules/my.module.jar"/>
  39. <file deletefile="module-info.java"/>
  40. <file deletefile="aaa"/>
  41. <compile files="InvokeA.java" options="-1.9" modulepath="$sandbox/modules/my.module.jar"/>
  42. </ajc-test>
  43. <ajc-test dir="bugs190/modules/ddd" title="compile regular code using module code that isn't visible">
  44. <compile files="module-info.java aaa/bbb/A.java" options="-1.9" outjar="modules/my.module.jar"/>
  45. <compile files="InvokeA.java" options="-1.9" modulepath="$sandbox/modules/my.module.jar">
  46. <message kind="error" text="package aaa.bbb is not visible"/>
  47. </compile>
  48. </ajc-test>
  49. <ajc-test dir="bugs190/modules/eee" title="binary weaving module">
  50. <compile files="module-info.java aaa/bbb/A.java" options="-1.9" outjar="my.module.jar"/>
  51. <file deletefile="module-info.java"/>
  52. <file deletefile="aaa"/>
  53. <compile files="Azpect.java" inpath="my.module.jar" outjar="my.module.woven.jar"/>
  54. <run modulepath="my.module.woven.jar" module="my.module/aaa.bbb.A">
  55. <stdout>
  56. <line text="Azpect running"/>
  57. <line text="A running"/>
  58. </stdout>
  59. </run>
  60. </ajc-test>
  61. <ajc-test dir="bugs190/520135" title="funny signature with method reference">
  62. <compile files="FailsApectJ.java" options="-1.8"/>
  63. </ajc-test>
  64. <ajc-test dir="bugs190/modules/fff" title="compile module including aspects">
  65. <compile files="module-info.java pkg/Demo.java otherpkg/Azpect.java" modulepath="$runtimemodule" outjar="demomodule.jar" options="-1.9"/>
  66. <run modulepath="$runtimemodule,demomodule.jar" module="demo/pkg.Demo">
  67. <stdout>
  68. <line text="Azpect running"/>
  69. <line text="Demo running"/>
  70. </stdout>
  71. </run>
  72. </ajc-test>
  73. <ajc-test dir="bugs190/modules/eee" title="compile module and apply aspects via aspectpath">
  74. <compile files="module-info.java aaa/bbb/A.java" options="-1.9" outjar="my.module.jar"/>
  75. <file deletefile="module-info.java"/>
  76. <file deletefile="aaa"/>
  77. <compile files="Azpect.java" outjar="azpects.jar" options="-1.4"/>
  78. <compile options="-showWeaveInfo" inpath="my.module.jar" aspectpath="azpects.jar" outjar="my.module.woven.jar">
  79. <message kind="weave" text="Join point 'method-execution(void aaa.bbb.A.main(java.lang.String[]))' in Type 'aaa.bbb.A' (A.java:4) advised by before advice from 'aspects.Azpect' (azpects.jar!Azpect.class:4(from Azpect.java))"/>
  80. </compile>
  81. <file deletefile="my.module.jar"/>
  82. <run classpath="my.module.woven.jar,azpects.jar" class="aaa.bbb.A">
  83. <stdout>
  84. <line text="Azpect running"/>
  85. <line text="A running"/>
  86. </stdout>
  87. </run>
  88. </ajc-test>
  89. <ajc-test dir="bugs190/modules/ggg" title="module path vs classpath 1">
  90. <!-- build some simple code into a jar we can depend on *not a module* -->
  91. <compile files="ddd/D.java" options="-1.9" outjar="foo.jar"/>
  92. <file deletefile="ddd/D.java"/>
  93. <!-- compile a module that depends on that -->
  94. <!-- this fails because if you start working with modules you commit to the modules story and classpath
  95. becomes irrelevant -->
  96. <compile files="module-info.java aaa/bbb/A.java" options="-1.9" outjar="module.jar" classpath="foo.jar">
  97. <message kind="error" text="The type ddd.D is not accessible"/>
  98. <message kind="error" text="D cannot be resolved"/>
  99. <!--
  100. <message kind="error" text="The import ddd cannot be resolved"/>
  101. <message kind="error" text="package ddd is not visible"/>
  102. -->
  103. </compile>
  104. </ajc-test>
  105. <ajc-test dir="bugs190/modules/hhh" title="module path vs classpath 2">
  106. <!-- build some simple code into a jar we can depend on *not a module* -->
  107. <file renamefrom="module-info-a.java" renameto="module-info.java"/>
  108. <compile files="module-info.java ddd/D.java" options="-1.9" outjar="my.module.a.jar"/>
  109. <!--
  110. <file renamefrom="module-info-b.java" renameto="module-info.java"/>
  111. <compile files="module-info.java aaa/bbb/A.java" options="-1.9" outjar="my.module.b.jar" modulepath="my.module.a.jar"/>
  112. -->
  113. </ajc-test>
  114. <ajc-test dir="bugs190/modules/iii" title="compile use of java.xml.bind">
  115. <compile files="UsesJAXB.java" options="--add-modules java.xml.bind -1.9"/>
  116. <run class="UsesJAXB" vmargs="--add-modules java.xml.bind">
  117. <stdout>
  118. <line text="UsesJAXB.running..."/>
  119. </stdout>
  120. </run>
  121. </ajc-test>
  122. <ajc-test dir="bugs190/modules/iii" title="weave use of java.xml.bind">
  123. <compile files="UsesJAXB.java Azpect.java" options="--add-modules java.xml.bind -1.9"/>
  124. <run class="UsesJAXB" vmargs="--add-modules java.xml.bind">
  125. <stdout>
  126. <line text="UsesJAXB.running..."/>
  127. <line text="null"/>
  128. </stdout>
  129. </run>
  130. </ajc-test>
  131. <ajc-test dir="bugs190/modules/iii" title="limit modules 1">
  132. <compile files="UsesJAXB.java Azpect.java" options="--limit-modules java.xml.bind -1.9"/>
  133. <run class="UsesJAXB" vmargs="--limit-modules java.xml.bind">
  134. <stdout>
  135. <line text="UsesJAXB.running..."/>
  136. <line text="null"/>
  137. </stdout>
  138. </run>
  139. </ajc-test>
  140. <ajc-test dir="bugs190/modules/iii" title="add reads 1">
  141. <compile files="UsesJAXB.java Azpect.java" options="--add-reads java.sql=java.xml.bind --add-modules java.sql -1.9"/>
  142. <run class="UsesJAXB" vmargs="--add-modules java.xml.bind ">
  143. <stdout>
  144. <line text="UsesJAXB.running..."/>
  145. <line text="null"/>
  146. </stdout>
  147. </run>
  148. </ajc-test>
  149. <!--
  150. <compile files="module-info.java aaa/bbb/A.java" options="-1.9" outjar="module.jar" aspectpath="foo.jar"/>
  151. <compile files="module-info.java aaa/bbb/A.java" options="-1.9" outjar="my.module.jar"/>
  152. <file deletefile="module-info.java"/>
  153. <file deletefile="aaa"/>
  154. <compile files="Azpect.java" outjar="azpects.jar"/>
  155. <compile options="-showWeaveInfo" inpath="my.module.jar" aspectpath="azpects.jar" outjar="my.module.woven.jar">
  156. <message kind="weave" text="Join point 'method-execution(void aaa.bbb.A.main(java.lang.String[]))' in Type 'aaa.bbb.A' (A.java:4) advised by before advice from 'aspects.Azpect' (azpects.jar!Azpect.class:4(from Azpect.java))"/>
  157. </compile>
  158. <file deletefile="my.module.jar"/>
  159. <run classpath="my.module.woven.jar,azpects.jar" class="aaa.bbb.A">
  160. <stdout>
  161. <line text="Azpect running"/>
  162. <line text="A running"/>
  163. </stdout>
  164. </run>
  165. </ajc-test>
  166. -->
  167. <ajc-test dir="bugs190/modules" title="weave module">
  168. <compile files="aspect1/Azpect1.java" inpath="module1/module-one.jar" outjar="runner.jar" options="-1.8"/>
  169. <run classpath="runner.jar" class="a.b.c.Code"/>
  170. </ajc-test>
  171. <ajc-test dir="bugs190/various" title="setting static final outside clinit">
  172. <compile files="Code.java" options="-1.9"/>
  173. <run class="Code">
  174. <stdout>
  175. <line text="call(void java.io.PrintStream.println(String))"/>
  176. <line text="running"/>
  177. </stdout>
  178. </run>
  179. </ajc-test>
  180. <!-- from ajc153 -->
  181. <ajc-test dir="bugs153/pr156962" title="Test Annot Method Has Member 1">
  182. <compile files="Sample.java, LiftDeprecation.aj" options="-1.9 -XhasMember -showWeaveInfo -Xlint:ignore">
  183. <message kind="weave" text="'Sample' (Sample.java:1) is annotated with @Deprecated type annotation from 'LiftDeprecation' (LiftDeprecation.aj:2)"/>
  184. </compile>
  185. </ajc-test>
  186. <!-- from ajc153 -->
  187. <ajc-test dir="bugs153/pr156962" title="Test Annot Method Has Member 2">
  188. <compile files="Sample.java, LiftDeprecation.aj" options="-1.8 -XhasMember -showWeaveInfo -Xlint:ignore">
  189. <message kind="weave" text="'Sample' (Sample.java:1) is annotated with @Deprecated type annotation from 'LiftDeprecation' (LiftDeprecation.aj:2)"/>
  190. </compile>
  191. </ajc-test>
  192. </suite>