Class ItemCreationListener
java.lang.Object
org.junit.runner.notification.RunListener
de.hybris.platform.testframework.runlistener.ItemCreationListener
- All Implemented Interfaces:
PersistencePool.PersistenceListener
public class ItemCreationListener
extends org.junit.runner.notification.RunListener
implements PersistencePool.PersistenceListener
RunListener assuring each created Item will be removed after finish of test. Similar to
TransactionRunListener, but does not depend on used database. Will be disabled automatically for junit thread
if transactional support is enabled by using annotation Transactional. Items created inside other threads are
still logged and removed at the end of test!-
Nested Class Summary
Nested classes/interfaces inherited from class org.junit.runner.notification.RunListener
org.junit.runner.notification.RunListener.ThreadSafe -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidentityCreated(PK pk) protected voidprepareItem(Item item) protected voidremoveItems(Collection<PK> pks) voidtestFinished(org.junit.runner.Description description) Removes all items registered at the item registry.voidtestStarted(org.junit.runner.Description description) protected booleanMethods inherited from class org.junit.runner.notification.RunListener
testAssumptionFailure, testFailure, testIgnored, testRunFinished, testRunStarted, testSuiteFinished, testSuiteStarted
-
Field Details
-
ITEM_CREATION_LIFECYCLE_LISTENER
- See Also:
-
-
Constructor Details
-
ItemCreationListener
public ItemCreationListener()
-
-
Method Details
-
testStarted
- Overrides:
testStartedin classorg.junit.runner.notification.RunListener- Throws:
Exception
-
testFinished
Removes all items registered at the item registry. Will be called automatically at end of each test.- Overrides:
testFinishedin classorg.junit.runner.notification.RunListener- Throws:
Exception
-
removeItems
-
prepareItem
- Throws:
ConsistencyCheckException
-
entityCreated
- Specified by:
entityCreatedin interfacePersistencePool.PersistenceListener
-
transactionsSupported
protected boolean transactionsSupported()
-