maven run tests
What is the different between running a test from maven
and cucumber test runner class?
In my project I use cucumber + Junit. to generate reports,
I use maven-cucumber-reporting.
This report is only generated when I run my test as a maven
lifecycle verify. Becuase this is how it works according to
its configuration.
So if I run my test from runner file, it does not trigger
the maven lifecycle. It only runs that test. In order to
run any maven lifecycle we have to run as a maven command
which starts with 'mvn'.
4
6
# Run all the unit test classes.
$ mvn test
# Run a single test class.
$ mvn -Dtest=TestApp1 test
# Run multiple test classes.
$ mvn -Dtest=TestApp1,TestApp2 test
# Run a single test method from a test class.
$ mvn -Dtest=TestApp1#methodname test
# Run all test methods that match pattern 'testHello*' from a test class.
$ mvn -Dtest=TestApp1#testHello* test
# Run all test methods match pattern 'testHello*' and 'testMagic*' from a test class.
$ mvn -Dtest=TestApp1#testHello*+testMagic* test
Thank you!
6
0
4
1
# Run all the unit test classes.
$ mvn test
# Run a single test class.
$ mvn -Dtest=TestApp1 test
# Run multiple test classes.
$ mvn -Dtest=TestApp1,TestApp2 test
# Run a single test method from a test class.
$ mvn -Dtest=TestApp1#methodname test
# Run all test methods that match pattern 'testHello*' from a test class.
$ mvn -Dtest=TestApp1#testHello* test
# Run all test methods match pattern 'testHello*' and 'testMagic*' from a test class.
$ mvn -Dtest=TestApp1#testHello*+testMagic* test
Thank you!
1
0
Are there any code examples left?
New code examples in category Shell/Bash
-
Shell/Bash 2022-03-27 22:30:33 wise highlight ubuntu
-
Shell/Bash 2022-03-27 22:25:19 how to send a pull request in git
-
Shell/Bash 2022-03-27 21:55:06 how to open terminal in sublime text ubuntu
-
Shell/Bash 2022-03-27 21:25:19 how to switch branch
-
Shell/Bash 2022-03-27 21:20:25 python
-
Shell/Bash 2022-03-27 21:20:04 set user as admin gitlab
-
Shell/Bash 2022-03-27 21:10:09 apache2 mod_jk proxy to tomcat connector
-
Shell/Bash 2022-03-27 20:35:12 chown
-
Shell/Bash 2022-03-27 20:15:08 awk last match