chiffchaff / powermock

Automatically exported from code.google.com/p/powermock
Apache License 2.0
0 stars 0 forks source link

Powermock will cause mvn clean install build failure. #494

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.mvn sonar:sonar. -- Success
2.mvn clean install. -- Build Failure.
3.Tests in error: 
initializationError(orion.di.whatif.util.WhatIfTradesUtilTest): Failed to 
transform class with name orion.di.whatif.util.WhatIfTradesUtilTest. Reason: 
broken

What is the expected output? What do you see instead?
Build Success

What version of the product are you using? On what operating system?
maven 3.1.1
powermock 1.5.1
easymock 3.2
Sonar 4.1.2
Code Coverage plugin: cobertura 1.4
JUnit 4.0

Please provide any additional information below.

I'm using Powermock to mock static methods in my test cases. All test cases 
work properly in Eclipse when I run them(or single test case) as JUnit test.

But when I run [mvn clean install] to build all things for sonar, the error 
[initializationError] occurs and build failed.

After I checked over this issue, I found if I remove 
annotation[@PrepareForTest(ClassName.class)] before the test class, maven build 
will pass. But surely test cases with Powermock will fail.

I really want to know how to solve this issue... Is there anyone can please 
help me?

Original issue reported on code.google.com by Luventa....@gmail.com on 9 Apr 2014 at 10:08