At http://ant.apache.org/manual/Tasks/junit.html item 5 near the top of the page suggests that the junit task in ant should work if the jar is provided by classpath.
However, the issue described in detail at http://stackoverflow.com/questions/15979391/class-not-found-with-ant-ivy-and-junit-error-in-build-xml seems to show that is not the case - there is a class not found error even when the classpath is set correctly.
The code for the project can be downloaded from https://bitbucket.org/isti/java-example
So to reproduce:
hg clone ssh://email@example.com/isti/java-example
You'd probably have more luck filing the bug with ant--we don't maintain the ant task here. Sorry.
OK, will do, thanks.