ahmaddarawshi / powermock

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

Reflection invokation for fails for X.class.Y #110

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Modify the GreeterTest from SuppressStaticInitializer to PrepareForTest
2. Execute the test

What is the expected output? What do you see instead?
Caused by: org.powermock.reflect.exceptions.MethodNotFoundException: No
method found with name 'getClassLoader' with argument types: [
[Ljava.lang.Class; ] in class demo.org.powermock.examples.simple.SimpleConfig
    at
org.powermock.reflect.internal.WhiteboxImpl.throwExceptionIfMethodWasNotFound(Wh
iteboxImpl.java:898)
    at
org.powermock.reflect.internal.WhiteboxImpl.getMethod(WhiteboxImpl.java:178)
    at org.powermock.core.MockGateway.doMethodCall(MockGateway.java:66)
    at org.powermock.core.MockGateway.methodCall(MockGateway.java:86)
    at
demo.org.powermock.examples.simple.SimpleConfig.<clinit>(SimpleConfig.java:26)
    ... 38 more

The error message is also wrong (shouldn't be Ljava.lang.Class;)

Original issue reported on code.google.com by johan.ha...@gmail.com on 25 May 2009 at 6:18

GoogleCodeExporter commented 9 years ago
The reason for this is the changes that allows for mocking of system classes 
(public
void edit(MethodCall m), if this is disabled it works)

Original comment by johan.ha...@gmail.com on 25 May 2009 at 6:19

GoogleCodeExporter commented 9 years ago

Original comment by johan.ha...@gmail.com on 25 May 2009 at 6:44