Package com.avoka.fc.core.test.junit4
Class H2Test
- java.lang.Object
-
- com.avoka.fc.core.test.junit4.H2Test
-
public abstract class H2Test extends Object
Provides an in-memory H2 Test Case. Supports JUnit 4.8.1 Annotations- Since:
- 17.10.0
-
-
Constructor Summary
Constructors Constructor Description H2Test()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
getCayenneDomainLocation()
static org.apache.cayenne.access.DataContext
getDataContext()
Return the thread local DataContext.protected String[]
getDataSourceJndiNames()
protected String
getDataSourcePassword()
protected String
getDataSourceUrl()
protected String
getDataSourceUser()
protected void
initDatabaseSchema(org.apache.cayenne.access.DataNode dataNode, org.apache.cayenne.map.DataMap dataMap)
Create the demonstration database schema using the given Cayenne DataNode and DataMap.protected void
loadTestData()
protected void
resetRemoteUser(Portal portal, UserAccount userAccount)
void
setUp()
This method is called before a test is executed, creating a DataContext and associating it to the current Thread.protected void
setupDataSource()
Set up the test case data source.void
tearDownAfterEachTest()
Tear down after each test.
-
-
-
Method Detail
-
setUp
public void setUp() throws Exception
This method is called before a test is executed, creating a DataContext and associating it to the current Thread.- Throws:
Exception
- if an error occurs- See Also:
TestCase.setUp()
-
tearDownAfterEachTest
public void tearDownAfterEachTest() throws Exception
Tear down after each test.- Throws:
Exception
- if an error occurs
-
getDataContext
public static org.apache.cayenne.access.DataContext getDataContext()
Return the thread local DataContext.- Returns:
- the thread local DataContexts
-
setupDataSource
protected void setupDataSource() throws Exception
Set up the test case data source.- Throws:
Exception
- if an error occurs
-
initDatabaseSchema
protected void initDatabaseSchema(org.apache.cayenne.access.DataNode dataNode, org.apache.cayenne.map.DataMap dataMap) throws Exception
Create the demonstration database schema using the given Cayenne DataNode and DataMap.- Parameters:
dataNode
- the Cayenne DataNodedataMap
- the Cayenne DataMap- Throws:
Exception
-
getCayenneDomainLocation
protected String getCayenneDomainLocation()
-
getDataSourceUrl
protected String getDataSourceUrl()
-
getDataSourceUser
protected String getDataSourceUser()
-
getDataSourcePassword
protected String getDataSourcePassword()
-
getDataSourceJndiNames
protected String[] getDataSourceJndiNames()
-
resetRemoteUser
protected void resetRemoteUser(Portal portal, UserAccount userAccount)
-
-