An active specification with JUnit consists of two parts: an
HTML file and a Java test that extends ConcordionTestCase
.
When you run the test class using JUnit, it will automatically locate the HTML file. It does this by looking in the same package for a ".html" file named the same as the test, but without the "Test" suffix.
If your test is called com.example.BreadcrumbTest then the corresponding HTML file must be in the same package (com.example) and called Breadcrumb.html.
The jUnit 3 integration supports all standard jUnit3 methods - including the setUp method.
import org.concordion.integration.junit3.ConcordionTestCase;
import org.junit.Before;
import org.junit.runner.RunWith;
public class Junit3Test extends ConcordionTestCase {
@Override
public void setUp() {
// this method is called before your fixture starts
}
public boolean assertSomething() {
// this method can be asserted to return "true" from your specification using the
// concordion:assertTrue command
// other commands can be found here.
}
}