TestDataProducer Java interface
package au.com.codecanvas.generator.testdataproducer;
/**
* A TestDataProducer produces test data for an attribute.
*/
public interface TestDataProducer {
/**
* Returns the types of data that this can produce.
*
* ie {"java.lang.String"}
*
* @return
*/
public String[] getTypes();
/**
* Returns the names of parameters for this
*
* @return
*/
public String[] getParameterNames();
/**
* Returns the types of parameters for this
*
* @return
*/
public Class[] getParameterTypes();
/**
* Returns the value of the specified parameter
*
* @param name - the name of the parameter
* @return
*/
public Object getParameterValue(String name);
/**
* Set the value of the specified parameter
*
* @param name - the name of the parameter
* @param value - the value of the parameter
*/
public void setParameterValue(String name, Object value);
/**
* Begin data production.
*
* This is called before each use of the producer.
*/
public void begin();
/**
* End data production.
*
* This is called after every use of the producer.
*/
public void end();
/**
* Returns true if this has more data for the specified attribute.
*
* This can be called many times after begin() is called and before end() is called.
*
* @param attribute
* @return
*/
public boolean hasMoreData(TestDataAttribute attribute);
/**
* Returns the next data value for the last Attribute that hasMoreData()
* last returned true for.
*
* @return
*/
public Object getData();
/**
* Returns the producer name.
*
* @return
*/
public String getName();
/**
* Returns the description.
*
* @return
*/
public String getDescription();
}