Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AspectJ » Joinpoint for TestNG tests?(Trying to create a joinpoint that picks out TestNG tests)
Joinpoint for TestNG tests? [message #1850831] Thu, 17 March 2022 23:27 Go to next message
Kevin Kraft is currently offline Kevin KraftFriend
Messages: 3
Registered: March 2022
Junior Member
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.
Re: Joinpoint for TestNG tests? [message #1861464 is a reply to message #1850831] Fri, 13 October 2023 19:18 Go to previous message
Jack Jones is currently offline Jack JonesFriend
Messages: 23
Registered: September 2023
Junior Member
The issue might be related to the way you have defined your pointcuts.
Previous Topic:memory consumption
Next Topic:Is it possible to weave 2 different classes ?
Goto Forum:
  


Current Time: Sat Apr 27 16:06:08 GMT 2024

Powered by FUDForum. Page generated in 0.02950 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top