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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    assertDateEquals(Date expected, Date actual)
    Assert the dates are equal ignoring any time differences.
    org.apache.cayenne.access.DataContext
    Return the thread local DataContext.
    protected void
    This method is called before a test is executed, creating a DataContext and associating it to the current Thread.
    protected void
    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • 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

      protected void setUp() throws Exception
      This method is called before a test is executed, creating a DataContext and associating it to the current Thread.
      Overrides:
      setUp in class junit.framework.TestCase
      Throws:
      Exception
      See Also:
      • TestCase.setUp()
    • tearDown

      protected void tearDown() throws Exception
      This method is called after a test is executed, removing the DataContext from the Thread.
      Overrides:
      tearDown in class junit.framework.TestCase
      Throws:
      Exception
      See Also:
      • TestCase.tearDown()
    • assertDateEquals

      public void assertDateEquals(Date expected, Date actual)
      Assert the dates are equal ignoring any time differences.
      Parameters:
      expected - the expected date
      actual - the actual date