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.
Difference between revisions of "Migrating to PDT test framework based on Junit4"
(→Cookbook (delta from Junit3.8)) |
(→Cookbook (delta from Junit3.8)) |
||
Line 1: | Line 1: | ||
== Cookbook (delta from Junit3.8) == | == Cookbook (delta from Junit3.8) == | ||
− | # No need to extend from <code>TestCase</code> | + | # No need to extend from <code>TestCase</code> - still you can extend from <code>PhpTestCase</code> to have Golden capabilities |
# use [http://junit.sourceforge.net/javadoc/junit/framework/Assert.html <code>Assert</code>]class for <code>assert<Type></code> testing | # use [http://junit.sourceforge.net/javadoc/junit/framework/Assert.html <code>Assert</code>]class for <code>assert<Type></code> testing | ||
# Mark unit test as <code>@GUITest</code> or <code>@HeadlessTest</code> or <code>@BareTest</code> - this annotation indicates which runner to use (GUI, Headless or bare). | # Mark unit test as <code>@GUITest</code> or <code>@HeadlessTest</code> or <code>@BareTest</code> - this annotation indicates which runner to use (GUI, Headless or bare). |
Revision as of 03:50, 10 June 2007
Cookbook (delta from Junit3.8)
- No need to extend from
TestCase
- still you can extend fromPhpTestCase
to have Golden capabilities - use
Assert
class forassert<Type>
testing - Mark unit test as
@GUITest
or@HeadlessTest
or@BareTest
- this annotation indicates which runner to use (GUI, Headless or bare). - Mark test method as
@Test
- Mark as
@Before
methods that should be run before each test method - Mark as
@After
methods that should be run after each test method - Mark as
@BeforeClass
method that should be run before all test methods - Mark as
@AfterClass
method that should be run after all test methods - Add parameter
(expected=<ExceptionClass.class>)
to the @Test annotation - Add parameter
(timeout=<ms>)
to the@Test
annotation - Add
@Ignore
to ignore the test - Add
@Parameter
to run unit test several times with other parameters.