Lots of test suites in Maven

I wrote a REST server (in Java using RestEasy ) with a unit test package written in Scala. The test suite uses the breadboard server provided by RestEasy and runs with every Maven build.

I would like to create a second functional test suite that calls the real tomcat server and runs each REST service. I don’t want this new set to work with every assembly, but only on demand could have been controlled using the command line argument for Maven.

Is it possible to create several independent test suites in a Maven project and disable some of the automatic startup, or do I need to create a separate Maven project for this functional package? How can I separate function set code if these tests are in the same project as unit tests (different directories)? How to run the selected package with command line arguments?

+6
source share
1 answer

I have never used it myself, but I know the maven integration tags that the Maven Failsafe plugin runs .

Since the surefire plugin by default includes tests with the name **/Test*.java, **/*Test.java, **/*TestCase.java , the protected plugin starts the tests **/IT*.java, **/*IT.java, **/*ITCase.java .

Both test approaches have different intentions that seem to fit your needs. Maybe worth a look .....


Another approach would be to use maven profiles and specify a different includes includes for each profile.

+4
source

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


All Articles