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.

annotationFieldBinding.xml 4.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]>
  2. <!-- AspectJ v1.6.1 Optimized Annotation Field Binding Tests -->
  3. <suite>
  4. <ajc-test dir="features161/optimizedAnnotationBinding" title="case one - syntax">
  5. <compile options="-1.5" files="CaseOne.java"/>
  6. <run class="CaseOne">
  7. <stdout>
  8. <line text="ONE"/>
  9. <line text="TWO"/>
  10. <line text="THREE"/>
  11. </stdout>
  12. </run>
  13. </ajc-test>
  14. <ajc-test dir="features161/optimizedAnnotationBinding" title="case two - no such field">
  15. <compile options="-1.5" files="CaseTwo.java">
  16. <message kind="error" line="30" text="No field of type 'Level' exists on annotation type 'Anno'"/>
  17. </compile>
  18. </ajc-test>
  19. <ajc-test dir="features161/optimizedAnnotationBinding" title="case three - ambiguous">
  20. <compile options="-1.5" files="CaseThree.java">
  21. <message kind="error" line="31" text="The field type 'Level' is ambiguous for annotation type 'Anno'"/>
  22. </compile>
  23. </ajc-test>
  24. <ajc-test dir="features161/optimizedAnnotationBinding" title="case four - default value">
  25. <compile options="-1.5" files="CaseFour.java"/>
  26. <run class="CaseFour">
  27. <stdout>
  28. <line text="ONE"/>
  29. <line text="TWO"/>
  30. <line text="ONE"/>
  31. </stdout>
  32. </run>
  33. </ajc-test>
  34. <ajc-test dir="features161/optimizedAnnotationBinding" title="case five - not an enum - compiler limitation">
  35. <compile options="-1.5" files="CaseFive.java">
  36. <message kind="error" line="20" text="The field within the annotation must be an enum, string or int. 'float' is not"/>
  37. </compile>
  38. </ajc-test>
  39. <ajc-test dir="features161/optimizedAnnotationBinding" title="case six - not an execution join point - compiler limitation">
  40. <compile options="-1.5" files="CaseSix.java">
  41. <message kind="error" line="20" text="Annotation field binding is only supported at method-execution join points"/>
  42. </compile>
  43. </ajc-test>
  44. <ajc-test dir="features161/optimizedAnnotationBinding" title="case seven - annos in packages one">
  45. <compile options="-1.5" files="CaseSeven.java"/>
  46. <run class="p.q.r.CaseSeven">
  47. <stdout>
  48. <line text="ONE"/>
  49. <line text="TWO"/>
  50. <line text="THREE"/>
  51. </stdout>
  52. </run>
  53. </ajc-test>
  54. <ajc-test dir="features161/optimizedAnnotationBinding" title="case eight - annos in packages two">
  55. <compile options="-1.5" files="CaseEight.java"/>
  56. <run class="p.q.r.CaseEight">
  57. <stdout>
  58. <line text="ONE"/>
  59. <line text="TWO"/>
  60. <line text="THREE"/>
  61. </stdout>
  62. </run>
  63. </ajc-test>
  64. <ajc-test dir="features161/optimizedAnnotationBinding" title="case nine - everything in different packages">
  65. <compile options="-1.5" files="CaseNine.java Level.java Anno.java"/>
  66. <run class="p.q.r.CaseNine">
  67. <stdout>
  68. <line text="ONE"/>
  69. <line text="TWO"/>
  70. <line text="THREE"/>
  71. </stdout>
  72. </run>
  73. </ajc-test>
  74. <ajc-test dir="features161/optimizedAnnotationBinding" title="case ten - binding multiple things">
  75. <compile options="-1.5" files="CaseTen.java"/>
  76. <run class="CaseTen">
  77. <stdout>
  78. <line text="ONE:3"/>
  79. <line text="TWO:4"/>
  80. <line text="THREE:5"/>
  81. </stdout>
  82. </run>
  83. </ajc-test>
  84. <ajc-test dir="features161/optimizedAnnotationBinding" title="case eleven - binding multiple annotation fields">
  85. <compile options="-1.5" files="CaseEleven.java"/>
  86. <run class="CaseEleven">
  87. <stdout>
  88. <line text="ONE:GREEN"/>
  89. <line text="TWO:GREEN"/>
  90. <line text="THREE:BLUE"/>
  91. </stdout>
  92. </run>
  93. </ajc-test>
  94. <ajc-test dir="features161/optimizedAnnotationBinding" title="case twelve - binding anno and anno value">
  95. <compile options="-1.5" files="CaseTwelve.java"/>
  96. <run class="CaseTwelve">
  97. <stdout>
  98. <line text="ONE:GREEN"/>
  99. <line text="TWO:GREEN"/>
  100. <line text="THREE:BLUE"/>
  101. </stdout>
  102. </run>
  103. </ajc-test>
  104. <ajc-test dir="features161/optimizedAnnotationBinding" title="case thirteen - bug npe">
  105. <compile options="-1.5" files="CaseThirteen.java">
  106. <message kind="error" line="31" text="No field of type 'java.lang.String'"/>
  107. <message kind="error" line="31" text="When using @annotation"/>
  108. <message kind="error" line="32" text="cannot be resolved"/>
  109. </compile>
  110. </ajc-test>
  111. </suite>