瀏覽代碼

Annotation Binding - more test data.

tags/Root_AspectJ5_Development
aclement 19 年之前
父節點
當前提交
4a4ea5ef31
共有 1 個文件被更改,包括 15 次插入0 次删除
  1. 15
    0
      tests/java5/annotations/binding/InitBinding.aj

+ 15
- 0
tests/java5/annotations/binding/InitBinding.aj 查看文件

@@ -40,3 +40,18 @@ aspect X {
throw new RuntimeException("Expected "+exp.length+" advice runs but did "+X.i);
}
}
//aspect X {
// int i = 0;
//
// before(Colored c): preinitialization(new(..)) && !within(X) && @annotation(c) {
// i++;
// System.err.println(thisJoinPoint+" color="+c.color());
// if (i==1 && !c.color().equals("orange")) throw new RuntimeException("First time through should be red, but is "+c.color());
// if (i==2 && !c.color().equals("yellow")) throw new RuntimeException("Second time through should be green, but is "+c.color());
// if (i==3 && !c.color().equals("brown")) throw new RuntimeException("Third time through should be blue, but is "+c.color());
// System.err.println(c.color());
// }
//}
//

Loading…
取消
儲存