The GlobalVariableAnnex modifies the behavior of the GlobalVariable class dynamically using Groovy's Meta-programming technique.
The GlobalVariableAnnex object maintain a object of type Map
Type Params | Return Type | Name and description |
---|---|---|
|
int |
addGVEntities(java.util.Map<java.lang.String, java.lang.Object> entities) @param entries |
|
int |
addGVEntity(java.lang.String name, java.lang.Object value) "GVEntity" means "an entry of the GlobalVariable object" for short. |
|
java.util.Map<java.lang.String, java.lang.Object> |
additionalGVEntitiesAsMap() |
|
java.util.SortedSet<java.lang.String> |
additionalGVEntitiesKeySet() inspect the 'internal.GlobalVariable' object to find the GlobalVariables contained, return the list of their names. |
|
java.util.Map<java.lang.String, java.lang.Object> |
allGVEntitiesAsMap() transform the GlobalVariable |
|
java.util.SortedSet<java.lang.String> |
allGVEntitiesKeySet() inspect the 'internal.GlobalVariable' object to find the GlobalVariables contained, return the list of their names. |
|
void |
clear() remove name=value pairs added by ExpandoGlobalVariable#addGVEntity(String name, Object value) method calls. |
|
void |
ensureGVEntity(java.lang.String name, java.lang.Object value) If GlobaleVariable.name is present, set the value into it. |
|
java.lang.Object |
getGVEntityValue(java.lang.String name) |
|
static GlobalVariableAnnex |
getInstance() |
|
boolean |
isGVEntityPresent(java.lang.String name) @return true if GlobalVarialbe.name is defined either in 2 places 1. statically predefined in the Execution Profile 2. dynamically added by ExpandoGlobalVariable.addGlobalVariable(name, value) call |
|
java.util.Map<java.lang.String, java.lang.Object> |
staticGVEntitiesAsMap() |
|
java.util.SortedSet<java.lang.String> |
staticGVEntitiesKeySet() inspect the 'internal.GlobalVariable' object to find the GlobalVariables contained, and return the list of the names. |
|
java.lang.String |
toJson() make String representation of the ExpandGlobalVariable instance in JSON format |
|
java.lang.String |
toJson(boolean prettyPrint) @param prettyPrint true to make pretty-print with NEWLINES and indents |
|
void |
validateGVEntityName(java.lang.String name) |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
"GVEntity" means "an entry of the GlobalVariable object" for short. insert a public static property of type java.lang.Object into the internal.GlobalVarialbe runtime. e.g, GVH.addGVEntity('my_new_variable', 'foo') makes 1) internal.GlobalVariable.my_new_variable to be present and to have value 'foo' 2) internal.GlobalVariable.getMy_new_variale() to return 'foo' 3) internal.GlobalVariable.setMy_new_variable('bar') to set 'bar' as the value
inspect the 'internal.GlobalVariable' object to find the GlobalVariables contained, return the list of their names. The list will include only GlobalVariables that are added into the ExpandoGlobalVariable by calling ExpandoGlobalVariable.addProperty(name,value) or equivalently ExecutionProfilesLoader.loadProfile(name). The list will NOT include the GlobalVariables statically defined in the Execution Profile which was applied to the Test Case run.
transform the GlobalVariable
inspect the 'internal.GlobalVariable' object to find the GlobalVariables contained, return the list of their names. The list will include 2 types of GlobalVariables. 1. GlobalVariables statically defined in the Execution Profile which was applied to the Test Case run. In this category there are 2 types of GlobalVariable: a) GlobalVariables defined in the Profile actually applied to the test case execution. b) GlobalVariables defined in the "default" Profile. c) GlobalVariables defined in any of Profiles which are NOT applied to the test case execution. The a) and b) type of GlobalVariable will have some meaningful value. But the c) type will always have 'null' value. 2. GlobalVariables dynamically added into the ExpandoGlobalVariable by calling ExpandoGlobalVariable.addProperty(name,value) or equivalently ExecutionProfilesLoader.loadProfile(name)
remove name=value pairs added by ExpandoGlobalVariable#addGVEntity(String name, Object value) method calls. The names that are NOT present in the original internal.GlobalVariable object will be removed. The names that are present in the original internal.GlobalVariable object will be left untouched; the values will be also unchanged.
If GlobaleVariable.name is present, set the value into it. Otherwise create GlobalVariable.name dynamically and set the value into it.
inspect the 'internal.GlobalVariable' object to find the GlobalVariables contained, and return the list of the names. The list will include only the fields declared with modifiers `public static` in the internal.GlobalVariable class source. You can find the source at projectDir/Libs/internal/GlobalVariable.groovy The list will NOT include the GVentities properties dynamically added by calling ExpandoGlobalVariable XGV = ExpandoGlobalVariable.newInstance() XGV.addGVEntity(String name, Object value)
make String representation of the ExpandGlobalVariable instance in JSON format
prettyPrint
- true to make pretty-print with NEWLINES and indents