• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

EasyMock: createMock without mocked methods  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

I'd like to rewrite my jUnit test to EasyMock. Here is a dummy code snippet:



SomeObject is configured using Attribute1 and Attribute2. I want to test object.doSomethingDependingOn1And2() method call, which makes use of both attributes. Now, let's take a look on EasyMock classextension version:



In createMock call i specify which methods should be mocked. EasyMock does not overwrite object.doSomethingDependingOn1And2() behaviour. It works, but i'll never use this code in my project. Why ? Because of:



It is refactoring unsafe. When i change the name of the attribut1, i'll have to change test case. Is it somehow possible to createMock(), which does not overwrite class behaviour ?

Wish code. expect overtakes method mocking



Thanks, Lukasz
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!