Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Help me in mocking static functions with testng powermock and easymock

 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To tell you first, i have tried and tried it again and now i need some help

Heres my code


And heres the log
[Parser] Running: C:\MockWorkspace\Mock\temp-testng-customsuite.xml

got object factory print me Static method called FAILED: testMe 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 staticPkg.TestClass.testMe(TestClass.java:46) ... Removed 22 stack frames

=============================================== staticPkg.TestClass

Tests run: 1, Failures: 1, Skips: 0
=============================================== Mock

Total tests run: 1, Failures: 1, Skips: 0
Help please, i have tried a variety of solutions, can't get it done. Please can anyone try this code and correct it for success? I get error in EasyMock.expect ...............
 
Everybody! Do the Funky Monkey! Like this tiny ad!
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic