Junit失败,因为Server $ StartJob仍在运行 [英] Junit fails because the Server$StartJob still running

查看:63
本文介绍了Junit失败,因为Server $ StartJob仍在运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在eclipse上运行junit test,它所做的只是尝试在调试模式下启动服务器.但是,出现以下错误:

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发现在平台关闭后仍在运行.应该通过在关闭期间安排作业的插件来取消作业:org.eclipse.wst.server.core.internal.Server $ StartJob"

"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 "

有一段代码是从线程触发的,除非junit测试全部完成,否则它不会命中.但是一旦测试完成,它将关闭工作台,因此服务器启动作业将永远不会完成.

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.

是否有一种等待作业完成然后运行junit test的方法?

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

推荐答案

加入其家族以使执行线程阻塞,直到完成该家族中的所有作业为止.

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

请参阅org.eclipse.core.runtime.jobs.IJobManager#join(Object, IProgressMonitor)org.eclipse.wst.server.core.ServerUtil#SERVER_JOB_FAMILY

这篇关于Junit失败,因为Server $ StartJob仍在运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆