Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Migrating to PDT test framework based on Junit4"

(Cookbook (delta from Junit3.8))
(PDT test framework Cookbook (delta from Junit3.8))
Line 1: Line 1:
== PDT test framework Cookbook (delta from Junit3.8) ==
+
== PDT Test Framework Cookbook (delta from Junit3.8) ==
  
 
# No need to extend from <code>TestCase</code> - still you can extend from <code>PhpTestCase</code> to have Golden capabilities
 
# No need to extend from <code>TestCase</code> - still you can extend from <code>PhpTestCase</code> to have Golden capabilities

Revision as of 04:00, 10 June 2007

PDT Test Framework Cookbook (delta from Junit3.8)

  1. No need to extend from TestCase - still you can extend from PhpTestCase to have Golden capabilities
  2. use Assertclass for assert<Type> testing
  3. Mark unit test as @GUITest or @HeadlessTest or @BareTest - this annotation indicates which runner to use (GUI, Headless or bare).
  4. Mark test method as @Test
  5. Mark as @Before methods that should be run before each test method
  6. Mark as @After methods that should be run after each test method
  7. Mark as @BeforeClass method that should be run before all test methods
  8. Mark as @AfterClass method that should be run after all test methods
  9. Add parameter (expected=<ExceptionClass.class>) to the @Test annotation
  10. Add parameter (timeout=<ms>) to the @Test annotation
  11. Add @Ignore to ignore the test
  12. Add @Parameter to run unit test several times with different parameters.

Back to the top