PowerMock 1.6.6 is released

572 views
Skip to first unread message

Johan Haleby

unread,
Nov 4, 2016, 6:04:12 AM11/4/16
to powe...@googlegroups.com
PowerMock 1.6.6 has just been released. Changes are:

* Added support for setting private static final fields in Whitebox.setInternalState  (thanks to Andrei Petcu @andreicristianpetcu for pull request)
* Added support for specifying constructor parameters for Mockito for whenNew case (Only mock specific calls to new #31)
* Fixed #668 @Mock fields are not injected anymore (1.6.5 regression)
* Fixed #676 Using Powermock with Roo/AspectJ gives NullPointerException (thanks to Sebastian Saip @ssaip for pull request)
* Fixed #656 TooManyActualInvocations when class is prepared for test.
* Fixed #695 ClassNotFoundException when loading cglib enhanced classes created by Spring
* Fixed Java 6 compatibility issue in org.powermock.utils.StringJoiner (which accidentally referenced Java 7 API's)
* Fixed #701 StackOverflowError mocking final class extending non-public abstract class overriding equals method
* Fixed #707 PowerMock should ignore and keep synthetic method/fields when modifies class
* Fixed #645 jacoco offline instrumentation incompatibility with powermock byte-code manipulation when using @SuppressStaticInitializationFor 
* Fixed #422 PowerMock disables EclEmma code coverage 
* Fixed #704 PowerMockito 1.6.5 throws java.lang.SecurityException signer information mismatch 
* Refactoring: Move ProxyFramework from api modules to `reflect` module.
* Renamed org.powermock.reflect.internal.WhiteboxImpl.getAllMetodsExcept to org.powermock.reflect.internal.WhiteboxImpl.getAllMethodsExcept (typo)
* Refactoring: Fix performance issues, fix error handling issues, remove unused imports, remove verbose or redundant code constructs. (thanks to Mykhailo Kovalskyi @kovalsky for pull request)
* Upgraded Assertj dependency from 3.4.1 to version 3.5.2
* Upgraded Javaassist dependency from 3.20.0-GA to version 3.21.0-GA
* Upgraded Objenesis dependency from 2.2 to version 3.4


Enjoy!

Ignacio Ocampo

unread,
Dec 6, 2016, 12:02:14 AM12/6/16
to PowerMock
Hello! I've the dependency testCompile "org.powermock:powermock-mockito-release-full:1.6.4", when I tried to change to 1.6.6 it fails.

Is there a maven repo in which I can find the testCompile "org.powermock:powermock-mockito-release-full:1.6.6" version?

Thanks.

Zagretdinov Arthur

unread,
Dec 6, 2016, 1:45:06 AM12/6/16
to powe...@googlegroups.com
Hello, 

Indeed, I cannot find full jars for last two versions. I’ll look into it. Something has gone wrong during release. 

Thank you for reporting it. Meanwhile, you can download full jars from 
And install it to your local repository/company nexus. 

Best regrads,
Arthur Zagretdinov


--
You received this message because you are subscribed to the Google Groups "PowerMock" group.
To unsubscribe from this group and stop receiving emails from it, send an email to powermock+...@googlegroups.com.
To post to this group, send email to powe...@googlegroups.com.
Visit this group at https://groups.google.com/group/powermock.
For more options, visit https://groups.google.com/d/optout.

Ignacio Ocampo

unread,
Dec 7, 2016, 12:29:15 AM12/7/16
to PowerMock
Thanks! I've problems with org.powermock:powermock-mockito-release-full:1.6.4 and Jacoco (@PrepareForTest) to get code coverage. I read that this was fixed in the 1.6.6.
Is that true? Thanks!

Zagretdinov Arthur

unread,
Dec 7, 2016, 1:36:49 AM12/7/16
to powe...@googlegroups.com
Hello, 

Yes, PowerMock 1.6.6 works with JaCoCo offline instrumented classes and you may get code coverage. 
More information here: 


Best regrads,
Arthur Zagretdinov

Ignacio Ocampo

unread,
Dec 7, 2016, 2:43:03 AM12/7/16
to PowerMock
Thanks Arthur, do you have an example with Gradle?

Zagretdinov Arthur

unread,
Dec 7, 2016, 3:39:07 AM12/7/16
to powe...@googlegroups.com
Hi,

Unfortunately we have examples only for Maven. 

I'm going to create a one more repository for grade examples, but later. 

If you find a way to do it , you are welcome to create a pull request :) 

Best regrads,
Arthur Zagretdinov

Johan Haleby

unread,
Dec 7, 2016, 3:47:30 AM12/7/16
to powe...@googlegroups.com
On Tue, Dec 6, 2016 at 7:45 AM, Zagretdinov Arthur <arthur.zagretdinov@outlook.com> wrote:
Hello, 

Indeed, I cannot find full jars for last two versions. I’ll look into it. Something has gone wrong during release. 

This is actually by design. The "release-full" should never have been deployed to Maven central and you should not depend on them. This the the _release_ artifact itself. You should use the dependencies as defined in the "Getting Started" page.
 
To unsubscribe from this group and stop receiving emails from it, send an email to powermock+unsubscribe@googlegroups.com.

To post to this group, send email to powe...@googlegroups.com.
Visit this group at https://groups.google.com/group/powermock.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "PowerMock" group.
To unsubscribe from this group and stop receiving emails from it, send an email to powermock+unsubscribe@googlegroups.com.

Zagretdinov Arthur

unread,
Dec 7, 2016, 4:04:46 AM12/7/16
to powe...@googlegroups.com

But it was being deployed to maven central until version 1.6.4. 


As may see the full jar is used. 

Seems to me, we should totally remove full jars in next releases: 1.6.7 and 2.0.0. (Maybe it'll be better change version of next release from 1.6.7 to 1.7.0). 

I'm working on migration to Gradle and I prefer not to support building full jars in Gradle build. 


Best regrads,
Arthur Zagretdinov

To unsubscribe from this group and stop receiving emails from it, send an email to powermock+...@googlegroups.com.

Johan Haleby

unread,
Dec 7, 2016, 4:36:20 AM12/7/16
to powe...@googlegroups.com
On Wed, Dec 7, 2016 at 10:04 AM, Zagretdinov Arthur <arthur.za...@outlook.com> wrote:

But it was being deployed to maven central until version 1.6.4. 

True, but that was a mistake from my part. Now I delete the manually.
Yes, this is because (at least afaik) you cannot exclude artifacts from being deployed to a repository (Nexus in our case). You can just delete them after the fact that they've been deployed.
 

Seems to me, we should totally remove full jars in next releases: 1.6.7 and 2.0.0. (Maybe it'll be better change version of next release from 1.6.7 to 1.7.0). 

The only reason for having the "full jars" is to make it easier to use PowerMock when not using a build tool such as Maven and Gradle. The purpose of the "full jars" is to merge all small powermock libraries into one larger one so that users doesn't have to download and put all small jars file into the classpath manually. However it has lead to a lot of complexity in the release process so I'm personally fine with removing support for this in the future. We could just zip all jar files together instead (for example).
 

I'm working on migration to Gradle and I prefer not to support building full jars in Gradle build. 

Sounds good to me.
 


Best regrads,
Arthur Zagretdinov


On 7 Dec 2016, at 09:47, Johan Haleby <johan....@gmail.com> wrote:

Reply all
Reply to author
Forward
0 new messages