org.baselinetest
Class TestState

java.lang.Object
  extended by org.baselinetest.TestState

public class TestState
extends java.lang.Object

A mutable state passing mechanism between test cases. Things like database connections or application state can be passed using this mechanism unlike arguments which are immutable.

Author:
jwan, jsnyder2

Method Summary
 java.lang.Object get(java.lang.String name)
          Obtain the TestState value for the given name.
 java.lang.Object getSubstitution(java.lang.String category, java.lang.Object object)
           
 java.util.Iterator<java.util.Map.Entry<java.lang.String,java.lang.Object>> iterator()
          Return an iterator to the entries contained within the TestState.
 java.lang.Object put(java.lang.String name, java.lang.Object value)
          Put the name-object pair into the TestState.
 java.lang.Object setSubstitution(java.lang.String category, java.lang.String substitution, java.lang.Object object)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

get

public java.lang.Object get(java.lang.String name)
Obtain the TestState value for the given name.

Parameters:
name -
Returns:
the value associated with the given name, or null if there is no object.

put

public java.lang.Object put(java.lang.String name,
                            java.lang.Object value)
Put the name-object pair into the TestState.

Parameters:
name - the name.
value - the value.
Returns:
the old value associated with the given name, or null if there is no object.

getSubstitution

public java.lang.Object getSubstitution(java.lang.String category,
                                        java.lang.Object object)

setSubstitution

public java.lang.Object setSubstitution(java.lang.String category,
                                        java.lang.String substitution,
                                        java.lang.Object object)

iterator

public java.util.Iterator<java.util.Map.Entry<java.lang.String,java.lang.Object>> iterator()
Return an iterator to the entries contained within the TestState.

Returns:
an Iterator of java.util.Map.Entry objects.


Copyright © 2005-2009 Baseline Test. All Rights Reserved.