Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

All jUnit test cases are not running for Maven project using PowerMock with easymock, Surefire

In a Maven Project I am using PowerMock-easymock to run jUnit test cases. but while doing "mvn clean install" , I am getting below output..


T E S T S

Running TestSuite Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.621 sec

Results :

Tests run: 2, Failures: 0, Errors: 0, Skipped: 0


But I have many other test cases. Here is a part of pom.xml

<dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.8.2</version>
        <scope>test</scope>
</dependency>
<dependency>
        <groupId>org.easymock</groupId>
        <artifactId>easymock</artifactId>
        <version>3.1</version>
        <scope>test</scope>
</dependency>
<dependency>
        <groupId>org.powermock</groupId>
        <artifactId>powermock-easymock-release-full</artifactId>
        <version>1.4.12</version>
        <type>pom</type>
</dependency>

If I remove, PowerMock dependency and do "mvn clean install" , all test cases are running fine. But I have to use PowerMock. How to solve this issue?

like image 947
Jyoti Ranjan Avatar asked Feb 18 '23 23:02

Jyoti Ranjan


1 Answers

I guess that some of your test cases are not running, did you try this

  1. Use mvn surefire plugin, and include test cases in that.

  2. ensure dependancy of powermock-module-junit4.

    check out these link: code.google.com/p/powermock/wiki/EasyMock_maven http://code.google.com/p/powermock/wiki/GettingStarted

like image 169
Dipak Avatar answered Apr 27 '23 22:04

Dipak