org.softsmithy.devlib.junit
Class AbstractJPATest<T extends DbInitializer>

java.lang.Object
  extended by org.softsmithy.devlib.junit.AbstractJPATest<T>

public abstract class AbstractJPATest<T extends DbInitializer>
extends Object

Author:
puce

Constructor Summary
AbstractJPATest()
           
 
Method Summary
protected  void clearDb()
           
protected abstract  T createNewDbInitializer()
           
 T getDbInitializer()
           
protected  EntityManager getEntityManager()
           
protected  EntityManagerFactory getEntityManagerFactory()
           
protected abstract  String getPersistenceUnitName()
           
protected  void initDb()
           
protected  void newTransaction()
           
 void setUp()
           
protected  void setUpBeforeInitDb()
           
static void setUpClass()
           
 void tearDown()
           
protected  void tearDownAfterClearDb()
           
static void tearDownClass()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractJPATest

public AbstractJPATest()
Method Detail

setUpClass

public static void setUpClass()
                       throws Exception
Throws:
Exception

tearDownClass

public static void tearDownClass()
                          throws Exception
Throws:
Exception

setUp

public void setUp()
           throws Exception
Throws:
Exception

setUpBeforeInitDb

protected void setUpBeforeInitDb()

tearDown

public void tearDown()
              throws Exception
Throws:
Exception

tearDownAfterClearDb

protected void tearDownAfterClearDb()

getPersistenceUnitName

protected abstract String getPersistenceUnitName()

createNewDbInitializer

protected abstract T createNewDbInitializer()

initDb

protected void initDb()

clearDb

protected void clearDb()
                throws Exception
Throws:
Exception

getDbInitializer

public T getDbInitializer()
Returns:
the dbInitializer

getEntityManager

protected EntityManager getEntityManager()

getEntityManagerFactory

protected EntityManagerFactory getEntityManagerFactory()

newTransaction

protected void newTransaction()


Copyright © 2010-2011 SoftSmithy. All Rights Reserved.