Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

SourceLocationToString.java 863B

1234567891011121314151617181920212223242526272829
  1. import org.aspectj.testing.*;
  2. import org.aspectj.lang.*;
  3. /** @rfe our SourceLocation implementation should implement toString as filename:column */
  4. public class SourceLocationToString {
  5. public static final String EXPECT = "SourceLocationToString.java:9";
  6. public static void main (String[] args) {
  7. docall(); // line 9
  8. Tester.checkAllEvents();
  9. }
  10. static {
  11. Tester.expectEvent("docall");
  12. }
  13. static void docall() {
  14. Tester.event("docall");
  15. }
  16. static aspect A {
  17. before () : call(void docall()) {
  18. Tester.event("before");
  19. String sl = thisJoinPoint.getSourceLocation().toString();
  20. Tester.check(sl.endsWith(EXPECT),
  21. "sl=\"" + sl + "\" did not end with \""
  22. + EXPECT + "\"");
  23. }
  24. }
  25. }