public final class TransactionalTests
extends java.lang.Object
implements org.junit.rules.TestRule
TestRule that can be used to run the test-methods in transactions.
To use the rule, create a database and add the following lines to your test:
@Rule public final TransactionalTests transactionalTests = new TransactionalTests(db);
| Modifier and Type | Class and Description |
|---|---|
static class |
TransactionalTests.RollbackPolicy
Specified the rollback-policy for tests.
|
| Constructor and Description |
|---|
TransactionalTests(@NotNull org.dalesbred.Database db)
Constructs a rule that will wrap tests in transactions and use the default
rollback-policy (
TransactionalTests.RollbackPolicy.ROLLBACK_ON_FAILURE) for rolling back
the transaction. |
TransactionalTests(@NotNull org.dalesbred.Database db,
@NotNull TransactionalTests.RollbackPolicy rollbackPolicy)
Constructs a rule that will wrap tests in transactions and use the specified
rollback-policy for rolling back the transaction.
|
TransactionalTests(@NotNull javax.inject.Provider<org.dalesbred.Database> db)
Constructs a rule that will wrap tests in transactions and use the default
rollback-policy (
TransactionalTests.RollbackPolicy.ROLLBACK_ON_FAILURE) for rolling back
the transaction. |
TransactionalTests(@NotNull javax.inject.Provider<org.dalesbred.Database> db,
@NotNull TransactionalTests.RollbackPolicy rollbackPolicy)
Constructs a rule that will wrap tests in transactions and use the specified
rollback-policy for rolling back the transaction.
|
| Modifier and Type | Method and Description |
|---|---|
@NotNull org.junit.runners.model.Statement |
apply(@NotNull org.junit.runners.model.Statement base,
@NotNull org.junit.runner.Description description) |
public TransactionalTests(@NotNull
@NotNull org.dalesbred.Database db)
TransactionalTests.RollbackPolicy.ROLLBACK_ON_FAILURE) for rolling back
the transaction.public TransactionalTests(@NotNull
@NotNull org.dalesbred.Database db,
@NotNull
@NotNull TransactionalTests.RollbackPolicy rollbackPolicy)
public TransactionalTests(@NotNull
@NotNull javax.inject.Provider<org.dalesbred.Database> db)
TransactionalTests.RollbackPolicy.ROLLBACK_ON_FAILURE) for rolling back
the transaction.public TransactionalTests(@NotNull
@NotNull javax.inject.Provider<org.dalesbred.Database> db,
@NotNull
@NotNull TransactionalTests.RollbackPolicy rollbackPolicy)