public class DbUnitJunitRunner
extends org.junit.runners.BlockJUnit4ClassRunner
Runner
to fill and clear
database between each tests.
DbUnitRule
to the test class when this runner is
initialized.
DbUnitConnection
configuration:
@RunWith(DbUnitJunitRunner.class)
@DbUnitConnection(url = "jdbc:hsqldb:mem:testdb", user = "SA", password = "")
@bUnitDataSet("classpath:/dataset/xml")
public MyDaoTest {
@Test
public void test1() {
// ...
}
}
Constructor | Description |
---|---|
DbUnitJunitRunner(Class<?> klass) |
Create runner.
|
Modifier and Type | Method | Description |
---|---|---|
protected List<org.junit.rules.TestRule> |
getTestRules(Object target) |
collectInitializationErrors, computeTestMethods, createTest, describeChild, getChildren, isIgnored, methodBlock, methodInvoker, possiblyExpectingExceptions, rules, runChild, testName, validateConstructor, validateFields, validateInstanceMethods, validateNoNonStaticInnerClass, validateOnlyOneConstructor, validateTestMethods, validateZeroArgConstructor, withAfters, withBefores, withPotentialTimeout
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public DbUnitJunitRunner(Class<?> klass) throws org.junit.runners.model.InitializationError
klass
- Running class.org.junit.runners.model.InitializationError
- If an error occurred while creating Jdbc connection factory.Copyright © 2017. All rights reserved.