| java.lang.Object org.springunit.framework.SpringUnitContext
SpringUnitContext | public class SpringUnitContext (Code) | | A bean that holds data for a single SpringUnitTest.
The bean contains a single attribute, data,
that is a map of strings to objects. The string keys
are either the names of tests or arbitrary identifiers
for data values. For keys that name tests,
the corresponding value is itself a map of string keys
to object values.
author: Ted Velkoff |
Method Summary | |
public Map<? extends String, ? extends T> | getData() Test data values associated with a TestCase. | public T | getObject(String key, String fName) | protected T | getObject(String key, String fName, Map<? extends String, ? extends T> map) Find the data value identified by key
in the map by searching first
in the scope of the test (fName ).
If fName is the name of a map
testMap
contained in map , then return
the value in testMap associated
with key . | public void | setData(Map<? extends String, ? extends T> data) |
getData | public Map<? extends String, ? extends T> getData()(Code) | | Test data values associated with a TestCase.
By convention, keys of the form "testXxx"
have associated values of the type
Map extends String, ? extends T>.
All such elements comprise data items
in the scope of the test having the same
name as the key.
Keys of any other form have values of type T,
and represent data in the scope of the test case.
Map extends String, ? extends T> |
getObject | public T getObject(String key, String fName)(Code) | | Find the data value identified by key ,
searching first in the scope of the name
of the test (fName ), then outward
until found or null is returned.
Parameters: key - Identifier of data value to be found Parameters: fName - Name of test in whose scope searchshould begin Object of type T if found, null otherwise |
getObject | protected T getObject(String key, String fName, Map<? extends String, ? extends T> map)(Code) | | Find the data value identified by key
in the map by searching first
in the scope of the test (fName ).
If fName is the name of a map
testMap
contained in map , then return
the value in testMap associated
with key . If there is no
value in testMap associated with
key , then return the value
associated with key in map ,
which could be null .
Parameters: key - Identifier of data value Parameters: fName - Identifier of test; must exactly matchthe name of a test procedure in a SpringUnitTest. Parameters: map - Map of string identifiers to objectswhere the string is either an fName or a key Object of type T if found, otherwise null |
setData | public void setData(Map<? extends String, ? extends T> data)(Code) | | Make data the test data values
associcated with TestCase.
Parameters: data - Data values indexed by string names |
|
|