Package org.nuxeo.runtime.test.runner
Class TransactionalFeature
- java.lang.Object
-
- org.nuxeo.runtime.test.runner.TransactionalFeature
-
- All Implemented Interfaces:
RunnerFeature
public class TransactionalFeature extends Object implements RunnerFeature
The transactional feature is responsible of transaction management.It brings some API to wait for transaction
- Since:
- 10.2
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
TransactionalFeature.TransactionalDeployer
Handler used to commit transaction before next action and start a new one after next action ifTransactionalConfig.autoStart()
is true.static interface
TransactionalFeature.Waiter
-
Field Summary
Fields Modifier and Type Field Description protected boolean
autoStartTransaction
protected boolean
txStarted
protected List<TransactionalFeature.Waiter>
waiters
-
Constructor Summary
Constructors Constructor Description TransactionalFeature()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addWaiter(TransactionalFeature.Waiter waiter)
void
afterTeardown(FeaturesRunner runner, org.junit.runners.model.FrameworkMethod method, Object test)
After the call of the @After methodsprotected void
await(TransactionalFeature.Waiter waiter, Duration duration)
void
beforeSetup(FeaturesRunner runner, org.junit.runners.model.FrameworkMethod method, Object test)
Before entering in the @Before methodsprotected void
commitOrRollbackTransactionAfter()
void
initialize(FeaturesRunner runner)
Called when preparing to run the test class.void
nextTransaction()
void
nextTransaction(long duration, TimeUnit unit)
Deprecated.since 10.3, usenextTransaction(Duration)
instead.void
nextTransaction(Duration duration)
protected void
startTransactionBefore()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.nuxeo.runtime.test.runner.RunnerFeature
afterMethodRun, afterRun, afterTeardown, beforeMethodRun, beforeRun, beforeSetup, configure, start, stop, testCreated
-
-
-
-
Field Detail
-
autoStartTransaction
protected boolean autoStartTransaction
-
txStarted
protected boolean txStarted
-
waiters
protected final List<TransactionalFeature.Waiter> waiters
-
-
Method Detail
-
addWaiter
public void addWaiter(TransactionalFeature.Waiter waiter)
-
nextTransaction
public void nextTransaction()
-
nextTransaction
@Deprecated public void nextTransaction(long duration, TimeUnit unit)
Deprecated.since 10.3, usenextTransaction(Duration)
instead.
-
nextTransaction
public void nextTransaction(Duration duration)
-
await
protected void await(TransactionalFeature.Waiter waiter, Duration duration) throws InterruptedException
- Throws:
InterruptedException
-
initialize
public void initialize(FeaturesRunner runner)
Description copied from interface:RunnerFeature
Called when preparing to run the test class. Framework is not started at this point. Here is time for the feature to configure the runner from annotations on the test class.- Specified by:
initialize
in interfaceRunnerFeature
-
beforeSetup
public void beforeSetup(FeaturesRunner runner, org.junit.runners.model.FrameworkMethod method, Object test)
Description copied from interface:RunnerFeature
Before entering in the @Before methods- Specified by:
beforeSetup
in interfaceRunnerFeature
-
afterTeardown
public void afterTeardown(FeaturesRunner runner, org.junit.runners.model.FrameworkMethod method, Object test)
Description copied from interface:RunnerFeature
After the call of the @After methods- Specified by:
afterTeardown
in interfaceRunnerFeature
-
startTransactionBefore
protected void startTransactionBefore()
-
commitOrRollbackTransactionAfter
protected void commitOrRollbackTransactionAfter()
-
-