public interface DataProvider
| Modifier and Type | Method and Description |
|---|---|
void |
dispose()
free the allocated resources
|
Object |
generate(String pattern)
generates a random string dynamically.
|
Object |
generate(String pattern,
Class<?> clazz)
Random generator uses a pattern to generate a random
sequence based on given pattern.
|
Object |
get(Class<?> dataTypeName,
String name,
String componentName)
Gets data value by the specified parameters
|
Object |
get(Class<?> dataTypeName,
String name,
String componentName,
int sequenceNumber,
boolean isMultivalue)
Gets data value by the specified parameters
|
Object |
get(String name)
Acquire a property value for given name
|
Object |
get(String name,
int sequenceNumber)
Aquire a property value marked with given iteration,
for example i1.testProperty
|
Set<Attribute> |
getAttributeSet(String propertySetName)
converts the given property submap to Attribute set.
|
Object |
getConnectorAttribute(String propName)
Gets data value by the specified parameters
|
String |
getString(String name,
String componentName)
Gets data value by the specified parameters
|
String |
getString(String name,
String componentName,
int sequenceNumber)
Gets data value by the specified parameters
|
Object |
getTestSuiteAttribute(String propName)
Gets test suite attribute
|
Object |
getTestSuiteAttribute(String propName,
String testName)
Gets test suite attribute
|
void |
loadConfiguration(String propertyName,
Configuration cfg)
adds to 'cfg' the complete map defined by property 'propertyName'
|
Object get(Class<?> dataTypeName, String name, String componentName, int sequenceNumber, boolean isMultivalue)
dataTypeName - name - componentName - sequenceNumber - isMultivalue - switch between single and multivalue queryObjectNotFoundExceptionObject get(Class<?> dataTypeName, String name, String componentName)
dataTypeName - name - componentName - ObjectNotFoundExceptionString getString(String name, String componentName, int sequenceNumber)
name - componentName - sequenceNumber - ObjectNotFoundExceptionString getString(String name, String componentName)
name - componentName - ObjectNotFoundExceptionObject getConnectorAttribute(String propName)
propName - ObjectNotFoundExceptionObject getTestSuiteAttribute(String propName)
propName - ObjectNotFoundExceptionObject getTestSuiteAttribute(String propName, String testName)
propName - ObjectNotFoundExceptionObject get(String name, int sequenceNumber)
name - the suffixsequenceNumber - Object generate(String pattern, Class<?> clazz)
Random generator uses a pattern to generate a random sequence based on given pattern.
the supported characters are (can appear in pattern string):
Any other character inside the pattern is directly printed to the output.
Backslash is used to escape any character. For instance pattern "###\\.##" prints a floating point random number
pattern - the pattern for generationclazz - the type of returned random objectObject generate(String pattern)
generate(String, Class)void loadConfiguration(String propertyName, Configuration cfg)
propertyName - the name of property which represents the submap that will be
converted to configurationcfg - the configuration that will be updated by information from
property 'propertyName'
Sample usage:
static final String DEFAULT_CONFIGURATINON = "configuration.init"
// attempt to create the database in the directory..
config = new ConnectorConfiguration();
// LOAD THE submap in 'configuration' prefix to 'config' object.
dataProvider.loadConfiguration(DEFAULT_CONFIGURATINON, config);
//////// The groovy configuration
// account configurations
configuration{
init.driver="foo"
init.hostName="bar"
init.port="boo"
}
NoSuchMethodException - the Setter method for the property in the configuration does not existIllegalAccessExceptionInvocationTargetExceptionSecurityExceptionSet<Attribute> getAttributeSet(String propertySetName)
propertySetName - the property that marks the submap for conversion.Sample usage:
createAttrs = dataProvider.getAttributeSet("account.create");
//////// The groovy configuration
// account sets
account{
create.driver="foo"
create.hostName="bar"
create.port="boo"
update.driver="foo2"
update.hostName="bar2"
update.port="boo2"
}
void dispose()
Copyright © 2022. All rights reserved.