public class DatabaseTestcase extends Object implements InjectionProvider<Object>
EntityManager,
EntityManagerFactory and EntityTransaction.InjectionProvider,
DBOperation| Constructor and Description |
|---|
DatabaseTestcase()
Creates an instance of
DatabaseTestcase with the global
configured persistence unit name and the global configured
DBOperation. |
DatabaseTestcase(Class<?>... clazzes)
Deprecated.
|
DatabaseTestcase(DBOperation dbOperation)
Creates an instance of
DatabaseTestcase with the global
configured persistence unit name and overrides the global configured
DBOperation with the given database operation. |
DatabaseTestcase(DBOperation dbOperation,
Class<?>... clazzes)
Deprecated.
|
DatabaseTestcase(String persistenceUnitName)
Creates an instance of
DatabaseTestcase with the given
persistence unit name and the global configured DBOperation. |
DatabaseTestcase(String persistenceUnitName,
DBOperation dbOperation)
Creates an instance of
DatabaseTestcase with the given
persistence unit name and overrides the global configured
DBOperation with the given database operation. |
| Modifier and Type | Method and Description |
|---|---|
javax.persistence.EntityManager |
getEntityManager()
Returns the
EntityManager. |
javax.persistence.EntityManagerFactory |
getEntityManagerFactory()
Returns the
EntityManagerFactory. |
Object |
getInjectedObject(Class<?> injectionPointType)
Provides an instance of
T. |
Object |
getKey(InjectionTargetInformation injectionTargetInformation)
Returns a key object, which identifies the provided object.
|
TransactionHelper |
getTransactionHelper()
Returns an instance of
TransactionHelper |
boolean |
verify(InjectionTargetInformation injectionTargetInformation)
Verifies the injection target.
|
public DatabaseTestcase()
DatabaseTestcase with the global
configured persistence unit name and the global configured
DBOperation.DBOperationpublic DatabaseTestcase(DBOperation dbOperation)
DatabaseTestcase with the global
configured persistence unit name and overrides the global configured
DBOperation with the given database operation.dbOperation - database operation to execute on test setup and tear downDBOperationpublic DatabaseTestcase(String persistenceUnitName)
DatabaseTestcase with the given
persistence unit name and the global configured DBOperation.persistenceUnitName - the name of the persistence unitDBOperationpublic DatabaseTestcase(String persistenceUnitName, DBOperation dbOperation)
DatabaseTestcase with the given
persistence unit name and overrides the global configured
DBOperation with the given database operation.persistenceUnitName - the name of the persistence unitdbOperation - database operation to execute on test setup and tear downDBOperation@Deprecated public DatabaseTestcase(Class<?>... clazzes)
DatabaseTestcase for the given entity
classes by using the configured hibernate specific configuration file
(*cfg.xml) and use the global configured DBOperation.clazzes - the entity classesDBOperation@Deprecated public DatabaseTestcase(DBOperation dbOperation, Class<?>... clazzes)
DatabaseTestcase for the given entity
classes by using the configured hibernate specific configuration file
(*cfg.xml) and overrides the global configured DBOperation with
the give database operation.dbOperation - database operation to execute on test setup and tear downclazzes - the entity classesDBOperationpublic javax.persistence.EntityManager getEntityManager()
EntityManager.EntityManager.public javax.persistence.EntityManagerFactory getEntityManagerFactory()
EntityManagerFactory.EntityManagerFactory.public TransactionHelper getTransactionHelper()
TransactionHelperTransactionHelperTransactionHelperpublic Object getInjectedObject(Class<?> injectionPointType)
InjectionProviderT.getInjectedObject in interface InjectionProvider<Object>injectionPointType - the type of the injection target.Tpublic boolean verify(InjectionTargetInformation injectionTargetInformation)
InjectionVerifierverify in interface InjectionVerifierinjectionTargetInformation - information about the injection pointpublic Object getKey(InjectionTargetInformation injectionTargetInformation)
InjectionProvidergetKey in interface InjectionProvider<Object>injectionTargetInformation - information about the injection pointNeedleTestcase.getInjectedObject(Object)Copyright © 2014. All rights reserved.