junitx.ddtunit.data
Class DDTDataRepository

java.lang.Object
  extended by junitx.ddtunit.data.DataSet
      extended by junitx.ddtunit.data.DDTDataRepository
All Implemented Interfaces:
IDataSet

public class DDTDataRepository
extends DataSet

Data repository containing test data per test class.
Implementation as singleton.

Author:
jg

Field Summary
 
Fields inherited from class junitx.ddtunit.data.DataSet
objectMap
 
Method Summary
 boolean containsKey(String classId)
          Check existance of testdata concerning provided class data.
 Set entrySet()
           
static Object find(IDataSet dataSet, SearchCriteria searchedData)
          Find associated object data associated to specified search criteria.
 TestClusterDataSet get(String resource, String clusterId)
          Get TestClusterDataSet associated to the specified method of a class.
static DDTDataRepository getInstance()
           
 void put(String classId, IDataSet dataSet)
          Add TestClusterDataSetto repository.
 IDataSet restore(String resource, String clusterId)
          Restore test object definition from provided xml resource
 int size()
          Retrieve number of sub datasets
 
Methods inherited from class junitx.ddtunit.data.DataSet
findObject, findObject, get, getId, getObject, getObject, getSubDataIterator, getSubDataValues, putObject, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getInstance

public static DDTDataRepository getInstance()
Returns:
DDTDataRepository as singleton

containsKey

public boolean containsKey(String classId)
Check existance of testdata concerning provided class data.

Specified by:
containsKey in interface IDataSet
Overrides:
containsKey in class DataSet
Parameters:
classId - of class data used for test
Returns:
true if data is found

put

public void put(String classId,
                IDataSet dataSet)
Add TestClusterDataSetto repository.

Specified by:
put in interface IDataSet
Overrides:
put in class DataSet
Parameters:
classId -
dataSet -

get

public TestClusterDataSet get(String resource,
                              String clusterId)
Get TestClusterDataSet associated to the specified method of a class.

Parameters:
resource - name of resource of test class data
clusterId - to identify dataSet used unter test
Returns:
DataSet to process

restore

public IDataSet restore(String resource,
                        String clusterId)
Restore test object definition from provided xml resource

Parameters:
resource - name of xml file
clusterId - specifiing the testdata cluster to process from within xml resource

find

public static Object find(IDataSet dataSet,
                          SearchCriteria searchedData)
Find associated object data associated to specified search criteria.

Parameters:
dataSet - to search in
searchCriteria -
Returns:

size

public int size()
Description copied from interface: IDataSet
Retrieve number of sub datasets

Specified by:
size in interface IDataSet
Overrides:
size in class DataSet
Returns:
number of entries in repository

entrySet

public Set entrySet()


Copyright © 2004-2011. All Rights Reserved.