Package de.gebit.integrity.utils
Class ParameterUtil
- java.lang.Object
-
- de.gebit.integrity.utils.ParameterUtil
-
public final class ParameterUtil extends java.lang.Object
A utility class for handling of test/call/suite parameters.- Author:
- Rene Schneider - initial API and implementation
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ParameterUtil.UnresolvableVariableException
Thrown if a variable value cannot be resolved because there's no variable map given.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_PARAMETER_NAME
The "fake" name of the default parameter.static java.lang.String
EMPTY_VALUE
A fixed result "value" object indicating that a result value was an empty collection.static java.lang.String
INEXISTENT_VALUE
A fixed result "value" object indicating that a result value actually did not even exist in the named results returned by a fixture (not even with a "null" value, which is a different kind of statement).
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Class<?>
getResultTypeFromNamedResultContainerType(java.lang.Class<?> aContainerType, java.lang.String aResultName)
Determines the result type by looking at a result container type for a specific result name.static java.util.Map<java.lang.String,java.lang.Object>
getValuesFromNamedResultContainer(java.lang.Object aContainer)
Returns a map of named result names to values acquired from a given named result container.static java.util.List<VariableEntity>
getVariableEntitiesForSuiteParameters(SuiteDefinition aSuite)
Determines a list of allVariableEntity
s referenced in a suites' parameter list.
-
-
-
Field Detail
-
DEFAULT_PARAMETER_NAME
public static final java.lang.String DEFAULT_PARAMETER_NAME
The "fake" name of the default parameter. This is used for unnamed parameters in maps which require a non-null key.- See Also:
- Constant Field Values
-
INEXISTENT_VALUE
public static final java.lang.String INEXISTENT_VALUE
A fixed result "value" object indicating that a result value actually did not even exist in the named results returned by a fixture (not even with a "null" value, which is a different kind of statement).- See Also:
- Constant Field Values
-
EMPTY_VALUE
public static final java.lang.String EMPTY_VALUE
A fixed result "value" object indicating that a result value was an empty collection.- See Also:
- Constant Field Values
-
-
Method Detail
-
getValuesFromNamedResultContainer
public static java.util.Map<java.lang.String,java.lang.Object> getValuesFromNamedResultContainer(java.lang.Object aContainer) throws java.beans.IntrospectionException, java.lang.IllegalArgumentException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
Returns a map of named result names to values acquired from a given named result container. This container is assumed to be a simple Java Bean, with accessible accessor methods useable to retrieve the values of fields. The field names are used as result names and thus keys in the map. Unreachable fields are ignored.- Parameters:
aContainer
- the container instance- Returns:
- the map of result names to values
- Throws:
java.beans.IntrospectionException
- the introspection exceptionjava.lang.IllegalArgumentException
- the illegal argument exceptionjava.lang.IllegalAccessException
- the illegal access exceptionjava.lang.reflect.InvocationTargetException
- the invocation target exception
-
getResultTypeFromNamedResultContainerType
public static java.lang.Class<?> getResultTypeFromNamedResultContainerType(java.lang.Class<?> aContainerType, java.lang.String aResultName) throws java.beans.IntrospectionException
Determines the result type by looking at a result container type for a specific result name.- Parameters:
aContainerType
- the container typeaResultName
- the name of the result- Returns:
- the result type
- Throws:
java.beans.IntrospectionException
- the introspection exception
-
getVariableEntitiesForSuiteParameters
public static java.util.List<VariableEntity> getVariableEntitiesForSuiteParameters(SuiteDefinition aSuite)
Determines a list of allVariableEntity
s referenced in a suites' parameter list.- Parameters:
aSuite
-- Returns:
-
-