|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object junit.framework.Assert junit.framework.TestCase org.callbackparams.junit3.CallbackTestCase
public abstract class CallbackTestCase
Parameterized tests for JUnit-3.8.x can be created by subclassing this class
instead of TestCase
.
Upgrade to JUnit-4.x and usage of
CallbackParamsRunner
is strongly recommended! However, that does not necessarily mean quit
using the JUnit-3.x API since JUnit-4.x is backward compatible and
CallbackParamsRunner
also can run JUnit-3.x tests.
Thou somewhat ugly, having the test-class subclass this class does not
conflict with using
CallbackParamsRunner
to run the test. The only differences would be occasionally better
performance and that only
@ParameterizedCallback
-annotated
fields are callback-injected while the alternative combine API that is
unlocked by overriding
getCallbackRecords()
or getCallbackRecordsFactory()
would still be available.
Constructor Summary | |
---|---|
protected |
CallbackTestCase()
|
protected |
CallbackTestCase(String name)
|
Method Summary | |
---|---|
int |
countTestCases()
|
protected Collection |
getCallbackRecords()
Returns a collection of callback-records, i.e. |
protected CallbackRecordsFactory |
getCallbackRecordsFactory()
Returns the CallbackRecordsFactory instance that will be used
by the default implementation of
getCallbackRecords() to create the callback-records. |
void |
run(junit.framework.TestResult result)
|
void |
testSpecialDummyTestMethodThatIsUsedToTrickJunitOnly()
Dummy test-method that does nothing. |
Methods inherited from class junit.framework.TestCase |
---|
createResult, getName, run, runBare, runTest, setName, setUp, tearDown, toString |
Methods inherited from class junit.framework.Assert |
---|
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, fail, fail, failNotEquals, failNotSame, failSame, format |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected CallbackTestCase(String name)
protected CallbackTestCase()
Method Detail |
---|
public final void testSpecialDummyTestMethodThatIsUsedToTrickJunitOnly()
public void run(junit.framework.TestResult result)
run
in interface junit.framework.Test
run
in class junit.framework.TestCase
public int countTestCases()
countTestCases
in interface junit.framework.Test
countTestCases
in class junit.framework.TestCase
protected Collection getCallbackRecords()
CallbackRecordsFactory
supplied by the overridable method
getCallbackRecordsFactory()
to create the callback-records.
@CallbackRecords
.
@CallbackRecords
protected CallbackRecordsFactory getCallbackRecordsFactory()
CallbackRecordsFactory
instance that will be used
by the default implementation of
getCallbackRecords()
to create the callback-records.
The default CallbackRecordsFactory instance returned is the one supplied
by the factory method CallbackRecordsFactory.getInstance()
. If
this default factory won't fit your purposes you can
override this method.
CallbackRecordsFactory.retrieveCombineStrategy(Class)
and let
it return a CombineCompletely
instance instead of the default
CombineAllPossible2Combinations
instance.
@CombineConfig
.
An interesting JDK-1.4 oppertunity is to override
CallbackRecordsFactory.isCallbackValuesFactoryClass(java.lang.Class)
and
CallbackRecordsFactory.retrieveCombinedArray(java.lang.Class)
,
e.g. to make it recognize Enum-classes a'la commons-lang ...
CallbackRecordsFactory.retrieveCombineStrategy(java.lang.Class)
,
CallbackRecordsFactory.retrieveCombinedArray(java.lang.Class)
,
CallbackRecordsFactory.isCallbackValuesFactoryClass(java.lang.Class)
,
CombineStrategy
,
@CombineConfig
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |