• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

easymock, j2ee (struts 2) and debugging...

 
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

i have a struts 2 application which uses now junit and easymock (for testing purposes).
I have some domain objects and those have some methods for testing that all neccessary fields are valid (isValid()), for example a object user and the data object which i called userData
The problem is now, that i am unable to debug into the method - it just throws me into some framework sources



the line above should return true because all neccessary fields are correct, but it returns false, and i have no idea why, so i must debug it.
In eclipse, when i use the debug view, i can set a breakpoint at this line, go with the mouse over "setUserData" and press F5, then it should go into the method and display me what it does
but i get thrown to easymock.jar (which has no debug symbols because i dont use the source, i use the .jar)

Is there any way i can debug it? I need to know why the method "setUserData" returns false

I use eclipse 3.4.2 with Java(TM) SE Runtime Environment (build 1.6.0_14-b08)

Edit: i also set a breakpoint at the first codeline in setUserData (this is where isValid() is called) but it just dont breaks there...
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're debugging the mock, not your code--you mocked it.

I'm more familiar with Mockito than EasyMock, but don't you have to specify what the method will return when you call it? It'll be hard to help without actually seeing your test code that isn't doing what you expect.
reply
    Bookmark Topic Watch Topic
  • New Topic