Class CustomItemCreationListener
java.lang.Object
org.junit.runner.notification.RunListener
de.hybris.platform.searchservices.support.CustomItemCreationListener
- All Implemented Interfaces:
PersistencePool.PersistenceListener
public class CustomItemCreationListener
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) protected ItemListenerModeresolveItemListenerMode(org.junit.runner.Description description) voidtestFinished(org.junit.runner.Description description) Removes all items registered at the item registry.voidtestRunFinished(org.junit.runner.Result result) voidtestRunStarted(org.junit.runner.Description description) voidtestStarted(org.junit.runner.Description description) protected booleanMethods inherited from class org.junit.runner.notification.RunListener
testAssumptionFailure, testFailure, testIgnored, testSuiteFinished, testSuiteStarted
-
Field Details
-
ITEM_CREATION_LIFECYCLE_LISTENER
- See Also:
-
-
Constructor Details
-
CustomItemCreationListener
public CustomItemCreationListener()
-
-
Method Details
-
testRunStarted
- Overrides:
testRunStartedin classorg.junit.runner.notification.RunListener- Throws:
Exception
-
testRunFinished
- Overrides:
testRunFinishedin classorg.junit.runner.notification.RunListener- Throws:
Exception
-
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
-
resolveItemListenerMode
-
removeItems
-
prepareItem
- Throws:
ConsistencyCheckException
-
entityCreated
- Specified by:
entityCreatedin interfacePersistencePool.PersistenceListener
-
transactionsSupported
protected boolean transactionsSupported()
-