Pragmatic unittestingwithj unit

907 views
840 views

Published on

JUnit tips and tricks

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
907
On SlideShare
0
From Embeds
0
Number of Embeds
348
Actions
Shares
0
Downloads
0
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • You are testing use cases – what should your class be doing
  • The constructor should have parameters similar to the what the data() method is returning.
  • Something that happens after a test is completed, like an assertInject behaviour to make JUnit add checks after each test…. kind of like a test post-condition or invariant from Betrand Meyers OO Software construction, but just for the tests themselvesVerifier is a base class for Rules like ErrorCollector, which can turn otherwise passing test methods into failing tests if a verification check is failed
  • Called when a test fails or succeeds.  Additional logging perhaps?  How about restarting a GUI, or take a screenshot when a test fails.
  • Called when a test fails or succeeds.  Additional logging perhaps?  How about restarting a GUI, or take a screenshot when a test fails.
  • Requires Eclipse 3.5+
  • Requires Eclipse 3.5+
  • <parallel>methods</parallel> <threadCount>4</threadCount> <perCoreThreadCount>true</perCoreThreadCount>
  • ×