mavenunit-testingjunitmapreducemrunit

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.


Solution

  • 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