Package com.avoka.fc.core.test
Class CayenneTestCase
java.lang.Object
junit.framework.Assert
junit.framework.TestCase
com.avoka.fc.core.test.CayenneTestCase
- All Implemented Interfaces:
junit.framework.Test
- Direct Known Subclasses:
H2TestCase
public class CayenneTestCase
extends junit.framework.TestCase
Provides a Cayenne JUnit TestCase which will initialize a new thread local
DataContext for each executed test.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidassertDateEquals(Date expected, Date actual) Assert the dates are equal ignoring any time differences.org.apache.cayenne.access.DataContextReturn the thread local DataContext.protected voidsetUp()This method is called before a test is executed, creating a DataContext and associating it to the current Thread.protected voidtearDown()This method is called after a test is executed, removing the DataContext from the Thread.Methods inherited from class junit.framework.TestCase
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, toString
-
Constructor Details
-
CayenneTestCase
public CayenneTestCase()
-
-
Method Details
-
getDataContext
public org.apache.cayenne.access.DataContext getDataContext()Return the thread local DataContext.- Returns:
- the thread local DataContexts
-
setUp
This method is called before a test is executed, creating a DataContext and associating it to the current Thread.- Overrides:
setUpin classjunit.framework.TestCase- Throws:
Exception- See Also:
-
tearDown
This method is called after a test is executed, removing the DataContext from the Thread.- Overrides:
tearDownin classjunit.framework.TestCase- Throws:
Exception- See Also:
-
assertDateEquals
Assert the dates are equal ignoring any time differences.- Parameters:
expected- the expected dateactual- the actual date
-