public class ItemCreationListener extends 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!| Constructor and Description |
|---|
ItemCreationListener() |
| Modifier and Type | Method and Description |
|---|---|
void |
entityCreated(PK pk) |
protected void |
prepareItem(Item item) |
protected void |
removeItems(Collection<PK> pks) |
void |
testFinished(Description description)
Removes all items registered at the item registry.
|
void |
testStarted(Description description) |
protected boolean |
transactionsSupported() |
public void testFinished(Description description)
throws Exception
Exceptionprotected void removeItems(Collection<PK> pks)
protected void prepareItem(Item item) throws ConsistencyCheckException
ConsistencyCheckExceptionpublic void entityCreated(PK pk)
entityCreated in interface PersistencePool.PersistenceListenerprotected boolean transactionsSupported()
Copyright © 2017 SAP SE. All Rights Reserved.