Your SlideShare is downloading. ×
EasyMock 101
EasyMock 101
EasyMock 101
EasyMock 101
EasyMock 101
EasyMock 101
EasyMock 101
EasyMock 101
EasyMock 101
EasyMock 101
EasyMock 101
EasyMock 101
EasyMock 101
EasyMock 101
EasyMock 101
EasyMock 101
EasyMock 101
EasyMock 101
EasyMock 101
EasyMock 101
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

EasyMock 101

4,128

Published on

A quick review of the EasyMock mocking (testing) framework and how it can make your testing more productive and less tightly coupled.

A quick review of the EasyMock mocking (testing) framework and how it can make your testing more productive and less tightly coupled.

Published in: Technology, Education
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
4,128
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
117
Comments
0
Likes
2
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. EasyMock 101 A 30 Minute Review by Matthew McCullough
  • 2. ❶ What Is Mocking?
  • 3. Are You Mocking Me? • A fake object • Allows for more modular testing • Records and verifies expectations of calls
  • 4. ❷ Creating A Mock
  • 5. IEnumeration iEnumIntfMock = EasyMock.createMock(EnumeratedAttribute.class);

    Slide 6:❸ Expectations

    Slide 7: Expecting A Lot • Expect method is called on mock • Expect sequence of method calls on mock (call createStrictMock()) • Expect parameters to methods calls on mock

    Slide 8: Expect A Call EasyMock.expect(iEnumIntfMock.getNumberOfRows() );

    Slide 9: Expect A Return EasyMock.expect(iEnumIntfMock.getNumberOfRows() ).andReturn(5);

  • 6. ❸ Expectations
  • 7. Expecting A Lot • Expect method is called on mock • Expect sequence of method calls on mock (call createStrictMock()) • Expect parameters to methods calls on mock
  • 8. Expect A Call EasyMock.expect(iEnumIntfMock.getNumberOfRows() );
  • 9. Expect A Return EasyMock.expect(iEnumIntfMock.getNumberOfRows() ).andReturn(5);

×