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.

declareMixin.xml 6.5KB

15 lat temu
15 lat temu
15 lat temu
15 lat temu
15 lat temu
15 lat temu
15 lat temu
15 lat temu
15 lat temu
15 lat temu
15 lat temu
15 lat temu
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]>
  2. <suite>
  3. <ajc-test dir="features164/declareMixin" title="casea">
  4. <compile files="CaseA.java" options="-1.5"/>
  5. <run class="CaseA">
  6. <stdout>
  7. <line text="Delegate factory invoked"/>
  8. <line text="methodOne running"/>
  9. </stdout>
  10. </run>
  11. </ajc-test>
  12. <ajc-test dir="features164/declareMixin" title="caseb">
  13. <compile files="CaseB.java" options="-1.5"/>
  14. <run class="CaseB">
  15. <stdout>
  16. <line text="Delegate factory invoked"/>
  17. <line text="methodOne running"/>
  18. </stdout>
  19. </run>
  20. </ajc-test>
  21. <ajc-test dir="features164/declareMixin" title="casec">
  22. <compile files="CaseC.java" options="-1.5"/>
  23. <run class="CaseC">
  24. <stdout>
  25. <line text="Delegate factory invoked for CaseC instance"/>
  26. <line text="methodOne running"/>
  27. </stdout>
  28. </run>
  29. </ajc-test>
  30. <ajc-test dir="features164/declareMixin" title="cased">
  31. <compile files="CaseD.java" options="-1.5"/>
  32. <run class="CaseD">
  33. <stdout>
  34. <line text="Delegate factory invoked for CaseD instance"/>
  35. <line text="methodOne running"/>
  36. </stdout>
  37. </run>
  38. </ajc-test>
  39. <ajc-test dir="features164/declareMixin" title="casee">
  40. <compile files="CaseE.java" options="-1.5"/>
  41. <run class="CaseE">
  42. <stdout>
  43. <line text="Delegate factory invoked for CaseE instance: a"/>
  44. <line text="methodOne running on CaseE instance: a"/>
  45. <line text="Delegate factory invoked for CaseE instance: b"/>
  46. <line text="methodTwo running on CaseE instance: b"/>
  47. <line text="methodOne running on CaseE instance: a"/>
  48. <line text="methodTwo running on CaseE instance: b"/>
  49. </stdout>
  50. </run>
  51. </ajc-test>
  52. <ajc-test dir="features164/declareMixin" title="casee_concurrent">
  53. <compile files="CaseEConcurrent.java" options="-1.5"/>
  54. <run class="CaseEConcurrent">
  55. <stdout ordered="no">
  56. <!--
  57. Without the concurrency fix from https://github.com/eclipse-aspectj/aspectj/issues/198, each delegate factory
  58. would be invoked twice
  59. -->
  60. <line text="Delegate factory invoked for CaseEConcurrent instance: a"/>
  61. <line text="Delegate factory invoked for CaseEConcurrent instance: b"/>
  62. <line text="methodOne running on CaseEConcurrent instance: a"/>
  63. <line text="methodTwo running on CaseEConcurrent instance: a"/>
  64. <line text="methodOne running on CaseEConcurrent instance: b"/>
  65. <line text="methodTwo running on CaseEConcurrent instance: b"/>
  66. </stdout>
  67. </run>
  68. </ajc-test>
  69. <ajc-test dir="features164/declareMixin" title="casef">
  70. <compile files="CaseF.java" options="-1.5"/>
  71. <run class="CaseF">
  72. <stdout>
  73. <line text="Delegate factory invoked for CaseF instance"/>
  74. <line text="methodOne running"/>
  75. </stdout>
  76. </run>
  77. </ajc-test>
  78. <ajc-test dir="features164/declareMixin" title="caseg">
  79. <compile files="CaseG.java" options="-1.5"/>
  80. <run class="CaseG">
  81. <stdout>
  82. <line text="Delegate factory invoked for instance of A"/>
  83. <line text="run() executing on behalf of A"/>
  84. <line text="Delegate factory invoked for instance of B"/>
  85. <line text="run() executing on behalf of B"/>
  86. </stdout>
  87. </run>
  88. </ajc-test>
  89. <ajc-test dir="features164/declareMixin" title="caseh">
  90. <compile files="CaseH.java" options="-1.5">
  91. <message kind="error" text="The value for annotation attribute DeclareMixin"/>
  92. </compile>
  93. </ajc-test>
  94. <ajc-test dir="features164/declareMixin" title="casei">
  95. <compile files="CaseI.java" options="-1.5">
  96. <message kind="error" text="Types listed in the 'interfaces'"/>
  97. </compile>
  98. </ajc-test>
  99. <ajc-test dir="features164/declareMixin" title="casej">
  100. <compile files="CaseJ.java" options="-1.5">
  101. <message kind="error" text="createImplementation1"/>
  102. <message kind="error" text="Method 'int X.createImplementation2(java.lang.Object)': factory methods "/>
  103. </compile>
  104. </ajc-test>
  105. <ajc-test dir="features164/declareMixin" title="casek">
  106. <compile files="CaseK.java" options="-1.5">
  107. <message kind="error" text="factory methods for a mixin can take a maximum of one parameter"/>
  108. </compile>
  109. </ajc-test>
  110. <ajc-test dir="features164/declareMixin" title="casel">
  111. <compile files="CaseL.java" options="-1.5">
  112. <message kind="error" text="Cannot cast from CaseL to C"/>
  113. </compile>
  114. </ajc-test>
  115. <ajc-test dir="features164/declareMixin" title="casem">
  116. <compile files="CaseM.java" options="-1.5">
  117. <message kind="error" text=": factory methods for a mixin must either return an interface type or specify interfaces in the annotation and return a class"/>
  118. </compile>
  119. </ajc-test>
  120. <ajc-test dir="features164/declareMixin" title="casen">
  121. <compile files="CaseN.java" options="-1.5"/>
  122. <run class="CaseN">
  123. <stdout>
  124. <line text="foo() running"/>
  125. </stdout>
  126. </run>
  127. </ajc-test>
  128. <ajc-test dir="features164/declareMixin" title="caseo">
  129. <compile files="CaseO.java" options="-1.5">
  130. <message kind="error" text="factory method does not return something that implements 'I'"/>
  131. </compile>
  132. </ajc-test>
  133. <ajc-test dir="features164/declareMixin" title="casep">
  134. <compile files="CaseP.java" options="-1.5"/>
  135. <run class="CaseP">
  136. <stdout>
  137. <line text="foo() running"/>
  138. </stdout>
  139. </run>
  140. </ajc-test>
  141. <ajc-test dir="features164/declareMixin" title="caseq">
  142. <compile files="CaseQ.java" options="-1.5"/>
  143. <run class="CaseQ">
  144. <stdout>
  145. <line text="foo() running"/>
  146. <line text="goo() running"/>
  147. </stdout>
  148. </run>
  149. </ajc-test>
  150. <ajc-test dir="features164/declareMixin" title="caser">
  151. <compile files="CaseR.java" options="-1.5"/>
  152. <run class="CaseR">
  153. <stdout>
  154. <line text="true"/>
  155. <line text="false"/>
  156. </stdout>
  157. </run>
  158. </ajc-test>
  159. <ajc-test dir="features164/declareMixin" title="cases">
  160. <compile files="CaseS.java" options="-1.5">
  161. <message kind="error" text="not compatible"/>
  162. </compile>
  163. </ajc-test>
  164. <ajc-test dir="features164/declareMixin" title="caset">
  165. <compile files="CaseT.java" options="-1.5 -showWeaveInfo">
  166. <message kind="weave" text="Mixing interface 'I' (CaseT.java) into type 'CaseT' (CaseT.java)"/>
  167. </compile>
  168. </ajc-test>
  169. </suite>