I have an Ant build file where I compile the Java source code of the application and of the tests, instrument the application classes, run JUnit tests and generate JUnit and Emma code coverage reports. The JUnit task is given the path to the instrumented classes.
The problem is that the interfaces are not instrumented (Emma FAQ) but I use them in the tests and JUnit can't find them.
I can think of 2 solutions:
- don't use interfaces in tests (goes against programming to interfaces - does it count in tests?)
- copy the interfaces next to the instrumented classes (hard-coding the path to the interfaces)
How should I approach and solve this problem?