Open GoogleCodeExporter opened 8 years ago
Thanks for the patch! But could you please help out by creating a real patch
(see
https://ariejan.net/2007/07/03/how-to-create-and-apply-a-patch-with-subversion)
from the latest source? That would make it much simpler for me. Also if you
like please run the test suite in PowerMock to make sure that all tests pass
(you need Java 6 for this and it's best to run something like: "mvn clean
install -Dmaven.javadoc.skip=true" since javadoc generation is slow).
Original comment by johan.ha...@gmail.com
on 22 Jan 2013 at 7:49
[deleted comment]
Ok, no problem. I'll comment here on my progress. It may take me a while
since the project at my job where I discovered this uses Java 7, I'll have to
setup and work on this at home.
Original comment by oliverhe...@gmail.com
on 23 Jan 2013 at 4:41
Thanks!
Original comment by johan.ha...@gmail.com
on 23 Jan 2013 at 8:35
I have a patch of the suggested fix ready, but some tests are failing. I'll
look into them and see if I can fix the problems, depending on whether or not I
introduced a bug.
Original comment by oliverhe...@gmail.com
on 1 Feb 2013 at 1:38
Great work! Do you use Java 6 when you build PowerMock? (That is VERY
important). If you upload the patch I can try it out as well.
Original comment by johan.ha...@gmail.com
on 1 Feb 2013 at 7:05
Here's the patch of the changes.
In trying to troubleshoot the failing tests, for some reason, I'm getting
errors due to the wildcard imports in Eclipse. I'm on a Mac using the last
JDK6 Apple released, so maybe this is a quirk with that compiler. I'll try
locally removing the wildcard imports so that I can work in my environment, and
if I fix the tests, I won't include those changes in a patch.
Original comment by oliverhe...@gmail.com
on 2 Feb 2013 at 1:48
Attachments:
Thanks! I've tried to apply the patch and when I run the entire test suite from
Maven the following tests fail:
assertLocalClassMockingWorksWithArguments(samples.junit4.classwithinnermembers.C
lassWithInnerMembersTest)
assertNonStaticMemberClassMockingWorksWithArguments(samples.junit4.classwithinne
rmembers.ClassWithInnerMembersTest)
shouldFindMemberVarArgsCtorWhenPassingArrayToWithArguments(samples.powermockito.
junit4.constructor.InnerConstructorsAreFoundTest): Argument is not an array
Original comment by johan.ha...@gmail.com
on 2 Feb 2013 at 11:03
I only get 2 of the 3 same failures:
Results :
Failed tests:
assertLocalClassMockingWorksWithArguments(samples.junit4.classwithinnermembers.ClassWithInnerMembersTest):
Unexpected constructor call samples.classwithinnermembers.ClassWithInnerMembers$2MyLocalClass(samples.classwithinnermembers.ClassWithInnerMembers@3e0d1329):
samples.classwithinnermembers.ClassWithInnerMembers$2MyLocalClass("my value"): expected: 1, actual: 0
assertNonStaticMemberClassMockingWorksWithArguments(samples.junit4.classwithinnermembers.ClassWithInnerMembersTest):
Unexpected constructor call samples.classwithinnermembers.ClassWithInnerMembers$MyInnerClassWithConstructorArgument(samples.classwithinnermembers.ClassWithInnerMembers@4d91f801):
samples.classwithinnermembers.ClassWithInnerMembers$MyInnerClassWithConstructorArgument("value"): expected: 1, actual: 0
Tests run: 296, Failures: 2, Errors: 0, Skipped: 6
Original comment by oliverhe...@gmail.com
on 6 Feb 2013 at 2:19
Ok, I fixed the failures I was getting. Turned out there was another scenario
I wasn't aware of that my first fix broke. Maven run shows everything passing.
Original comment by oliverhe...@gmail.com
on 6 Feb 2013 at 3:38
Attachments:
All tests seem to pass, good work :) I think it would be really nice if you
could create a test case that verifies that the issue is solved. Otherwise it
may easily lead to regression bugs.
Original comment by johan.ha...@gmail.com
on 6 Feb 2013 at 7:04
Definitely, I'm already planning to the next window of free time I get. :)
Original comment by oliverhe...@gmail.com
on 6 Feb 2013 at 8:27
That would be great! Thanks for your help so far.
Original comment by johan.ha...@gmail.com
on 6 Feb 2013 at 8:33
Ah, I see you committed my patch, thanks!
Here's a unit test for this issue.
If you can point me in the right direction, I can also write a test for this
issue that attempts to reproduce the problem as I originally described.
Original comment by oliverhe...@gmail.com
on 16 Feb 2013 at 11:48
Attachments:
Forgot to mention, when I get back to my work environment where I originally
encountered this issue, I'll test this under Java 7 & Javassist 3.17.1-GA.
Original comment by oliverhe...@gmail.com
on 16 Feb 2013 at 11:55
At work with Java 7 & Javassist 3.17.1-GA, tests failed with the following:
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running powermock.classloading.ObjenesisDeepClonerTest
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000000294e6a5, pid=4964, t
id=7784
#
# JRE version: 7.0_11-b21
# Java VM: Java HotSpot(TM) 64-Bit Server VM (23.6-b04 mixed mode windows-amd64
compressed oops)
# Problematic frame:
# j java.lang.Class.privateGetDeclaredFields(Z)[Ljava/lang/reflect/Field;+51
#
# Failed to write core dump. Minidumps are not enabled by default on client vers
ions of Windows
#
# An error report file with more information is saved as:
# C:\dev\lib\powermock-read-only\classloading\classloading-objenesis\hs_err_pid4
964.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.sun.com/bugreport/crash.jsp
#
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] There are test failures.
Please refer to C:\dev\lib\powermock-read-only\classloading\classloading-objenes
is\target\surefire-reports for the individual test results.
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4 minutes 23 seconds
[INFO] Finished at: Sun Feb 17 14:49:41 EST 2013
[INFO] Final Memory: 274M/516M
[INFO] ------------------------------------------------------------------------
Original comment by oliverhe...@gmail.com
on 27 Feb 2013 at 7:08
Yes that is a known isssue on Java 7. You need to build with Java 6.
Original comment by johan.ha...@gmail.com
on 28 Feb 2013 at 7:04
Is there any fix for above mentioned fatal error for
powermock.classloading.ObjenesisDeepClonerTest for java 7 or java 8?
Original comment by chirag.o...@gmail.com
on 9 Jan 2015 at 8:31
Good question. It's been a long time since I've had to deal with this issue,
and I'm no longer working on the project where we needed this fix. I'm
assuming now almost 2 years later there's still a problem under Java 7, and now
8? I would think by now PowerMock fully supports Java 7, so hopefully a
project member can give us a clear answer.
Original comment by mr.olive...@gmail.com
on 15 Jan 2015 at 2:19
Original issue reported on code.google.com by
oliverhe...@gmail.com
on 14 Jan 2013 at 12:29