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.

misuse.xml 6.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]>
  2. <!-- AspectJ v1.5.0 Tests -->
  3. <suite>
  4. <ajc-test dir="java5/ataspectj"
  5. pr="" title="@Aspect class extending @Aspect class">
  6. <compile files="ataspectj/misuse/Test005.java" options="-1.5 -Xdev:NoAtAspectJProcessing">
  7. </compile>
  8. </ajc-test>
  9. <ajc-test dir="java5/ataspectj"
  10. pr="" title="class with @Before extending @Aspect class">
  11. <compile files="ataspectj/misuse/Test006.java" options="-1.5 -Xdev:NoAtAspectJProcessing">
  12. <message kind="error" line="11" text="class 'Test006B' can not extend aspect"/>
  13. </compile>
  14. </ajc-test>
  15. <comment>a warning. We ignore the pointcut (TBD) - line is enclosing class (TBD Andy do better ?)</comment>
  16. <ajc-test dir="java5/ataspectj"
  17. pr="" title="@Pointcut not returning void">
  18. <compile files="ataspectj/misuse/Test008.java" options="-1.5 -Xdev:NoAtAspectJProcessing">
  19. <message kind="warning" line="9" text="Found @Pointcut on a method not returning 'void' or not 'public static boolean'"/>
  20. </compile>
  21. </ajc-test>
  22. <!-- <ajc-test dir="java5/ataspectj"-->
  23. <!-- pr="" title="@Aspect on interface">-->
  24. <!-- <compile files="ataspectj/misuse/Test010.java" options="-1.5 -Xdev:NoAtAspectJProcessing">-->
  25. <!-- <message kind="warning" line="7" text="Found @Aspect on an interface type 'ataspectj.misuse.Test010'"/>-->
  26. <!-- </compile>-->
  27. <!-- </ajc-test>-->
  28. <comment>line is enclosing class - TBD</comment>
  29. <ajc-test dir="java5/ataspectj"
  30. pr="" title="@Pointcut with garbage string">
  31. <compile files="ataspectj/misuse/Test014.java" options="-1.5 -Xdev:NoAtAspectJProcessing -Xlint:ignore">
  32. <message kind="error" line="7" text="Invalid pointcut 'call%dddd"/>
  33. <message kind="error" text="can't find referenced pointcut"/>
  34. <message kind="error" text="can't find pointcut"/>
  35. <message kind="error" text="@AfterThrowing: either 'value' or 'poincut' must be provided, not both"/>
  36. <message kind="error" text="@AfterReturning: either 'value' or 'poincut' must be provided, not both"/>
  37. <message kind="error" text="@DeclareWarning used on a non String constant field"/>
  38. <message kind="error" text="@DeclareError used on a non String constant field"/>
  39. </compile>
  40. </ajc-test>
  41. <comment>line is enclosing class - TBD</comment>
  42. <ajc-test dir="java5/ataspectj"
  43. pr="" title="@Pointcut with throws clause">
  44. <compile files="ataspectj/misuse/Test016.java" options="-1.5 -Xdev:NoAtAspectJProcessing">
  45. <message kind="warning" line="7" text="Found @Pointcut on a method throwing exception"/>
  46. </compile>
  47. </ajc-test>
  48. <comment>very dirty hack - can't get this location to work properly so added match all error..</comment>
  49. <comment>amc - with new checks for binding of returning this was giving a different message, so I
  50. tweaked the test slightly by swapping the order of the args</comment>
  51. <ajc-test dir="java5/ataspectj"
  52. pr="" title="@AfterReturning with wrong number of args">
  53. <compile files="ataspectj/misuse/Test019.java" options="-1.5 -Xdev:NoAtAspectJProcessing -Xlint:ignore">
  54. <message kind="error" line="1" text="the parameter x is not bound"/>
  55. <message kind="error" line="1" text="formal unbound in pointcut"/>
  56. </compile>
  57. </ajc-test>
  58. <comment>line number is enclosing type</comment>
  59. <ajc-test dir="java5/ataspectj"
  60. pr="" title="@Before on non-public method">
  61. <compile files="ataspectj/misuse/Test020.java" options="-1.5 -Xdev:NoAtAspectJProcessing -Xlint:ignore">
  62. <message kind="error" line="7" text="Found @AspectJ annotation on a non public advice 'someCall()V'"/>
  63. </compile>
  64. </ajc-test>
  65. <comment>line number is enclosing type</comment>
  66. <ajc-test dir="java5/ataspectj"
  67. pr="" title="@Before on method not returning void">
  68. <compile files="ataspectj/misuse/Test021.java" options="-1.5 -Xdev:NoAtAspectJProcessing -Xlint:ignore">
  69. <message kind="error" line="7" text="Found @AspectJ annotation on a non around advice not returning void 'someCall()I'"/>
  70. </compile>
  71. </ajc-test>
  72. <ajc-test dir="java5/ataspectj"
  73. pr="" title="@Before with PJP">
  74. <compile files="ataspectj/misuse/Test100.java" options="-1.5 -Xdev:NoAtAspectJProcessing -Xlint:ignore">
  75. <message kind="error" text="use of ProceedingJoinPoint is allowed only on around advice"/>
  76. </compile>
  77. </ajc-test>
  78. <!--
  79. ALEX: todo
  80. <ajc-test dir="java5/ataspectj/coverage"
  81. pr="" title="@Pointcut with wrong number of args">
  82. <compile files="ataspectj/misuse/Test022.java" options="-1.5 -Xdev:NoAtAspectJProcessing">
  83. <message kind="error" line="8" text="int x is not declared in the pointcut parameters"/>
  84. </compile>
  85. </ajc-test>
  86. <ajc-test dir="java5/ataspectj/coverage"
  87. pr="" title="@Around given an extension of ProceedingJoinPoint">
  88. <compile files="ataspectj/misuse/Test031.java" options="-1.5 -Xdev:NoAtAspectJProcessing">
  89. <message kind="error" line="9" text="Is this an error?"/>
  90. </compile>
  91. </ajc-test>
  92. <ajc-test dir="java5/ataspectj/coverage"
  93. pr="" title="calling @Before advice explicitly as a method">
  94. <compile files="ataspectj/misuse/Test032.java" options="-1.5 -Xdev:NoAtAspectJProcessing">
  95. <message kind="error" line="14" text="Advice should never be called explicitly"/>
  96. </compile>
  97. </ajc-test>
  98. <ajc-test dir="java5/ataspectj/coverage"
  99. pr="" title="@Before on Interface method">
  100. <compile files="ataspectj/misuse/Test033.java" options="-1.5 -Xdev:NoAtAspectJProcessing">
  101. <message kind="error" line="4" text="The annotation @Before is disallowed for this location"/>
  102. </compile>
  103. </ajc-test>
  104. <ajc-test dir="java5/ataspectj/coverage"
  105. pr="" title="@Before and @After on one method">
  106. <compile files="ataspectj/misuse/Test035.java" options="-1.5 -Xdev:NoAtAspectJProcessing">
  107. <message kind="error" line="7" text="A method may only be declared as advice once"/>
  108. </compile>
  109. </ajc-test>
  110. <ajc-test dir="java5/ataspectj/coverage"
  111. pr="" title="@Before advice with empty string">
  112. <compile files="ataspectj/misuse/Test037.java" options="-1.5 -Xdev:NoAtAspectJProcessing">
  113. </compile>
  114. </ajc-test>
  115. <ajc-test dir="java5/ataspectj/coverage"
  116. pr="" title="@Pointcut with an empty string">
  117. <compile files="ataspectj/misuse/Test039.java" options="-1.5 -Xdev:NoAtAspectJProcessing">
  118. </compile>
  119. </ajc-test>
  120. <ajc-test dir="java5/ataspectj/coverage"
  121. pr="" title="@Before with AND in string">
  122. <compile files="ataspectj/misuse/Test040.java" options="-1.5 -Xdev:NoAtAspectJProcessing">
  123. </compile>
  124. </ajc-test>
  125. -->
  126. </suite>