org.sysunit
Class FactoryMethodTBeanFactory

java.lang.Object
  extended by org.sysunit.FactoryMethodTBeanFactory
All Implemented Interfaces:
TBeanFactory

public class FactoryMethodTBeanFactory
extends Object
implements TBeanFactory

TBeanFactory implementation which uses a factory method to construct TBeans.

This uses the Factory Method pattern to create TBean instances. By using a no argument method that returns a TBean, the TBeans can be consistently recreated in either a local or distributed environment.

Version:
$Id: FactoryMethodTBeanFactory.java,v 1.1 2003/06/04 04:27:19 werken Exp $
Author:
Bob McWhirter
See Also:
TBean

Field Summary
 
Fields inherited from interface org.sysunit.TBeanFactory
EMPTY_ARRAY
 
Constructor Summary
FactoryMethodTBeanFactory(SystemTestCase testCase, Method factoryMethod)
          Construct.
 
Method Summary
 Method getFactoryMethod()
          Retrieve the TBean factory Method.
 SystemTestCase getTestCase()
          Retrieve the SystemTestCase.
 TBean newTBean()
          Create a new TBean.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FactoryMethodTBeanFactory

public FactoryMethodTBeanFactory(SystemTestCase testCase,
                                 Method factoryMethod)
Construct.

Parameters:
testCase - The test-case.
factoryMethod - The TBean factory method.
Method Detail

getTestCase

public SystemTestCase getTestCase()
Retrieve the SystemTestCase.

Returns:
The test-case.

getFactoryMethod

public Method getFactoryMethod()
Retrieve the TBean factory Method.

Returns:
The factory method.

newTBean

public TBean newTBean()
               throws Exception
Description copied from interface: TBeanFactory
Create a new TBean.

Specified by:
newTBean in interface TBeanFactory
Returns:
The newly created TBean.
Throws:
Exception - If an error occurs while attempting to create the TBean.
See Also:
TBeanFactory


Copyright © 2003-2009 SpritSoft, Inc.. All Rights Reserved.