Junit fails because the Server$StartJob still runn

2019-08-03 22:01发布

问题:

I am running junit test on eclipse, all it does is, trying to start the server in debug mode. However, I am getting the following error:

"Job found still running after platform shutdown. Jobs should be canceled by the plugin that scheduled them during shutdown: org.eclipse.wst.server.core.internal.Server$StartJob "

there is a piece of code that is triggered from a thread and it wont hit unless the junit tests are all complete. but once the tests are done, it closes the workbench and hence server startup job is never completed.

Is there a way to wait for the job to complete and then run junit test ?

回答1:

Join their family to make the executing thread block until all jobs in the family are done.

See org.eclipse.core.runtime.jobs.IJobManager#join(Object, IProgressMonitor) and org.eclipse.wst.server.core.ServerUtil#SERVER_JOB_FAMILY



标签: eclipse junit