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.

newfeatures-tests.xml 6.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]>
  2. <!-- AspectJ v1.6.11 Tests -->
  3. <suite>
  4. <ajc-test dir="features1611/declareMinus" title="adding and removing - 3">
  5. <compile files="OnOffITD.java" options="-1.5 -showWeaveInfo">
  6. <message kind="weave" text="'public int field2' of type 'OnOffITD' (OnOffITD.java) is annotated with @Anno field annotation from 'Foo' (OnOffITD.java:12)"/>
  7. <message kind="weave" text="'public int field2' of type 'OnOffITD' (OnOffITD.java) has had @Anno field annotation removed by 'Foo' (OnOffITD.java:13)"/>
  8. <message kind="weave" text="'public static int field' of type 'OnOffITD' (OnOffITD.java) is annotated with @Anno field annotation from 'Foo' (OnOffITD.java:9)"/>
  9. <message kind="weave" text="'public static int field' of type 'OnOffITD' (OnOffITD.java) has had @Anno field annotation removed by 'Foo' (OnOffITD.java:8)"/>
  10. <message kind="weave" text="Type 'OnOffITD' (OnOffITD.java) has intertyped field from 'B' (OnOffITD.java:'int OnOffITD.field')"/>
  11. <message kind="weave" text="Type 'OnOffITD' (OnOffITD.java) has intertyped field from 'B' (OnOffITD.java:'int OnOffITD.field2')"/>
  12. </compile>
  13. <run class="OnOffITD">
  14. <stdout>
  15. <line text="field annotated? no"/>
  16. <line text="field2 annotated? no"/>
  17. </stdout>
  18. </run>
  19. </ajc-test>
  20. <ajc-test dir="features1611/declareMinus" title="adding and removing">
  21. <compile files="OnOff.java" options="-1.5 -showWeaveInfo">
  22. <message kind="weave" text="'public int field2' of type 'OnOff' (OnOff.java) is annotated with @Anno field annotation from 'Foo' (OnOff.java:12)"/>
  23. <message kind="weave" text="'public int field2' of type 'OnOff' (OnOff.java) has had @Anno field annotation removed by 'Foo' (OnOff.java:13)"/>
  24. <message kind="weave" text="'public static int field' of type 'OnOff' (OnOff.java) is annotated with @Anno field annotation from 'Foo' (OnOff.java:9)"/>
  25. <message kind="weave" text="'public static int field' of type 'OnOff' (OnOff.java) has had @Anno field annotation removed by 'Foo' (OnOff.java:8)"/>
  26. </compile>
  27. <run class="OnOff">
  28. <stdout>
  29. <line text="field annotated? no"/>
  30. <line text="field2 annotated? no"/>
  31. </stdout>
  32. </run>
  33. </ajc-test>
  34. <ajc-test dir="features1611/declareMinus" title="adding and removing - 2">
  35. <compile files="OnOff2.java" options="-1.5 -showWeaveInfo">
  36. <message kind="weave" text="'public int field2' of type 'OnOff2' (OnOff2.java) is annotated with @Anno field annotation from 'Foo' (OnOff2.java:8)"/>
  37. <message kind="weave" text="'public int field2' of type 'OnOff2' (OnOff2.java) has had @Anno field annotation removed by 'Foo' (OnOff2.java:7)"/>
  38. <message kind="weave" text="'public static int field' of type 'OnOff2' (OnOff2.java) is annotated with @Anno field annotation from 'Foo' (OnOff2.java:8)"/>
  39. <message kind="weave" text="'public static int field' of type 'OnOff2' (OnOff2.java) has had @Anno field annotation removed by 'Foo' (OnOff2.java:7)"/>
  40. </compile>
  41. <run class="OnOff2">
  42. <stdout>
  43. <line text="field annotated? no"/>
  44. <line text="field2 annotated? no"/>
  45. </stdout>
  46. </run>
  47. </ajc-test>
  48. <ajc-test dir="features1611/declareMinus" title="declare minus - 1">
  49. <compile files="Code.java" options="-1.5"/>
  50. <run class="Code"> <stdout>
  51. <line text="no annotation"/>
  52. </stdout></run>
  53. </ajc-test>
  54. <ajc-test dir="features1611/declareMinus" title="declare minus - itd">
  55. <compile files="Code2.java" options="-1.5"/>
  56. <run class="Code2">
  57. <stdout>
  58. <line text="no annotation"/>
  59. </stdout></run>
  60. </ajc-test>
  61. <ajc-test dir="features1611/declareMinus" title="declare minus - 2 annos">
  62. <compile files="Code3.java" options="-1.5"/>
  63. <run class="Code3">
  64. <stdout>
  65. <line text="no Anno"/>
  66. <line text="has AnnoB"/>
  67. </stdout></run>
  68. </ajc-test>
  69. <ajc-test dir="features1611/declareMinus" title="declare minus - multifiles">
  70. <compile files="aspectjtest/AnnotationA.java aspectjtest/AnnotationB.java aspectjtest/ExampleItd.aj aspectjtest/HelloTest.java aspectjtest/MyEntity.java" options="-1.5"/>
  71. <run class="aspectjtest.HelloTest">
  72. <stdout>
  73. <line text="1"/>
  74. <line text="interface aspectjtest.AnnotationB"/>
  75. </stdout></run>
  76. </ajc-test>
  77. <!-- different ordering -->
  78. <ajc-test dir="features1611/declareMinus" title="declare minus - multifiles - 2">
  79. <compile files="aspectjtest/MyEntity.java aspectjtest/AnnotationA.java aspectjtest/AnnotationB.java aspectjtest/ExampleItd.aj aspectjtest/HelloTest.java" options="-1.5"/>
  80. <run class="aspectjtest.HelloTest">
  81. <stdout>
  82. <line text="1"/>
  83. <line text="interface aspectjtest.AnnotationB"/>
  84. </stdout></run>
  85. </ajc-test>
  86. <!-- different ordering -->
  87. <ajc-test dir="features1611/declareMinus" title="declare minus - multifiles - 3">
  88. <compile files="aspectjtest/ExampleItd.aj aspectjtest/AnnotationA.java aspectjtest/AnnotationB.java aspectjtest/MyEntity.java aspectjtest/HelloTest.java" options="-1.5"/>
  89. <run class="aspectjtest.HelloTest">
  90. <stdout>
  91. <line text="1"/>
  92. <line text="interface aspectjtest.AnnotationB"/>
  93. </stdout></run>
  94. </ajc-test>
  95. <ajc-test dir="features1611/declareMinus" title="declare minus - with values">
  96. <compile files="WithValues.java" options="-1.5"/>
  97. <run class="WithValues">
  98. <stdout>
  99. <line text="i does not have Anno"/>
  100. <line text="j has Banno:@Banno(hoo=abc)" vm="-1.8"/>
  101. <line text="j has Banno:@Banno(hoo=&quot;abc&quot;)" vm="9-"/>
  102. <line text="j does not have Anno"/>
  103. </stdout></run>
  104. </ajc-test>
  105. <ajc-test dir="features1611/declareMinus" title="declare minus - unsupported">
  106. <compile files="Unsupported.java" options="-1.5">
  107. <message kind="error" line="19" text="Annotation removal only supported for declare @field (compiler limitation)"/>
  108. <message kind="error" line="20" text="Annotation removal only supported for declare @field (compiler limitation)"/>
  109. <message kind="error" line="21" text="Annotation removal does not allow values to be specified for the annotation (compiler limitation)"/>
  110. </compile>
  111. </ajc-test>
  112. <ajc-test dir="features1611/declareMinus" title="binary weaving">
  113. <compile files="aspectjtest/AnnotationA.java aspectjtest/AnnotationB.java aspectjtest/MyEntity.java aspectjtest/HelloTest.java" outjar="code.jar" options="-1.5"/>
  114. <compile files="aspectjtest/ExampleItd.aj" inpath="code.jar" options="-1.5 -showWeaveInfo">
  115. <message kind="weave" text="'private String myField [RuntimeVisibleAnnotations]' of type 'aspectjtest.MyEntity' (MyEntity.java) has had @AnnotationA field annotation removed by"/>
  116. <message kind="weave" text="'private String myField [RuntimeVisibleAnnotations]' of type 'aspectjtest.MyEntity' (MyEntity.java) is annotated with @AnnotationB field"/>
  117. </compile>
  118. <run class="aspectjtest.HelloTest">
  119. <stdout>
  120. <line text="1"/>
  121. <line text="interface aspectjtest.AnnotationB"/>
  122. </stdout></run>
  123. </ajc-test>
  124. </suite>