Advanced junit and mockito

  • 9,617 views
Uploaded on

 

More in: Technology , Education
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
9,617
On Slideshare
0
From Embeds
0
Number of Embeds
15

Actions

Shares
Downloads
88
Comments
0
Likes
6

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
  • - presentation: expert en java & design, Depuis 16 ans (jdk 1 – sous windows) specialiste en dev web (5 ans), Infra maven Archi backend (web service, clustering, event driven, ajax & reverse-ajax) - presentation sera sur mon blog
  • - presentation: expert en java & design, Depuis 16 ans (jdk 1 – sous windows) specialiste en dev web (5 ans), Infra maven Archi backend (web service, clustering, event driven, ajax & reverse-ajax) - presentation sera sur mon blog

Transcript

  • 1. Mathieu Carbou, 13/10/2011 github.com/Ovea/conf-junit montreal-jug.org junit.org Advanced Junit
  • 2.
    • Junit basics
    • 3. Junit advanced
    • 4. Experimental features
    • 5. Mockito
    Schedule
  • 6.
    • @Test
    Junit basics
  • 7.
    • @Test
    • 8. @Before, @After
    • 9. @BeforeClass, @AfterClass
    Junit basics
  • 10.
    • @BeforeClass
    • 11. For each @Test
    • @AfterClass
    Junit lifecycle
  • 15. Junit basics
  • 19. Junit basics
  • 24.
    • Hamcrest
    Junit advanced http://code.google.com/p/hamcrest
  • 25.
    • Hamcrest
    • 26. @ClassRule & @Rule
    Junit advanced
  • 27. public interface TestRule { Statement apply( Statement base, Description description); } @Rule Statement @ClassRule Statement Junit advanced
  • 28. Junit advanced
  • 31. Junit runners Runner ParentRunner BlockJUnit4ClassRunner Suite Junit4 RunnerScheduler
  • 32. public interface RunnerScheduler { void schedule(Runnable childStatement ); void finished(); } childStatement Scheduling
  • 33.
    • Enclosed runner
    Experimentals
  • 34.
    • Enclosed runner
    • 35. @Category
    Experimentals
  • 36. Experimentals
  • 39.
      http://code.google.com/p/mockito/wiki/FeaturesAndMotivations http://docs.mockito.googlecode.com/hg/latest/org/mockito/Mockito.html
    expect-run-verify stubbing-run-(verify) VS Mockito EasyMock JMock Mockito
  • 40. QUESTIONS ? Advanced Junit