Interface ParameterResolver
-
- All Known Implementing Classes:
DefaultParameterResolver
public interface ParameterResolverThe parameter resolver is responsible for the creation of a map of parameters for fixture executions. It does NOT convert any values, which is the duty of theValueConverter.- Author:
- Rene Schneider - initial API and implementation
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Map<String,Object>createExpectedResultMap(Test aTest, boolean anIncludeArbitraryResultFlag)Returns a map of named results as expected by the givenTest.Map<String,Object>createParameterMap(Call aCall, boolean anIncludeArbitraryParametersFlag, UnresolvableVariableHandling anUnresolvableVariableHandlingPolicy)Returns a map mapping a parameter name to a value, exploring a givenCallto determine the valid parameters.Map<String,Object>createParameterMap(TableTest aTableTest, TableTestRow aTableTestRow, TableTestParameterResolveMethod aResolveMethod, boolean anIncludeArbitraryParametersFlag, UnresolvableVariableHandling anUnresolvableVariableHandlingPolicy)Returns a map mapping a parameter name to a value, exploring a given row of aTableTestto determine the valid parameters.Map<String,Object>createParameterMap(Test aTest, boolean anIncludeArbitraryParametersFlag, UnresolvableVariableHandling anUnresolvableVariableHandlingPolicy)Returns a map mapping a parameter name to a value, exploring a givenTestto determine the valid parameters.Map<String,Object>createParameterMap(List<Parameter> someParameters, boolean anIncludeArbitraryParametersFlag, UnresolvableVariableHandling anUnresolvableVariableHandlingPolicy)Returns a map mapping a parameter name to a value, using a list ofParameterinstances to determine the valid parameters.booleanisSafelyStaticallyResolvable(ValueOrEnumValueOrOperationCollection aValue, VariantDefinition aVariant)Determines whether the givenValueOrEnumValueOrOperationCollectionis safely resolvable to a value in a static way, that is, not requiring a current execution context.booleanisSafelyStaticallyResolvable(ValueOrEnumValueOrOperation aValue, VariantDefinition aVariant)Determines whether the givenValueOrEnumValueOrOperationis safely resolvable to a value in a static way, that is, not requiring a current execution context.ObjectresolveParameterValue(ValueOrEnumValueOrOperationCollection aValueCollection, UnresolvableVariableHandling anUnresolvableVariableHandlingPolicy)Resolves the givenValueOrEnumValueOrOperationCollection, using the variable map given.ObjectresolveSingleParameterValue(ValueOrEnumValueOrOperation aValue, UnresolvableVariableHandling anUnresolvableVariableHandlingPolicy)Resolves the givenValueOrEnumValueOrOperation, using the variable map given.ObjectresolveStatically(ConstantDefinition aConstant, VariantDefinition aVariant)Resolves a constant definition to its defined value, which may depend on the active variant.ObjectresolveStatically(ValueOrEnumValueOrOperationCollection anEntity, VariantDefinition aVariant)Resolves aValueOrEnumValueOrOperationCollectionto its actual value statically, that is, not requiring a current test execution context.ObjectresolveStatically(ValueOrEnumValueOrOperation anEntity, VariantDefinition aVariant)Resolves aValueOrEnumValueOrOperationto its actual value statically, that is, not requiring a current test execution context.ObjectresolveStatically(VariableOrConstantEntity anEntity, VariantDefinition aVariant)Resolves a variable (recursively, if necessary) to its actual value.ObjectresolveStatically(Variable aVariable, VariantDefinition aVariant)Resolves a variable (recursively, if necessary) to its actual value.
-
-
-
Method Detail
-
createParameterMap
Map<String,Object> createParameterMap(Test aTest, boolean anIncludeArbitraryParametersFlag, UnresolvableVariableHandling anUnresolvableVariableHandlingPolicy) throws ClassNotFoundException, UnexecutableException, InstantiationException
Returns a map mapping a parameter name to a value, exploring a givenTestto determine the valid parameters. Parameters that contain references to variables will be resolved if the variable map is provided, but no type conversions will be done.- Parameters:
aTest- the testanIncludeArbitraryParametersFlag- whether arbitrary parameters should be determined and included as wellanUnresolvableVariableHandlingPolicy- Defines the policy how unresolvable variable references (no variable given or noVariableManageravailable) shall be treated- Returns:
- a map with a String to value mapping
- Throws:
InstantiationExceptionUnexecutableExceptionClassNotFoundException
-
createParameterMap
Map<String,Object> createParameterMap(Call aCall, boolean anIncludeArbitraryParametersFlag, UnresolvableVariableHandling anUnresolvableVariableHandlingPolicy) throws ClassNotFoundException, UnexecutableException, InstantiationException
Returns a map mapping a parameter name to a value, exploring a givenCallto determine the valid parameters. Parameters that contain references to variables will be resolved if the variable map is provided, but no type conversions will be done.- Parameters:
aCall- the callanIncludeArbitraryParametersFlag- whether arbitrary parameters should be determined and included as wellanUnresolvableVariableHandlingPolicy- Defines the policy how unresolvable variable references (no variable given or noVariableManageravailable) shall be treated- Returns:
- a map with a String to value mapping
- Throws:
InstantiationExceptionUnexecutableExceptionClassNotFoundException
-
createParameterMap
Map<String,Object> createParameterMap(TableTest aTableTest, TableTestRow aTableTestRow, TableTestParameterResolveMethod aResolveMethod, boolean anIncludeArbitraryParametersFlag, UnresolvableVariableHandling anUnresolvableVariableHandlingPolicy) throws ClassNotFoundException, UnexecutableException, InstantiationException
Returns a map mapping a parameter name to a value, exploring a given row of aTableTestto determine the valid parameters. Parameters that contain operations and/or references to variables will be resolved if the variable map is provided, but no type conversions will be done.- Parameters:
aTableTest- the table testaTableTestRow- the row of the testaResolveMethod- specifies the kind of params to be resolved (null =TableTestParameterResolveMethod.COMBINED)anIncludeArbitraryParametersFlag- whether arbitrary parameters should be determined and included as wellanUnresolvableVariableHandlingPolicy- Defines the policy how unresolvable variable references (no variable given or noVariableManageravailable) shall be treated- Returns:
- a map with a String to value mapping
- Throws:
InstantiationExceptionUnexecutableExceptionClassNotFoundException
-
createParameterMap
Map<String,Object> createParameterMap(List<Parameter> someParameters, boolean anIncludeArbitraryParametersFlag, UnresolvableVariableHandling anUnresolvableVariableHandlingPolicy) throws ClassNotFoundException, UnexecutableException, InstantiationException
Returns a map mapping a parameter name to a value, using a list ofParameterinstances to determine the valid parameters. Parameters that contain operations or references to variables will be resolved if the variable map is provided, but no type conversions will be done.- Parameters:
someParameters- the parametersanIncludeArbitraryParametersFlag- whether arbitrary parameters should be determined and included as wellanUnresolvableVariableHandlingPolicy- Defines the policy how unresolvable variable references (no variable given or noVariableManageravailable) shall be treated- Returns:
- a map with a String to value mapping
- Throws:
InstantiationExceptionUnexecutableExceptionClassNotFoundException
-
resolveParameterValue
Object resolveParameterValue(ValueOrEnumValueOrOperationCollection aValueCollection, UnresolvableVariableHandling anUnresolvableVariableHandlingPolicy) throws UnexecutableException, InstantiationException, ClassNotFoundException
Resolves the givenValueOrEnumValueOrOperationCollection, using the variable map given. Resolving only attempts to execute any operations and replace variable references with the current variable value, but does NOT convert the values to any other target type.- Parameters:
aValueCollection- the value collection to resolveanUnresolvableVariableHandlingPolicy- Defines the policy how unresolvable variable references (no variable given or noVariableManageravailable) shall be treated- Returns:
- the resolved value
- Throws:
UnexecutableExceptionInstantiationExceptionClassNotFoundException
-
resolveSingleParameterValue
Object resolveSingleParameterValue(ValueOrEnumValueOrOperation aValue, UnresolvableVariableHandling anUnresolvableVariableHandlingPolicy) throws UnexecutableException, InstantiationException, ClassNotFoundException
Resolves the givenValueOrEnumValueOrOperation, using the variable map given. Resolving only attempts to execute any operations and replace variable references with the current variable value, but does NOT convert the values to any other target type.- Parameters:
aValue- the value to resolveanUnresolvableVariableHandlingPolicy- Defines the policy how unresolvable variable references (no variable given or noVariableManageravailable) shall be treated- Returns:
- the resolved value
- Throws:
UnexecutableExceptionInstantiationExceptionClassNotFoundException
-
resolveStatically
Object resolveStatically(Variable aVariable, VariantDefinition aVariant) throws ClassNotFoundException, InstantiationException, UnexecutableException
Resolves a variable (recursively, if necessary) to its actual value. Since this static method doesn't have access to the actual variable store of a test runner instance, the resolving can only be successful in cases of variables with initial value (giving that value) or constants.- Parameters:
aVariable- the variable to resolveaVariant- the active variant- Returns:
- the result, or null if none was found
- Throws:
ClassNotFoundExceptionInstantiationExceptionUnexecutableException
-
resolveStatically
Object resolveStatically(VariableOrConstantEntity anEntity, VariantDefinition aVariant) throws ClassNotFoundException, InstantiationException, UnexecutableException
Resolves a variable (recursively, if necessary) to its actual value. Since this static method doesn't have access to the actual variable store of a test runner instance, the resolving can only be successful in cases of variables with initial value (giving that value) or constants.- Parameters:
anEntity- the entity to resolveaVariant- the active variant- Returns:
- the result, or null if none was found
- Throws:
ClassNotFoundExceptionInstantiationExceptionUnexecutableException
-
resolveStatically
Object resolveStatically(ValueOrEnumValueOrOperation anEntity, VariantDefinition aVariant) throws UnexecutableException, ClassNotFoundException, InstantiationException
Resolves aValueOrEnumValueOrOperationto its actual value statically, that is, not requiring a current test execution context.- Parameters:
anEntity- the entity to resolveaVariant- the variant in use- Returns:
- the result value
- Throws:
UnexecutableExceptionClassNotFoundExceptionInstantiationException
-
resolveStatically
Object resolveStatically(ValueOrEnumValueOrOperationCollection anEntity, VariantDefinition aVariant) throws UnexecutableException, ClassNotFoundException, InstantiationException
Resolves aValueOrEnumValueOrOperationCollectionto its actual value statically, that is, not requiring a current test execution context.- Parameters:
anEntity- the entity to resolveaVariant- the variant in use- Returns:
- the result value
- Throws:
UnexecutableExceptionClassNotFoundExceptionInstantiationException
-
isSafelyStaticallyResolvable
boolean isSafelyStaticallyResolvable(ValueOrEnumValueOrOperationCollection aValue, VariantDefinition aVariant)
Determines whether the givenValueOrEnumValueOrOperationCollectionis safely resolvable to a value in a static way, that is, not requiring a current execution context. "Safely" means that the resolved value is guaranteed not to change during runtime.- Parameters:
aValue- the value to testaVariant- the variant to assume- Returns:
- true if the value is safely resolvable, false otherwise
-
isSafelyStaticallyResolvable
boolean isSafelyStaticallyResolvable(ValueOrEnumValueOrOperation aValue, VariantDefinition aVariant)
Determines whether the givenValueOrEnumValueOrOperationis safely resolvable to a value in a static way, that is, not requiring a current execution context. "Safely" means that the resolved value is guaranteed not to change during runtime.- Parameters:
aValue- the value to testaVariant- the variant to assume- Returns:
- true if the value is safely resolvable, false otherwise
-
resolveStatically
Object resolveStatically(ConstantDefinition aConstant, VariantDefinition aVariant) throws UnexecutableException, ClassNotFoundException, InstantiationException
Resolves a constant definition to its defined value, which may depend on the active variant.- Parameters:
aConstant- the constant to resolveaVariant- the active variant- Returns:
- the result, or null if none is defined for the constant
- Throws:
UnexecutableExceptionClassNotFoundExceptionInstantiationException
-
createExpectedResultMap
Map<String,Object> createExpectedResultMap(Test aTest, boolean anIncludeArbitraryResultFlag)
Returns a map of named results as expected by the givenTest. The Map will connect result names to actual values. Does not support variable resolving!- Parameters:
aTest- the testanIncludeArbitraryResultFlag- whether arbitrary results shall be included- Returns:
- a map of Strings to values
-
-