|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Allows for tests to be written on interfaces or abstract classes, by creating a specific instance of the interface or abstract class. Test classes will invoke this method to retrieve the specific instance for their tests.
Since October 21, 2002, the createImplObject() method can now throw any exception. Some construction implementations throw all kinds of errors, such as IOException or SQLException. This makes the task of creating factories a bit easier, since we no longer need to worry about proper try/catch blocks.
Method Summary | |
java.lang.Object |
createImplObject()
Create a new instance of the interface type for testing through an InterfaceTest. |
java.lang.String |
toString()
All ImplFactory instances should specify a distinguishable name to help in debugging failed tests due to a particular factory's instance setup. |
Method Detail |
public java.lang.Object createImplObject() throws java.lang.Exception
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.
java.lang.Exception
- thrown under any unexpected condition that
results in the failure to properly create the instance.public java.lang.String toString()
CxFactory: a helper that simplifies this task for us.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |