There's no benefit in modifying Eclipse's directories when you're running tests from Ant. Just pretend that Eclipse doesn't even exist. That gives you one less thing to worry about.
It's common practice when setting up a
test project to have a separate source and output class tree from the actual application code. I even go so far as to set things up where I can physically rip out the test subsystem from the directory tree and/or Ant script and the app code won't care, but I can be extreme sometimes.
So in a case like this, the Junit test needs to find:
1. The Junit Ant task (in Ant's extras jar)
2. Junit.jar itself
3. The app's classes
4. The test classes.
Actually,
Ant needs to find the Junit Ant task. It doesn't need to be locateable by the Junit test itself. There's really 2 different classpaths, one used by Ant and the other by the Ant task (junit).