We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
From DanFabul...@gmail.com on May 26, 2010 20:18:33
To reproduce: Apply the attached patch to add a test to PowerMock.
The patch adds new public static methods to StaticExample:
We then spy on StaticExample and attempt to mock out publicObjectMethod, returning "Hello Static" instead of new Object().
Expected: The test should pass
Actual: Failure: java.lang.AssertionError: expected: but was:java.lang.Object@2927fa12
ALTERNATE REPRO: Apply this one-line patch to StaticExample.java:
Index: StaticExample.java
--- StaticExample.java ( revision 1319 ) +++ StaticExample.java (working copy) @@ -38,7 +38,7 @@ return privateObjectMethod(); }
private static Object privateObjectMethod() {
public static Object privateObjectMethod() { return new Object(); }
Actual: StaticPartialMockingTest#partialMockingOfStaticMethodReturningObjectWorks fails java.lang.AssertionError: expected: but was:java.lang.Object@7b2884e0
Expected: The test should continue to pass.
I'm using PowerMock 1.3.8 on OSX 10.6.3
Attachment: public-static-method.patch
Original issue: http://code.google.com/p/powermock/issues/detail?id=261
The text was updated successfully, but these errors were encountered:
From johan.ha...@gmail.com on July 22, 2010 00:39:39
Status: Fixed Labels: Milestone-Release1.4
Sorry, something went wrong.
No branches or pull requests
From DanFabul...@gmail.com on May 26, 2010 20:18:33
To reproduce: Apply the attached patch to add a test to PowerMock.
The patch adds new public static methods to StaticExample:
publicObjectMethod (which returns new Object())
publicObjectMethodCaller (which calls the first method).
We then spy on StaticExample and attempt to mock out publicObjectMethod,
returning "Hello Static" instead of new Object().
Expected: The test should pass
Actual: Failure: java.lang.AssertionError: expected: but
was:java.lang.Object@2927fa12
ALTERNATE REPRO: Apply this one-line patch to StaticExample.java:
Index: StaticExample.java
--- StaticExample.java ( revision 1319 )
+++ StaticExample.java (working copy)
@@ -38,7 +38,7 @@
return privateObjectMethod();
}
Actual:
StaticPartialMockingTest#partialMockingOfStaticMethodReturningObjectWorks
fails java.lang.AssertionError: expected: but
was:java.lang.Object@7b2884e0
Expected: The test should continue to pass.
I'm using PowerMock 1.3.8 on OSX 10.6.3
Attachment: public-static-method.patch
Original issue: http://code.google.com/p/powermock/issues/detail?id=261
The text was updated successfully, but these errors were encountered: