Thoppan / powermock

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

MockStaticTest.testMockStatic failing with IllegalStateException: no last call on a mock available #310

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.downloaded powermock-easymock-junit-1.4.7.zip
2. download the files StaticService.class, StaticHelper.class
3.Run the test class MockStaticTest
4. test case fails with
java.lang.IllegalStateException: no last call on a mock available
    at org.easymock.EasyMock.getControlForLastCall(EasyMock.java:521)
    at org.easymock.EasyMock.expect(EasyMock.java:499)
    at com.westgroup.novus.migratescheduler.MockStaticTest.testMockStatic(MockStaticTest.java:44)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

What version of the product are you using? On what operating system?
powermock-easymock-junit-1.4.7.zip on windows xp

Please provide any additional information below.
I am trying ot use powermock to mock the static class, i wanted to take help 
from working example from MockStaticTest. 

Original issue reported on code.google.com by satya1...@gmail.com on 27 Jan 2011 at 7:49

GoogleCodeExporter commented 9 years ago
This is usually a user error. "MockStaticTest" is executed on every PowerMock 
release so it should work. Please provide a running example if you think 
there's a problem.

Thanks

Original comment by johan.ha...@gmail.com on 10 Feb 2011 at 7:10

GoogleCodeExporter commented 9 years ago
I think that this issue is related to Issue 309

Original comment by sesam...@googlemail.com on 7 Apr 2011 at 11:13