• 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
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

ScheduledExecutorService EasyMock Test

 
Ranch Hand
Posts: 1491
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How to implement Runnable's run() method in EasyMock Test class ?




 
Bartender
Posts: 689
17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not white sure what you mean by your question, could you clarify? What is it you're trying to do and what error do you get?

However, a few things I do notice:

* Are you sure that is EasyMock? It looks identical to Mockito to me.

* Your scheduler() method is not easily testable. It takes no parameters and creates its own variables. You can't mock the Runnable it is using because you aren't using dependency injection.

* The scheduler() creates an infinite loop that does nothing but repeatedly call the scheduler() method. What is there to test?
 
Can you really tell me that we aren't dealing with suspicious baked goods? And then there is this tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic