Daedalos JUnit Extensions Quickstart
Using TestResourcen:
- Define your own Test Resource as a subclass of com.daedalos.junit.TestResource.
- public boolean start(): Implement your code to start the test resource.
Set the return value to true if the test resource is started successfully.
- public boolean stop(): Implement your code to stop the test resource
and to release the requested resources. Set the return value to true if the test resource is stopped successfully.
- Implement your own functionality.
- Define your unit test:
- If you use the enhanced TRTestRunner provided with the Daedalos JUnit Extensions, define your unit tests as
subclasses of junit.framework.TestCase.
- If you want to use the standard JUnit TestRunner instead, define your unit tests using Test Resources as subclass
of com.daedalos.junit.TestResourceTestCase. Register an used Test Resource
by calling TestResourceFactory.current().addTestResource(
YourTestResource).
- Access your test resource by calling
TestResourceFactory.current().getTestResource(
YourTestResource).
- Consider to assign speaking names to yout test resources. Only if your test resource class name contains the
phrase TestResource it is displayed inside the test resource selection dialog, e.g. ExampleTestResource.
- It is no longer necessary to edit the /junit/runner/excluded.properties file,
because an improved Java class loader is supplied.
- Start the Enhanced SwingUI TestRunner by executing:
- java -cp .;junitextensions.jar;junit.jar com.daedalos.junit.gui.TRTestRunner
- Managing your Test Resources:
- Use the Add/Remove options in the TestResourceBrowser.
- As an alternative, you can also edit the file testresources.cfg, which
is saved in your home directory by default. If you use the Global Test Resources option, it is saved in
your working directory instead.
- Have a look at our examples:
- Test Resources:
- com.daedalos.junit.tests.ExampleTestResource,
- com.daedalos.junit.tests.ExampleTestResourceSubClassTest.
- Unit Test:
- com.daedalos.junit.tests.ExampleTestResourceTest.
(C)opyright 2001-2006 by Jens Uwe Pipka, Germany. Contact: jens-uwe.pipka@jup-net.de