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.

ajc1922.xml 8.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]>
  2. <!--
  3. JDK 22 (https://openjdk.org/projects/jdk/22/):
  4. Language features:
  5. JEP 456: Unnamed Variables & Patterns
  6. JEP 459: String Templates (Second Preview)
  7. JEP 463: Implicitly Declared Classes and Instance Main Methods (Second Preview)
  8. JEP 447: Statements before super(...) (Preview)
  9. API or JVM only:
  10. JEP 423: Region Pinning for G1
  11. JEP 454: Foreign Function & Memory API
  12. JEP 458: Launch Multi-File Source-Code Programs
  13. JEP 462: Structured Concurrency (Second Preview)
  14. JEP 464: Scoped Values (Second Preview)
  15. JEP 457: Class-File API (Preview)
  16. JEP 461: Stream Gatherers (Preview)
  17. JEP 460: Vector API (Seventh Incubator)
  18. -->
  19. <suite>
  20. <!-- Java 22 final, 21 preview -->
  21. <ajc-test dir="features1921/java21" vm="22" title="unnamed patterns">
  22. <compile files="UnnamedPatternsPreview1.java" options="-22"/>
  23. <run class="UnnamedPatternsPreview1">
  24. <stdout ordered="yes">
  25. <line text="2"/>
  26. <line text="side effect"/>
  27. <line text="0"/>
  28. <line text="1"/>
  29. <line text="java.awt.Point[x=1,y=2]"/>
  30. <line text="java.awt.Point[x=4,y=5]"/>
  31. <line text="java.awt.Point[x=1,y=0]"/>
  32. <line text="java.awt.Point[x=4,y=0]"/>
  33. <line text="Bad number: 123xy"/>
  34. <line text="Doing something within scoped context"/>
  35. <line text="Closing scoped context"/>
  36. <line text="{ONE=NODATA, TWO=NODATA, THREE=NODATA}"/>
  37. </stdout>
  38. </run>
  39. </ajc-test>
  40. <!-- Java 22 final, 21 preview -->
  41. <ajc-test dir="features1921/java21" vm="22" title="unnamed patterns aspect">
  42. <compile files="UnnamedPatternsPreview1Aspect.aj" options="-22"/>
  43. <run class="UnnamedPatternsPreview1Aspect">
  44. <stdout ordered="yes">
  45. <line text="execution(void UnnamedPatternsPreview1Aspect.main(String[]))"/>
  46. <line text="2"/>
  47. <line text="side effect"/>
  48. <line text="0"/>
  49. <line text="1"/>
  50. <line text="java.awt.Point[x=1,y=2]"/>
  51. <line text="java.awt.Point[x=4,y=5]"/>
  52. <line text="java.awt.Point[x=1,y=0]"/>
  53. <line text="java.awt.Point[x=4,y=0]"/>
  54. <line text="Bad number: 123xy"/>
  55. <line text="Doing something within scoped context"/>
  56. <line text="Closing scoped context"/>
  57. <line text="{ONE=NODATA, TWO=NODATA, THREE=NODATA}"/>
  58. </stdout>
  59. </run>
  60. </ajc-test>
  61. <!-- Java 22 final, 21 preview -->
  62. <ajc-test dir="new" vm="22" title="underscore can still be used in pointcut patterns on Java 21+ - 1">
  63. <compile files="NotCharInPointcut.java" options="-22">
  64. <message kind="warning" line="51" text="advice defined in A has not been applied [Xlint:adviceDidNotMatch]"/>
  65. <message kind="warning" line="52" text="advice defined in A has not been applied [Xlint:adviceDidNotMatch]"/>
  66. <message kind="warning" line="53" text="advice defined in A has not been applied [Xlint:adviceDidNotMatch]"/>
  67. </compile>
  68. <run class="NotCharInPointcut"/>
  69. </ajc-test>
  70. <!-- Java 22 final, 21 preview -->
  71. <ajc-test dir="features1921/java21" vm="22" title="underscore can still be used in pointcut patterns on Java 21+ - 2">
  72. <compile files="UnderscoreInPointcutAspect.aj" options="-22"/>
  73. <run class="UnderscoreInPointcutAspect">
  74. <stdout>
  75. <line text="[starts with underscore] execution(int UnderTest._add(int, int)) -> 12, 4"/>
  76. <line text="[contains underscore] execution(int UnderTest._add(int, int)) -> 12, 4"/>
  77. <line text="16"/>
  78. <line text="[starts with underscore] execution(int UnderTest._subtract(int, int)) -> 12, 4"/>
  79. <line text="[contains underscore] execution(int UnderTest._subtract(int, int)) -> 12, 4"/>
  80. <line text="8"/>
  81. <line text="[ends with underscore] execution(int UnderTest.multiply_(int, int)) -> 12, 4"/>
  82. <line text="[contains underscore] execution(int UnderTest.multiply_(int, int)) -> 12, 4"/>
  83. <line text="48"/>
  84. <line text="[ends with underscore] execution(int UnderTest.divide_(int, int)) -> 12, 4"/>
  85. <line text="[contains underscore] execution(int UnderTest.divide_(int, int)) -> 12, 4"/>
  86. <line text="3"/>
  87. <line text="[contains underscore] execution(int UnderTest.power_of(int, int)) -> 3, 3"/>
  88. <line text="27"/>
  89. <line text="[no underscore] execution(int UnderTest.squareRoot(int)) -> 49"/>
  90. <line text="7"/>
  91. </stdout>
  92. </run>
  93. </ajc-test>
  94. <!-- Java 21, 22 preview -->
  95. <ajc-test dir="features1921/java21" vm="22" title="string patterns">
  96. <compile files="StringPatternsPreview1.java" options="--enable-preview -22"/>
  97. <run class="StringPatternsPreview1" vmargs="--enable-preview">
  98. <stdout ordered="yes">
  99. <line text="Bill Duck"/>
  100. <line text="10 + 20 = 30"/>
  101. <line text="You have a special New Year's sale discount waiting for you!"/>
  102. <line text="Access at 2011-11-11 11:11:11 from localhost/127.0.0.1"/>
  103. <line text="The file _dummy.dat does not exist"/>
  104. <line text="The time is 11:11:11 or roughly eleven after eleven"/>
  105. <line text="apples, oranges, peaches"/>
  106. <line text=""/>
  107. <line text="&lt;html&gt;"/>
  108. <line text=" &lt;head&gt;"/>
  109. <line text=" &lt;title&gt;My Web Page&lt;/title&gt;"/>
  110. <line text=" &lt;/head&gt;"/>
  111. <line text=" &lt;body&gt;"/>
  112. <line text=" &lt;p&gt;Hello, world&lt;/p&gt;"/>
  113. <line text=" &lt;/body&gt;"/>
  114. <line text="&lt;/html&gt;"/>
  115. <line text=""/>
  116. <line text="Description Width Height Area"/>
  117. <line text="Alfa 17.80 31.40 558.92"/>
  118. <line text="Bravo 9.60 12.40 119.04"/>
  119. <line text="Charlie 7.10 11.23 79.73"/>
  120. <line text=" Total 757.69"/>
  121. <line text=""/>
  122. <line text="My name is Joan"/>
  123. </stdout>
  124. </run>
  125. </ajc-test>
  126. <!-- Java 21, 22 preview -->
  127. <ajc-test dir="features1921/java21" vm="22" title="string patterns aspect">
  128. <compile files="StringPatternsPreview1Aspect.aj" options="--enable-preview -22"/>
  129. <run class="StringPatternsPreview1Aspect" vmargs="--enable-preview">
  130. <stdout ordered="yes">
  131. <line text="execution(void StringPatternsPreview1Aspect.main(String[]))"/>
  132. <line text="Bill Duck"/>
  133. <line text="10 + 20 = 30"/>
  134. <line text="You have a special New Year's sale discount waiting for you!"/>
  135. <line text="Access at 2011-11-11 11:11:11 from localhost/127.0.0.1"/>
  136. <line text="The file _dummy.dat does not exist"/>
  137. <line text="The time is 11:11:11 or roughly eleven after eleven"/>
  138. <line text="apples, oranges, peaches"/>
  139. <line text=""/>
  140. <line text="&lt;html&gt;"/>
  141. <line text=" &lt;head&gt;"/>
  142. <line text=" &lt;title&gt;My Web Page&lt;/title&gt;"/>
  143. <line text=" &lt;/head&gt;"/>
  144. <line text=" &lt;body&gt;"/>
  145. <line text=" &lt;p&gt;Hello, world&lt;/p&gt;"/>
  146. <line text=" &lt;/body&gt;"/>
  147. <line text="&lt;/html&gt;"/>
  148. <line text=""/>
  149. <line text="Description Width Height Area"/>
  150. <line text="Alfa 17.80 31.40 558.92"/>
  151. <line text="Bravo 9.60 12.40 119.04"/>
  152. <line text="Charlie 7.10 11.23 79.73"/>
  153. <line text=" Total 757.69"/>
  154. <line text=""/>
  155. <line text="My name is Joan"/>
  156. </stdout>
  157. </run>
  158. </ajc-test>
  159. <!-- Java 21, 22 preview -->
  160. <ajc-test dir="features1921/java21" vm="22" title="named class with simple main method">
  161. <!-- Compiles without preview mode, but needs preview mode to run -->
  162. <compile files="NamedClassWithSimpleMainMethodPreview1.java" options="-22 --enable-preview"/>
  163. <run class="NamedClassWithSimpleMainMethodPreview1" vmargs="--enable-preview">
  164. <stdout>
  165. <line text="Hello world!"/>
  166. </stdout>
  167. </run>
  168. </ajc-test>
  169. <!-- Java 21, 22 preview -->
  170. <ajc-test dir="features1921/java21" vm="22" title="named aspect with simple main method">
  171. <!-- Compiles without preview mode, but needs preview mode to run -->
  172. <compile files="NamedAspectWithSimpleMainMethodPreview1.aj" options="-22 --enable-preview"/>
  173. <run class="NamedAspectWithSimpleMainMethodPreview1" vmargs="--enable-preview">
  174. <stdout>
  175. <line text="Hello world!"/>
  176. </stdout>
  177. </run>
  178. </ajc-test>
  179. <!-- Java 21, 22 preview -->
  180. <ajc-test dir="features1921/java21" vm="22" title="unnamed class with simple main method">
  181. <compile files="UnnamedClassWithSimpleMainMethodPreview1.java" options="-22 --enable-preview"/>
  182. <run class="UnnamedClassWithSimpleMainMethodPreview1" vmargs="--enable-preview">
  183. <stdout>
  184. <line text="Hello world!"/>
  185. </stdout>
  186. </run>
  187. </ajc-test>
  188. </suite>