public class Configuration extends Object
Test configuration used to customize testing for a single JavaBean type. Configuration
objects are only required when you want to customize the testing behaviour. Most often the standard testing behaviour
will be sufficient.
Configuration objects should be created using a ConfigurationBuilder
.
Configuration objects can be passed to BeanTester.test(Class<?>,Configuration);
for use as a one-off, or
registered with the BeanTester for use thereafter:
BeanTester.addCustomConfiguration(Class<?>,Configuration);
.
The following can be configured/customized:
BeanTesterBuilder
Modifier and Type | Method and Description |
---|---|
Integer |
getIterations()
Get the number of times a type should be tested.
|
Factory<? extends Object> |
getOverrideFactory(String property)
Get the override Factory for the specified property, if one has been registered in this Configuration.
|
boolean |
hasIterationsOverride()
Does this Configuration contain an override for the number of times a type should be tested, or should the
standard global configuration setting be used instead?
|
boolean |
hasOverrideFactory(String property)
Does the specified property have an override Factory?
|
boolean |
isIgnoredProperty(String property)
Should the specified property been disregarded/ignored during testing?
|
String |
toString()
Get a human-readable String representation of this object.
|
public boolean hasIterationsOverride()
true
if this Configuration contains an override for the number of times a type should be
tested; false
if the standard global configuration setting should be used instead.public Integer getIterations()
null
if the number of times a type
should be tested has not been overridden in this Configuration. Use hasIterationsOverride()
first to check whether an iterations override is present.public boolean isIgnoredProperty(String property) throws IllegalArgumentException
property
- The name of the property.true
if the property should be disregarded/ignored during testing; false
otherwise.IllegalArgumentException
- If the property parameter is deemed illegal. For example, if it is null.public boolean hasOverrideFactory(String property) throws IllegalArgumentException
Does the specified property have an override Factory?
That is, has a Factory been registered within this Configuration as an override to standard Factory selection for the specified property?
property
- The name of the property.true
if the property does have an override Factory; false
otherwise.IllegalArgumentException
- If the property parameter is deemed illegal. For example, if it is null.public Factory<? extends Object> getOverrideFactory(String property) throws IllegalArgumentException
Get the override Factory for the specified property, if one has been registered in this Configuration.
The returned Factory will be used over the standard Factory for the property.
property
- The name of the property.null
.IllegalArgumentException
- If the property parameter is deemed illegal. For example, if it is null.Copyright © 2010–2020 meanbean. All rights reserved.