Question

I´m trying to intercept webdriver methods inside JUnit tests that are in one java project. I've created another project with Aspects but could not integrate them both to work together. Basically I need to print messages on the console as the test goes through.

Could anyone point me to any direction that does not use Spring? (Searching web gives tons of tutorials with Spring). I'm using Eclipse Juno with AJDT installed.

Thanks!

Was it helpful?

Solution

In order to get one project weaving into another, you need to place the aspects on the aspect path of the test project. To do this:

  1. Convert your test project to an AJ project
  2. Project -> Properties -> AspectJ Build -> Aspect Path
  3. Add the aspect project
  4. Full build

This should work. Alternatively, if you can't convert the test project to an AJ project, add the test project to the In path of your aspect project. Then launch the tests from the class files of your aspect project.

More on inpath and aspect path here: http://eclipse.org/aspectj/doc/released/devguide/ajc-ref.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top