Class ContextTestCase<C extends Context>

java.lang.Object
org.apache.commons.chain.ContextTestCase<C>
Direct Known Subclasses:
ContextBaseTestCase, ContextBaseTestWeb, TestContextTestCase

public abstract class ContextTestCase<C extends Context> extends Object
Test case for the ContextBase class.
Version:
$Revision$ $Date$
Author:
Craig R. McClanahan
  • Field Details

  • Constructor Details

    • ContextTestCase

      public ContextTestCase()
      The Default-Constructor for this class.
  • Method Details

    • init

      @BeforeEach public void init()
      Set up instance variables required by this test case.
    • tearDown

      @AfterEach public void tearDown()
      Tear down instance variables required by this test case.
    • testAttributes

      @Test public void testAttributes()
      Test ability to get, put, and remove attributes
    • testContains

      @Test public void testContains()
      Test containsKey() and containsValue()
    • testEquals

      @Test public void testEquals()
      Test equals() and hashCode()
    • testKeySet

      @Test public void testKeySet()
      Test keySet()
    • testPristine

      @Test public void testPristine()
      Test state of newly created instance
    • testPutAll

      @Test public void testPutAll()
      Test putAll()
    • testSerialization

      @Test public void testSerialization() throws Exception
      Test serialization
      Throws:
      Exception - any error
    • checkAttributeCount

      protected void checkAttributeCount(int expected)
      Verify the number of defined attributes
      Parameters:
      expected - the expected value
    • expectedAttributeCount

      protected int expectedAttributeCount()
      Return the expected size() for a Context for this test case
      Returns:
      the expected size() for a Context
    • createContext

      protected abstract C createContext()
      Create a new instance of the appropriate Context type for this test case
      Returns:
      the new instance of the appropriate Context type