I wish this help you I've ended up running a shell script in parallel to the junit task. This waits for a process that matches the two grepped conditions, runs jstat on it and then exits when complete.
while :; do
junitPID=$(ps -Af | grep java | grep ant-junit.jar | tr -s ' ' | cut -d ' ' -f 2)
if [[ -n $junitPID ]]; then
jstat -gcutil -t $junitPID 1000
To fix this issue ThreadPoolExecutor provides beforeExecute and afterExecute methods that you can override. You could use those to record your statistics in a single (member variable of your ExecutorService) ConcurrentHashMap keyed on some unique identifier for your tasks, and storing the type, start time, and end time. Calculate the statistics from the ConcurrentHashMap when you are ready to look at them.
Ant JUnit Task couldn't find junit/framework/TestCase.class
around this issue The error is caused by the fact that your test classes cannot be loaded. Did you put the package mypackage.tests.controller (i.e. the folder(s) containing the class files or the jar archive) on the classpath of your junit call? This can be done using a nested classpath structure. (http://ant.apache.org/manual/Tasks/junit.html).
Prevent execution of JUnit tests or forcing a special execution order of JUnit tests?
this will help Short answer: make sure you depend on ant-junit4 not only ant-junit. I had to look at the sources to work this out. The core problem here is that the ant task will try to run the test case using JUnit3 semantics, and there are no test cases to be found according to that. The reason why it doesn't use JUnit4 mode is because the JUnit4 support of ant is a separate package for Maven or Ivy, namely org.apache.ant#ant-junit4 which depends on org.apache.ant#ant-junit but provides additional classes. In particular, without that package the JUnitTestRunner will fail to load CustomJUnit4TestAdapterCache and therefore fall back to JUnit3 style. At least since this commit.