AludraTest use y syntax similar to junit.
A minimal test case would be:
import org.aludratest.AludraTestCase; import org.aludratest.testcase.Test; public class MyTestClass extends AludraTestCase { @Test public void myTestMethod() { logInfo("myTestMethod was called"); } }
Often, certain functionality has to be invoked before (set-up) or after (tear-down) test execution. This can be achieved by putting relevant code into particular methods. Such methods have the following requirements:
Any test class may have several methods marked with @Before or @After, also inherited methods are executed.
If a test class has several test methods, each @Before method is called before each test method and each @After method after each test method.
Example:
import org.aludratest.testcase.After; import org.aludratest.testcase.AludraTestCase; import org.aludratest.testcase.Before; import org.aludratest.testcase.Test; public class MyTestClass extends AludraTestCase { @Before public void setUp() { System.out.println("setUp()"); } @After public void tearDown() { System.out.println("tearDown()"); } @Test public void myTestMethod() { logInfo("myTestMethod was called"); } }