Hello,

 

I'd like to test a method and short circuit calls from the method. For
example, FooTest.testMethod calls Foo.method which in turn calls
Bar.method. I'd like to intercept the call to Bar.method. This all seems
easy enough to do with aspects. Define a pointcut that acts on
Bar.method when in the call flow of FooTest.testMethod. I think the
problem I'm seeing is one of scoping during the weave process. The maven
convention places the "main" classes under target/classes during the
"compile" goal while the "test" classes are placed under
target/test-classes during the "test-compile" goal. Placing the aspect
under src/test weaves the test classes properly, but doesn't weave the
main class. Placing the aspect under src/main weaves the main classes
properly, but doesn't seem to weave the test classes. Ideally, I'd like
to define the aspect under src/test and have the classes under
target/classes woven. Make sense? Any ideas?

 

Thanks in advance,

 

Steve

 

Reply via email to