|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.akquinet.jbosscc.needle.db.DatabaseTestcase
public class DatabaseTestcase
Base class for a database test case. Execute optional database operation on
test setup and tear down.
May used as injection provider for EntityManager and
EntityManagerFactory.
InjectionProvider,
DBOperation| Constructor Summary | |
|---|---|
DatabaseTestcase()
Create an instance of DatabaseTestcase with the global configured
persistence unit name and the global configured DBOperation. |
|
DatabaseTestcase(Class<?>... clazzes)
Create an instance of DatabaseTestcase for the given entity
classes by using the configured hibernate specific configuration file
(*cfg.xml) and use the global configured DBOperation. |
|
DatabaseTestcase(DBOperation dbOperation)
Create an instance of DatabaseTestcase with the global configured
persistence unit name and override the global configured
DBOperation with the give database operation. |
|
DatabaseTestcase(DBOperation dbOperation,
Class<?>... clazzes)
Create an instance of DatabaseTestcase for the given entity
classes by using the configured hibernate specific configuration file
(*cfg.xml) and override the global configured DBOperation with
the give database operation. |
|
DatabaseTestcase(String persistenceUnitName)
Create an instance of DatabaseTestcase with the given persistence
unit name and the global configured DBOperation. |
|
DatabaseTestcase(String persistenceUnitName,
DBOperation dbOperation)
Create an instance of DatabaseTestcase with the given persistence
unit name and override the global configured DBOperation with the
give database operation. |
|
| Method Summary | |
|---|---|
protected void |
after()
Execute tear down database operation, if configured. |
protected void |
before()
Execute setup database operation, if configured. |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
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 override the global configured
DBOperation with the give 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 unitDBOperation
public DatabaseTestcase(String persistenceUnitName,
DBOperation dbOperation)
DatabaseTestcase with the given persistence
unit name and override the global configured DBOperation with the
give database operation.
persistenceUnitName - the name of the persistence unitdbOperation - database operation to execute on test setup and tear downDBOperationpublic 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
public DatabaseTestcase(DBOperation dbOperation,
Class<?>... clazzes)
DatabaseTestcase for the given entity
classes by using the configured hibernate specific configuration file
(*cfg.xml) and override the global configured DBOperation with
the give database operation.
dbOperation - database operation to execute on test setup and tear downclazzes - the entity classesDBOperation| Method Detail |
|---|
protected void after()
throws Exception
Exception - thrown if an error occurs
protected void before()
throws Exception
Exception - thrown if an error occurspublic javax.persistence.EntityManager getEntityManager()
EntityManager.
EntityManager.public javax.persistence.EntityManagerFactory getEntityManagerFactory()
EntityManagerFactory.
EntityManagerFactory.public TransactionHelper getTransactionHelper()
TransactionHelper
TransactionHelperTransactionHelperpublic Object getInjectedObject(Class<?> injectionPointType)
InjectionProviderT.
getInjectedObject in interface InjectionProvider<Object>injectionPointType - the type of the injection target.
Tpublic boolean verify(InjectionTargetInformation injectionTargetInformation)
InjectionProvider
verify in interface InjectionProvider<Object>injectionTargetInformation - information about the injection point
public Object getKey(InjectionTargetInformation injectionTargetInformation)
InjectionProvider
getKey in interface InjectionProvider<Object>injectionTargetInformation - information about the injection point
NeedleTestcase.getInjectedObject(Object)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||