|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.groboutils.junit.v1.iftc.CxFactory
Helper abstract class that aids in the setting of a unique and distinguishable name for a test case's factory.
As of 08-Dec-2002, the original constructor will NOT add the owning class's name to the factory toString() output. Since the Ant JUnit report is setup such that the concrete class's tests are organized under it, this is redundant information, and clutters the report.
Constructor Summary | |
CxFactory(java.lang.String name)
Specify a unique identifier for this specific factory within the context of the concrete test that is providing the factory. |
|
CxFactory(java.lang.String name,
boolean addClassName)
Specify a unique identifier for this specific factory within the context of the concrete test that is providing the factory. |
Method Summary | |
abstract java.lang.Object |
createImplObject()
Create a new instance of the interface type for testing through an InterfaceTest. |
void |
tearDown(java.lang.Object implObject)
Most factories have no need for a tearDown method, so a default (do-nothing) implementation has been provided here. |
java.lang.String |
toString()
Override the Java-default toString, and provide our distinguishable name. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public CxFactory(java.lang.String name)
name
- the unique identifier within the context of the
factory's owning test class. This cannot be null.
java.lang.IllegalArgumentException
- thrown if name
is null.public CxFactory(java.lang.String name, boolean addClassName)
name
- the unique identifier within the context of the
factory's owning test class. This cannot be null.addClassName
- true if the owning class's name should
be added to the id, and false if the name should be
the ID itself.
java.lang.IllegalArgumentException
- thrown if name
is null.Method Detail |
public java.lang.String toString()
toString
in interface ImplFactory
public void tearDown(java.lang.Object implObject) throws java.lang.Exception
tearDown
in interface ICxFactory
implObject
- one of the objects created by this factory.
java.lang.Exception
- can be thrown when the deconstruction fails.
This will not disrupt the remaining objects' tear down
call.public abstract java.lang.Object createImplObject() throws java.lang.Exception
ImplFactory
As of 21-Oct-2002, this method can raise any exception, and it will be correctly caught and reported as a failure by the InterfaceTestCase.createImplObject() method, so that the creation method can simplify its logic, and add any kind of initialization without having to worry about the correct way to handle exceptions.
createImplObject
in interface ImplFactory
java.lang.Exception
- thrown under any unexpected condition that
results in the failure to properly create the instance.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |