Junit fails because the Server$StartJob still running

こ雲淡風輕ζ 提交于 2020-01-06 02:41:07

问题


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



来源:https://stackoverflow.com/questions/23765399/junit-fails-because-the-serverstartjob-still-running

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!