intellij idea - How to run test maven? -
i have problem call unit test maven task. pom.xml
:
<?xml version="1.0" encoding="utf-8"?> <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <groupid>fizzbuzztddkata</groupid> <artifactid>fizzbuzztddkata</artifactid> <version>1.0-snapshot</version> <dependencies> <!-- https://mvnrepository.com/artifact/org.junit/junit5-engine --> <dependency> <groupid>org.junit</groupid> <artifactid>junit5-engine</artifactid> <version>5.0.0-alpha</version> <scope>test</scope> </dependency> <!-- https://mvnrepository.com/artifact/org.mockito/mockito-all --> <dependency> <groupid>org.mockito</groupid> <artifactid>mockito-all</artifactid> <version>1.9.5</version> <scope>test</scope> </dependency> </dependencies> </project>
i add <scope>
property according tutorial, still when trying use mvn clean install
or 'mvn test' got:
tests run: 0, failures: 0, errors: 0, skipped: 0, time elapsed: 0.001 sec results : tests run: 0, failures: 0, errors: 0, skipped: 0 [info] ------------------------------------------------------------------------ [info] build success [info] ------------------------------------------------------------------------ [info] total time: 1.950s [info] finished at: fri apr 14 16:12:32 cest 2017 [info] final memory: 11m/184m [info] ------------------------------------------------------------------------
i using intellij idea 2016.2.5 ultimate , each maven task run run configuration in intellij. doing wrong? should add other dependencies, builds pom.xml
?
first of need add
<build> <plugins> ... <plugin> <artifactid>maven-surefire-plugin</artifactid> <version>2.19</version> <dependencies> <dependency> <groupid>org.junit.platform</groupid> <artifactid>junit-platform-surefire-provider</artifactid> <version>1.0.0-m4</version> </dependency> </dependencies> </plugin> </plugins>
to pom.xml described in junit5 user guide. have define testengine, descriped in link.
<build> <plugins> ... <plugin> <artifactid>maven-surefire-plugin</artifactid> <version>2.19</version> <dependencies> <dependency> <groupid>org.junit.platform</groupid> <artifactid>junit-platform-surefire-provider</artifactid> <version>1.0.0-m4</version> </dependency> <dependency> <groupid>org.junit.jupiter</groupid> <artifactid>junit-jupiter-engine</artifactid> <version>5.0.0-m4</version> </dependency> </dependencies> </plugin> </plugins>
... ... org.junit.jupiter junit-jupiter-api 5.0.0-m4 test
this should all.
Comments
Post a Comment