简体   繁体   中英

How do I run MRUnit tests using mvn test command like JUnit tests

I am able to run the MRUnit tests from eclipse by right clicking the project and clicking Run as JUnit test, but when I run the same MRUnit test program using the mvn test command on the command line, I get the following output with no errors:

...
Running com.bah.ossem.WordcountMRUnitTest
Configuring TestNG with:        
org.apache.maven.surefire.testng.conf.TestNG652Configuator@428aaed5
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.727 
...
[INFO] BUILD SUCCESS
...

Furthermore, I can run normal JUnit tests with the mvn test command just fine.

Needed to add this to my pom.xml file:

<build>
  <pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.16</version>
      </plugin>
    </plugins>
  </pluginManagement>
</build>

Answer came from: Maven not running Test

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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