Package org.nuxeo.runtime.test.runner
Class TransactionalFeature
java.lang.Object
org.nuxeo.runtime.test.runner.TransactionalFeature
- All Implemented Interfaces:
RunnerFeature
The transactional feature is responsible of transaction management.
It brings some API to wait for transaction
- Since:
- 10.2
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
Handler used to commit transaction before next action and start a new one after next action ifTransactionalConfig.autoStart()
is true.static interface
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
protected boolean
protected final List<TransactionalFeature.Waiter>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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
void
initialize
(FeaturesRunner runner) Called when preparing to run the test class.void
void
nextTransaction
(long duration, TimeUnit unit) Deprecated.void
nextTransaction
(Duration duration) protected void
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 Details
-
autoStartTransaction
protected boolean autoStartTransaction -
txStarted
protected boolean txStarted -
waiters
-
-
Constructor Details
-
TransactionalFeature
public TransactionalFeature()
-
-
Method Details
-
addWaiter
-
nextTransaction
public void nextTransaction() -
nextTransaction
Deprecated.since 10.3, usenextTransaction(Duration)
instead. -
nextTransaction
-
await
protected void await(TransactionalFeature.Waiter waiter, Duration duration) throws InterruptedException - Throws:
InterruptedException
-
initialize
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()
-
nextTransaction(Duration)
instead.