aspose file tools*
The moose likes Testing and the fly likes How to do unit testing for Cookies in JMock Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "How to do unit testing for Cookies in JMock" Watch "How to do unit testing for Cookies in JMock" New topic
Author

How to do unit testing for Cookies in JMock

Nitesh Patel
Ranch Hand

Joined: Mar 16, 2008
Posts: 33
Hi All,
I come to a scenario where I need to update my test cases to test Cookies logic. I am unable to find out how can I do this in JMock ? Below is my code,


I am already doing unit test for "header" same way I need to do for Cookies. Can someone please guide me ?
Regards,
Nitesh
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4745
    
    7

The biggest problem you have with code like that is probably figuring out where the actual class under test went to because, well, I don't see one. All I see are context, request, and response and they are all impostors. If you're testing for headers the same way, then that's double trouble for you. What exactly is the class with the real production code that you want to test?


Junilu - [How to Ask Questions] [How to Answer Questions]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to do unit testing for Cookies in JMock