logo
down
shadow

Trying to modify an ANT task to track the PID of its JUnit execution


Trying to modify an ANT task to track the PID of its JUnit execution

Content Index :

Trying to modify an ANT task to track the PID of its JUnit execution
Tag : ant , By : Jorge Palacio
Date : November 28 2020, 09:01 AM

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.
#!/bin/bash
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
      exit 0
   fi
   sleep 1
done

Comments
No Comments Right Now !

Boards Message :
You Must Login Or Sign Up to Add Your Comments .

Share : facebook icon twitter icon

How to track task execution statistics using an ExecutorService?


Tag : java , By : chudq7
Date : March 29 2020, 07:55 AM
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


Tag : eclipse , By : Piotr Balas
Date : March 29 2020, 07:55 AM
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?


Tag : unit-testing , By : user157138
Date : March 29 2020, 07:55 AM
seems to work fine JUnit doesn't support the ordering of tests, you might want to use TestNG for this (here is the relevant doc).

Track execution time per task in gradle script?


Tag : java , By : brij
Date : March 29 2020, 07:55 AM
seems to work fine The cleanest solution is to implement a TaskExecutionListener (I'm sure you can handle that part) and register it with gradle.taskGraph.addTaskExecutionListener.

junit task in ant 1.9 with ivy fails with junit.framework.AssertionFailedError: No tests found


Tag : java , By : chawei
Date : March 29 2020, 07:55 AM
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.
Related Posts Related QUESTIONS :
shadow
Privacy Policy - Terms - Contact Us © scrbit.com