如何配置 Eclipse 以自动运行测试? [英] How do I configure Eclipse to run your tests automatically?

查看:23
本文介绍了如何配置 Eclipse 以自动运行测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我阅读了这篇文章:配置您的 IDE 以自动运行您的测试http://eclipse.dzone.com/videos/configure-your-ide-运行你的

I read this article: Configure your IDE to run your tests automatically http://eclipse.dzone.com/videos/configure-your-ide-run-your

配置 Eclipse IDE 以在每次保存文件时运行 Ant 目标非常容易.MyProject -> 右击:属性 -> Builders -> 新建 -> Ant Builder

It's pretty easy to configure Eclipse IDE to run an Ant target every time a file is saved. MyProject -> Right-click : Properties -> Builders -> New -> Ant Builder

问题是构建器必须在每次保存时重建 jar,这很长.JUnit 测试使用 jar 中的 .classes 运行.

The problem is that the builder has to rebuild the jar on every save, which is very long. The JUnit tests run using the .classes in the jar.

我们已经有了 JUnit 配置(EclipseIde .launch 文件,其中包含运行测试的整个类路径).我希望我可以创建一个包装这些 JUnit 启动文件的构建器.这将有利于针对 Eclipse .classes 运行测试(比重建 jar 更快).测试结果也显示在 JUnit 视图中.

We already have JUnit configurations (EclipseIde .launch files which contains the whole classpath to run the tests). I wish I could create a builder that wraps those JUnit launch files. This would have the benefit of running the tests against Eclipse .classes (faster than rebuilding the jar). Also the test results are displayed in the JUnit view.

有人能做到吗?

推荐答案

你可以试试 CT-Eclipse,Eclipse 的持续测试插件.

You could try CT-Eclipse, a continuous testing plugin for Eclipse.

来自插件页面:

启用 CT-Eclipse 后,当您编辑代码时,Eclipse 会在后台安静地运行您的测试,并在其中任何一个测试失败或导致错误时通知您.

With CT-Eclipse enabled, as you edit your code, Eclipse runs your tests quietly in the background, and notifies you if any of them fail or cause errors.

这篇关于如何配置 Eclipse 以自动运行测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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