Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] ENC: AspectJ & JUnit

Call joinpoints are 'applied' to your source class CasosDeTestePDV. Execution joinpoints would only be 'applied' to the junit library TestRunner if you wove into the junit jar file.
-----Original Message-----
From: André Dantas Rocha [mailto:ad-rocha@xxxxxxxxxx]
Sent: July 13, 2004 1:24 PM
To: aspectj-users@xxxxxxxxxxx
Subject: [aspectj-users] ENC: AspectJ & JUnit

Replacing "execution" by "call" everything works fine. Why?


De: André Dantas Rocha [mailto:ad-rocha@xxxxxxxxxx]
Enviada em: terça-feira, 13 de julho de 2004 14:21
Para: 'aspectj-users@xxxxxxxxxxx'
Assunto: AspectJ & JUnit

Hi,
 
I'm try to intercept executions of Junit TestRunner.run(Class), but its not working. TestRunner is executed in CasosDeTestePDV.main, but I can't intercept it. What's wrong?
 
Thanks
 
public class CasosDeTestePDV extends TestCase {
  test1() {...}
  public static void main(String[] args) {
    junit.textui.TestRunner.run(CasosDeTestePDV.class);
  }
}
 
public aspect Interceptor {
  pointcut p() : execution(* junit.textui.TestRunner.*(..));   
  before() : p() {
    System.out.println(thisJoinPoint);
  }
}
 

Back to the top