Mathieu Carbou, 13/10/2011 github.com/Ovea/conf-junit montreal-jug.org junit.org Advanced Junit
<ul><li>Junit basics
Junit advanced
Experimental features
Mockito </li></ul>Schedule
<ul><li>@Test </li></ul>Junit basics
<ul><li>@Test
@Before, @After
@BeforeClass, @AfterClass   </li></ul>Junit basics
<ul><li>@BeforeClass
For each @Test </li><ul><ul><ul><ul><ul><li>Instanciate test class
@Before
Invoke the test
@After </li></ul></ul></ul></ul></ul><li>@AfterClass </li></ul>Junit lifecycle
<ul><li>@Test
@Before, @After
@BeforeClass, @AfterClass
Suites </li></ul>Junit basics
Upcoming SlideShare
Loading in...5
×

Advanced junit and mockito

9,984

Published on

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

No Downloads
Views
Total Views
9,984
On Slideshare
0
From Embeds
0
Number of Embeds
15
Actions
Shares
0
Downloads
105
Comments
0
Likes
7
Embeds 0
No embeds

No notes for slide
  • - presentation: expert en java &amp; design, Depuis 16 ans (jdk 1 – sous windows) specialiste en dev web (5 ans), Infra maven Archi backend (web service, clustering, event driven, ajax &amp; reverse-ajax) - presentation sera sur mon blog
  • - presentation: expert en java &amp; design, Depuis 16 ans (jdk 1 – sous windows) specialiste en dev web (5 ans), Infra maven Archi backend (web service, clustering, event driven, ajax &amp; reverse-ajax) - presentation sera sur mon blog
  • Advanced junit and mockito

    1. 1. Mathieu Carbou, 13/10/2011 github.com/Ovea/conf-junit montreal-jug.org junit.org Advanced Junit
    2. 2. <ul><li>Junit basics
    3. 3. Junit advanced
    4. 4. Experimental features
    5. 5. Mockito </li></ul>Schedule
    6. 6. <ul><li>@Test </li></ul>Junit basics
    7. 7. <ul><li>@Test
    8. 8. @Before, @After
    9. 9. @BeforeClass, @AfterClass </li></ul>Junit basics
    10. 10. <ul><li>@BeforeClass
    11. 11. For each @Test </li><ul><ul><ul><ul><ul><li>Instanciate test class
    12. 12. @Before
    13. 13. Invoke the test
    14. 14. @After </li></ul></ul></ul></ul></ul><li>@AfterClass </li></ul>Junit lifecycle
    15. 15. <ul><li>@Test
    16. 16. @Before, @After
    17. 17. @BeforeClass, @AfterClass
    18. 18. Suites </li></ul>Junit basics
    19. 19. <ul><li>@Test
    20. 20. @Before, @After
    21. 21. @BeforeClass, @AfterClass
    22. 22. Suites
    23. 23. Assertions </li></ul>Junit basics
    24. 24. <ul><li>Hamcrest </li></ul>Junit advanced http://code.google.com/p/hamcrest
    25. 25. <ul><li>Hamcrest
    26. 26. @ClassRule & @Rule </li></ul>Junit advanced
    27. 27. public interface TestRule { Statement apply( Statement base, Description description); } @Rule Statement @ClassRule Statement Junit advanced
    28. 28. <ul><li>Hamcrest
    29. 29. @ClassRule & @Rule
    30. 30. @RunWith </li></ul>Junit advanced
    31. 31. Junit runners Runner ParentRunner BlockJUnit4ClassRunner Suite Junit4 RunnerScheduler
    32. 32. public interface RunnerScheduler { void schedule(Runnable childStatement ); void finished(); } childStatement Scheduling
    33. 33. <ul><li>Enclosed runner </li></ul>Experimentals
    34. 34. <ul><li>Enclosed runner
    35. 35. @Category </li></ul>Experimentals
    36. 36. <ul><li>Enclosed runner
    37. 37. @Category
    38. 38. @Theory </li></ul>Experimentals
    39. 39. <ul>http://code.google.com/p/mockito/wiki/FeaturesAndMotivations http://docs.mockito.googlecode.com/hg/latest/org/mockito/Mockito.html </ul>expect-run-verify stubbing-run-(verify) VS Mockito EasyMock JMock Mockito
    40. 40. QUESTIONS ? Advanced Junit
    1. A particular slide catching your eye?

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

    ×