调试eclipse单元测试代码“测试类应该只有一个”和“工作区被关闭”错误 [英] Debugging eclipse unit test code "Test class should have exactly one" and "Workspace is closed" error

查看:205
本文介绍了调试eclipse单元测试代码“测试类应该只有一个”和“工作区被关闭”错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试构建eclipse插件(org.eclipse.jdt.ui.tests.refactoring)。

I'm trying to build eclipse plugins (org.eclipse.jdt.ui.tests.refactoring).

从git下载源码,我可以构建该项目。
我想调试到ExtractMethodTest例程,我只是在setUP例程中设置一个断点,并启动调试器。

Downloading the source from the git, and I could build the project. I wanted to debug into ExtractMethodTest routine, I just set a breakpoint in a setUP routine, and launch the debugger.

但是,我有一个初始化错误。

However, I got an initialization error.

然后,我试图通过右键单击包资源管理器中的 ExtractMethodTests.java 来启动调试器,以获取工作区已关闭错误。

Then, I tried to launch the debugger by right click on the ExtractMethodTests.java in package explorer to get Workspace is closed error.


< img src =https://i.stack.imgur.com/BsyoI.pngalt =在这里输入图像描述>
什么可能是错的?我只想启动 ExtractMethodTests.java 单元测试来逐行跟踪代码。

What might be wrong? I just wanted to launch ExtractMethodTests.java unit test to trace the code line by line.

推荐答案

您是否试图运行错误的JUnit版本? Eclipse附带JUnit 3和Junit 4兼容的运行时。

Are you trying to run with the wrong version of JUnit? Eclipse ships with both JUnit 3 and Junit 4 compatible runtimes.

其次,您的单元测试实际上是否有一个0-arg构造函数?

Secondly, does your unit test actually have a 0-arg constructor?

显然,我没有检查代码库以查看Eclipse人员是否知道如何创建单元测试。我只是假设他们这样做。

Clearly, I didn't check the code base to see if the Eclipse people know how to create the unit tests. I'm just assuming they do.

这篇关于调试eclipse单元测试代码“测试类应该只有一个”和“工作区被关闭”错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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