org.progeeks.junit
Class DefaultTestContext

java.lang.Object
  extended by org.progeeks.util.beans.BeanChangeSupport
      extended by org.progeeks.util.beans.PropertyHolder
          extended by org.progeeks.junit.DefaultTestContext
All Implemented Interfaces:
java.io.Serializable, TestContext, StandardBean

public class DefaultTestContext
extends PropertyHolder
implements TestContext

Default implementation of the TestContext interface. When used with a DefaultTestFixture, can be used to access stored org.progeeks.tools.gen.DataGenerators to create data to feed to objects under test, or the objects to test themselves.

Version:
$Revision: 1.7 $
Author:
Paul Wisneskey, Eric Sword
See Also:
Serialized Form

Field Summary
static java.lang.String PROP_DESCRIPTION
           
static java.lang.String PROP_TEST_FIXTURE
           
 
Constructor Summary
DefaultTestContext()
           
 
Method Summary
 java.lang.String getDescription()
          Brief description of the key traits of this context.
 DataGenerator getGenerator(java.lang.String key)
          Returns the dataGenerator in the fixture map for the given key.
 DataGenerator getGeneratorForClass(java.lang.String className)
          Returns the first generator that produces the given Java class or MetaClass
 TestFixture getTestFixture()
          Returns the test fixture that can be used to set up and tear down this context.
 void setDescription(java.lang.String desc)
           
 void setTestFixture(TestFixture testFixture)
          Set the test fixture for setting up and tearing down this context.
 
Methods inherited from class org.progeeks.util.beans.PropertyHolder
getBooleanProperty, getDoubleProperty, getFloatProperty, getIntProperty, getLongProperty, getObjectProperty, getObjectProperty, getStringProperty, setBooleanProperty, setDoubleProperty, setFloatProperty, setIntProperty, setLongProperty, setObjectProperty, setStringProperty
 
Methods inherited from class org.progeeks.util.beans.BeanChangeSupport
addPropertyChangeListener, addPropertyChangeListener, clearAllListeners, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, hasListeners, hasListeners, removePropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.progeeks.util.beans.StandardBean
addPropertyChangeListener, addPropertyChangeListener, hasListeners, hasListeners, removePropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener
 

Field Detail

PROP_TEST_FIXTURE

public static final java.lang.String PROP_TEST_FIXTURE
See Also:
Constant Field Values

PROP_DESCRIPTION

public static final java.lang.String PROP_DESCRIPTION
See Also:
Constant Field Values
Constructor Detail

DefaultTestContext

public DefaultTestContext()
Method Detail

getGenerator

public DataGenerator getGenerator(java.lang.String key)
Returns the dataGenerator in the fixture map for the given key.


getGeneratorForClass

public DataGenerator getGeneratorForClass(java.lang.String className)
Returns the first generator that produces the given Java class or MetaClass

Parameters:
className -

getTestFixture

public TestFixture getTestFixture()
Description copied from interface: TestContext
Returns the test fixture that can be used to set up and tear down this context.

Specified by:
getTestFixture in interface TestContext

setTestFixture

public void setTestFixture(TestFixture testFixture)
Description copied from interface: TestContext
Set the test fixture for setting up and tearing down this context.

Specified by:
setTestFixture in interface TestContext

getDescription

public java.lang.String getDescription()
Description copied from interface: TestContext
Brief description of the key traits of this context. Used by ContextualTestCase when showing where an error occurred.

Specified by:
getDescription in interface TestContext
Returns:
Returns the description string. If no description was set, returns the empty string.

setDescription

public void setDescription(java.lang.String desc)
Specified by:
setDescription in interface TestContext
Parameters:
desc - The desc to set.


Copyright © 2002-2003 Paul Speed. All Rights Reserved.