Package org.apache.commons.chain
Class ContextTestCase<C extends Context>
java.lang.Object
org.apache.commons.chain.ContextTestCase<C>
- Direct Known Subclasses:
ContextBaseTestCase,ContextBaseTestWeb,TestContextTestCase
Test case for the
ContextBase class.- Version:
- $Revision$ $Date$
- Author:
- Craig R. McClanahan
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckAttributeCount(int expected) Verify the number of defined attributesprotected abstract CCreate a new instance of the appropriate Context type for this test caseprotected intReturn the expectedsize()for a Context for this test casevoidinit()Set up instance variables required by this test case.voidtearDown()Tear down instance variables required by this test case.voidTest ability to get, put, and remove attributesvoidTestcontainsKey()andcontainsValue()voidTestequals()andhashCode()voidTestkeySet()voidTest state of newly created instancevoidTestputAll()voidTest serialization
-
Field Details
-
context
TheContextinstance under test.
-
-
Constructor Details
-
ContextTestCase
public ContextTestCase()The Default-Constructor for this class.
-
-
Method Details
-
init
Set up instance variables required by this test case. -
tearDown
Tear down instance variables required by this test case. -
testAttributes
Test ability to get, put, and remove attributes -
testContains
TestcontainsKey()andcontainsValue() -
testEquals
Testequals()andhashCode() -
testKeySet
TestkeySet() -
testPristine
Test state of newly created instance -
testPutAll
TestputAll() -
testSerialization
Test serialization- Throws:
Exception- any error
-
checkAttributeCount
Verify the number of defined attributes- Parameters:
expected- the expected value
-
expectedAttributeCount
Return the expectedsize()for a Context for this test case- Returns:
- the expected
size()for a Context
-
createContext
Create a new instance of the appropriate Context type for this test case- Returns:
- the new instance of the appropriate Context type
-