我有一个方面,在我的TestNG测试方法抛出异常后运行。我想在我的AspectJ方法中获取Test方法的名称。
对此有什么想法吗?请查看下面的代码示例:
方面:
pointcut publicCall(): call(public * *(..));
after() throwing (AssertionError e): publicCall() {
logger.debug("Assertion Error thrown");
System.out.println("Threw an exception: " + e);
}
测试:
@Test
public void testScenarioOne(){
logger.debug("From Scenario One Test");
Assert.assertEquals(true, false);
}