net.sourceforge.groboutils.junit.v1.iftc
Interface ICxFactory

All Superinterfaces:
ImplFactory
All Known Implementing Classes:
CxFactory

public interface ICxFactory
extends ImplFactory

An ICxFactory is an extension of ImplFactory that has provisions for cleaning up generated objects on test tear down. Generated objects could either have a finalize() method (not recommended, especially for tests), or the factory could implement this interface to allow proper, timely clean-up.

The clean-up is performed by InterfaceTestCase in the tearDown() method. If the hierarchy tests do not use this, but instead use a variation of junit.framework.Test, then they will need to implement their own tearDown() functionality.

A valid alternative is to use Mock-Objects (www.mockobjects.org), which would not need to be cleaned up like "live" objects do.

Since:
October 30, 2002
Version:
$Date: 2003/02/10 22:52:20 $
Author:
Matt Albrecht groboclown@users.sourceforge.net

Method Summary
 void tearDown(java.lang.Object implObject)
          Allows the implementation to clean-up the instantiated object.
 
Methods inherited from interface net.sourceforge.groboutils.junit.v1.iftc.ImplFactory
createImplObject, toString
 

Method Detail

tearDown

public void tearDown(java.lang.Object implObject)
              throws java.lang.Exception
Allows the implementation to clean-up the instantiated object. implObject is guaranteed to have been generated by this exact factory. Each object generated by this specific factory will be passed to this method on the test's tearDown() method, in the reverse order that they were created.

Parameters:
implObject - one of the objects created by this factory.
Throws:
java.lang.Exception - can be thrown when the deconstruction fails. This will not disrupt the remaining objects' tear down call.


Copyright © 2001-2003 by The GroboUtils Project