简体   繁体   English

m2eclipse:类似于“ MVN测试”,但带有GUI?

[英]m2eclipse: Like “mvn test” but with GUI?

We have a multi-module Maven setup with a master pom.xml that includes all the others. 我们有一个包含主pom.xml的多模块Maven设置,其中包括所有其他内容。 So mvn test from the root directory runs all our unit tests, with textual output. 因此,根目录中的mvn test运行我们所有的单元测试,并带有文本输出。

I can do Run / Run As / JUnit Test to run a single test class with a graphical test runner. 我可以执行“运行” /“运行方式” /“ JUnit测试”以使用图形测试运行器运行单个测试类。

Question: How do I combine the two, so that I can run all the tests that mvn test runs but with a graphical runner, like the one from Run / Run As / JUnit Test? 问题:如何将两者结合起来,以便可以运行mvn test运行的所有测试,但可以使用图形运行程序,例如运行/运行方式/ JUnit测试中的测试?

Create an eclipse project with all your modules as Maven Dependecies and then create a JUnit Suite which incorporates all tests. 使用所有模块作为Maven Dependecies创建一个Eclipse项目,然后创建一个包含所有测试的JUnit Suite Eclipse's JUnit Runner then will execute all declared Tests if you run this suite. 如果运行此套件,则Eclipse的JUnit Runner将执行所有声明的测试。

In Eclipse Juno, assuming your project is a Maven Project, you can just right click the project name in the Project Explorer and select Run As ... jUnit test. 在Eclipse Juno中,假设您的项目是Maven项目,则可以在Project Explorer中右键单击项目名称,然后选择Run As ... jUnit test。 Alternatively you can produce the same text output you get from mvn test by selecting Run As ... Maven test 或者,您可以通过选择“运行方式... Maven测试”来产生与mvn test相同的文本输出

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM