How to get Eclipse to run all my Groovy test tests?

I have an Eclipse project with many unit tests written in Groovy. I can run tests in each individual class using the Eclipse GUnit launch configuration. I open this configuration, select the "Run one test" radio button and select the class whose tests I want to run. This works great, however I want to run all the tests in the project right away.

When I open my launch configuration, select the "Run all tests in the selected project, package or source folder" radio button and select my project, Eclipse will give the error "There are no tests with the test runner" JUnit 4. "

How to get Eclipse to run all tests in my project?

+3
source share
2 answers

Update the alpha version of the groovy -eclipse V2 plugin. You can run all unit tests in a project by right-clicking and selecting "Run as-> JUnit". In the new version of the plugin, Junit tests are processed the same way, whether they are written in Java or Groovy.

+1
source

Find out through the documentation . Groovy has a utility class groovy.util.AllTestSuite . I created a new GUnit startup configuration with this as my test class and added VM arguments as follows:

-Dgroovy.test.dir=src -Dgroovy.test.pattern=**/*Tests.groovy

ant.jar ant -launcher.jar . .

+1

Source: https://habr.com/ru/post/1711117/


All Articles