Package core.support.configReader
Class Config
java.lang.Object
core.support.configReader.Config
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncheck for config duplicate keys and print out the key + property file namestatic voidgetAllFiles(File curDir) git all files in given directorygetAllKeys(String path) get all key values from property files in directory at path Fails if duplicate key exists.static BooleangetBooleanValue(String key) gets boolean value from properties keystatic BooleangetBooleanValue(String key, boolean isFailable) gets boolean value from properties keygetConfigGroup(Map<String, String> propertiesMap) get the list of group path specified by profile.group.groupName.getConfigProfiles(Map<String, String> propertiesMap) get the list of profile path specified by profile.getConfigs(Map<String, String> propertiesMap) get a list of config path from properties.property file prefix: "config.", not including profiles: config.profile keystatic doublegetDoubleValue(String key) gets double value from properties keystatic doublegetDoubleValue(String key, boolean isFailable) gets double value from properties keystatic Booleangets boolean value from properties keystatic intgetGlobalIntValue(String key) gets int value from properties keystatic Objectgets the object value from property keystatic StringgetGlobalValue(String key) returns config valuestatic StringgetGlobalValue(String key, boolean isFailable) returns config valuestatic intgetIntValue(String key) gets int value from properties keystatic intgetIntValue(String key, boolean isFailable) gets int value from properties keystatic ObjectgetObjectValue(String key) gets the object value from property keystatic booleangetParentValue(String key) get parent config valuestatic Stringreturns config valuestatic Stringreturns config valuegetValueList(String key) returns a list from config value values separated by ","getValueList(String key, boolean isFailable) returns a list from config value values separated by ","static voidloadConfig(String testId) loads config And properties files to TestObject config maploads configs and profiles to TestObject config mapstatic voidprint a list of missing config variablesstatic voidputs key value pair in configstatic voidputs key value pair in configstatic voidstatic voidsetGlobalValue(String key, Object value) set global config valuestatic voidsetParentValue(String key, Object value) set parent config value
-
Field Details
-
RESOURCE_PATH
-
-
Constructor Details
-
Config
public Config()
-
-
Method Details
-
getAllFiles
git all files in given directory- Parameters:
curDir- target directory
-
getAllKeys
get all key values from property files in directory at path Fails if duplicate key exists. All keys need to be unique- Parameters:
path- path to proeprties file- Returns:
- map of all key and values in all property files in given path
-
loadConfig
loads config And properties files to TestObject config map- Parameters:
testId- id of the test
-
loadConfigProperties
loads configs and profiles to TestObject config map- Returns:
-
checkForDuplicateKeys
check for config duplicate keys and print out the key + property file name- Returns:
-
getConfigs
get a list of config path from properties.property file prefix: "config.", not including profiles: config.profile key- Parameters:
propertiesMap-- Returns:
-
getConfigProfiles
get the list of profile path specified by profile. in properties.property file multiple profiles can be separated by ","- Parameters:
propertiesMap-- Returns:
-
getConfigGroup
get the list of group path specified by profile.group.groupName. in properties.property file multiple profiles can be separated by ","- Parameters:
propertiesMap-- Returns:
-
getValue
returns config value- Parameters:
key- get string value of key from properties- Returns:
- string value of key
-
getValue
returns config value- Parameters:
key- get string value of key from properties- Returns:
- string value of key
-
getGlobalIntValue
gets int value from properties key- Parameters:
key- key in properties file- Returns:
- returns the integer value of key from properties
-
getGlobalObjectValue
gets the object value from property key- Parameters:
key- key in properties file- Returns:
- returns the object value of key from properties
-
getGlobalBooleanValue
gets boolean value from properties key- Parameters:
key- target key from properties file- Returns:
- the boolean value of key from properties
-
getGlobalValue
returns config value- Parameters:
key- get string value of key from properties- Returns:
- string value of key
-
getGlobalValue
returns config value- Parameters:
key- get string value of key from properties- Returns:
- string value of key
-
getBooleanValue
gets boolean value from properties key- Parameters:
key- target key from properties file- Returns:
- the boolean value of key from properties
-
getBooleanValue
gets boolean value from properties key- Parameters:
key- target key from properties file- Returns:
- the boolean value of key from properties
-
getObjectValue
gets the object value from property key- Parameters:
key- key in properties file- Returns:
- returns the object value of key from properties
-
getIntValue
gets int value from properties key- Parameters:
key- key in properties file- Returns:
- returns the integer value of key from properties
-
getIntValue
gets int value from properties key- Parameters:
key- key in properties file- Returns:
- returns the integer value of key from properties
-
getDoubleValue
gets double value from properties key- Parameters:
key- key in properties file- Returns:
- the double value of key from properties
-
getDoubleValue
gets double value from properties key- Parameters:
key- key in properties file- Returns:
- the double value of key from properties
-
getValueList
returns a list from config value values separated by ","- Parameters:
key- key in properties file- Returns:
- the list of values from key separated by ","
-
getValueList
returns a list from config value values separated by ","- Parameters:
key- key in properties file- Returns:
- the list of values from key separated by ","
-
putValue
puts key value pair in config- Parameters:
key- key in properties filevalue- value associated with key
-
putValue
puts key value pair in config- Parameters:
key- key in properties filevalue- value associated with key
-
putValue
-
setParentValue
set parent config value- Parameters:
key-value-
-
setGlobalValue
set global config value- Parameters:
key-value-
-
getParentValue
get parent config value- Parameters:
key-- Returns:
-
printMissingConfigVariables
public static void printMissingConfigVariables()print a list of missing config variables
-