Your SlideShare is downloading. ×
0
Sep 1, 2011Working with Mockitohugeinc.cominfo@hugeinc.com45 Main St. #220 Brooklyn, NY 11222+1 718 625 4843
Agenda:1. What is Mockito 2. Why use it 3.           Writing Tests
Fewer defects, less debugging,more confidence, better design,   and higher productivity       -- Kent Beck --
State Testing:assertEquals(“joe”, user.getName())                                      4.
Interaction Testing:verify(mockedDao).execute(criteria)                                      5.
Terminology•  Test Stub•  Mock object•  Test Spy                 6.
Mockito Examples•  What we’re doing on BigShipCruises     •  Profile – a simple value object.     •  FindProfileDao – hand...
First writing the testEclipse generates the profileFacade method                                             8.
You run the test and Bang! It fails!Then you implement the method                                       9.
You run the test and it passes!                                  10.
Checking method invocationEclipse generates the profileFacade method                                             11.
You run the test and Bang! It fails! Again!                                          12.
Implement the methodAnd tests pass!                       13.
8.4Tests/second               1.8               Tests/second    Unit       Integration                              14.
Learn More:mockito.org
Questions…
hugeinc.cominfo@hugeinc.com45 Main St. #220 Brooklyn, NY 11222+1 718 625 4843
Upcoming SlideShare
Loading in...5
×

Working with Mockito and Eclipse

7,073

Published on

Small presentation about using mockito on an environment where you're using eclipse as your main development tool.
This shows somehow to use tdd while using eclipse that creates a bunch of code for you.

Published in: Technology
2 Comments
1 Like
Statistics
Notes
No Downloads
Views
Total Views
7,073
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
44
Comments
2
Likes
1
Embeds 0
No embeds

No notes for slide

Transcript of "Working with Mockito and Eclipse"

  1. 1. Sep 1, 2011Working with Mockitohugeinc.cominfo@hugeinc.com45 Main St. #220 Brooklyn, NY 11222+1 718 625 4843
  2. 2. Agenda:1. What is Mockito 2. Why use it 3. Writing Tests
  3. 3. Fewer defects, less debugging,more confidence, better design, and higher productivity -- Kent Beck --
  4. 4. State Testing:assertEquals(“joe”, user.getName()) 4.
  5. 5. Interaction Testing:verify(mockedDao).execute(criteria) 5.
  6. 6. Terminology•  Test Stub•  Mock object•  Test Spy 6.
  7. 7. Mockito Examples•  What we’re doing on BigShipCruises •  Profile – a simple value object. •  FindProfileDao – handles data access. •  ProfileFacade – bridges requests from ws. 7.
  8. 8. First writing the testEclipse generates the profileFacade method 8.
  9. 9. You run the test and Bang! It fails!Then you implement the method 9.
  10. 10. You run the test and it passes! 10.
  11. 11. Checking method invocationEclipse generates the profileFacade method 11.
  12. 12. You run the test and Bang! It fails! Again! 12.
  13. 13. Implement the methodAnd tests pass! 13.
  14. 14. 8.4Tests/second 1.8 Tests/second Unit Integration 14.
  15. 15. Learn More:mockito.org
  16. 16. Questions…
  17. 17. hugeinc.cominfo@hugeinc.com45 Main St. #220 Brooklyn, NY 11222+1 718 625 4843
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×