Joinpoint for TestNG tests? [message #1850831] |
Thu, 17 March 2022 19:27  |
Eclipse User |
|
|
|
Hi - I am trying to define a joinpoint that selects TestNG tests. Here is my example test: (defined under src/test/java)
@Test()
public void testHandlingTestErrorException() {
throw new TestErrorException("Fail test", testCause, FAIL);
}
Here are various joinpoint definitions I have tried:
void around(): call(public void *.test*()) {
System.out.println("In test method...");
proceed();
}
void around(): within(org.testng.annotations.Test) {
System.out.println("In test method...");
proceed();
}
after() throwing (Throwable t): execution(* *.test*()) {
System.out.println("In after() throwing");
}
However all of them result in "advice defined in TestAspect has not been applied" when I compile. Any ideas what might be wrong here? I have tried with and without "<scope>test</scope>" in pom.xml. Thanks in advance.
|
|
|
|
Powered by
FUDForum. Page generated in 0.06536 seconds