public class Config extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
RESOURCE_PATH |
| Constructor and Description |
|---|
Config() |
| Modifier and Type | Method and Description |
|---|---|
static List<String> |
checkForDuplicateKeys()
check for config duplicate keys and print out the key + property file name
|
static void |
getAllFiles(File curDir)
git all files in given directory
|
static Map<String,String> |
getAllKeys(String path)
get all key values from property files in directory at path Fails if
duplicate key exists.
|
static Boolean |
getBooleanValue(String key)
gets boolean value from properties key
|
static Boolean |
getBooleanValue(String key,
boolean isFailable)
gets boolean value from properties key
|
static List<String> |
getConfigGroup(Map<String,String> propertiesMap)
get the list of group path specified by profile.group.groupName.
|
static List<String> |
getConfigProfiles(Map<String,String> propertiesMap)
get the list of profile path specified by profile.
|
static List<String> |
getConfigs(Map<String,String> propertiesMap)
get a list of config path from properties.property file prefix: "config.",
not including profiles: config.profile key
|
static double |
getDoubleValue(String key)
gets double value from properties key
|
static double |
getDoubleValue(String key,
boolean isFailable)
gets double value from properties key
|
static Boolean |
getGlobalBooleanValue(String key)
gets boolean value from properties key
|
static int |
getGlobalIntValue(String key)
gets int value from properties key
|
static Object |
getGlobalObjectValue(String key)
gets the object value from property key
|
static String |
getGlobalValue(String key)
returns config value
|
static String |
getGlobalValue(String key,
boolean isFailable)
returns config value
|
static int |
getIntValue(String key)
gets int value from properties key
|
static int |
getIntValue(String key,
boolean isFailable)
gets int value from properties key
|
static Object |
getObjectValue(String key)
gets the object value from property key
|
static boolean |
getParentValue(String key)
get parent config value
|
static String |
getValue(String key)
returns config value
|
static String |
getValue(String key,
boolean isFailable)
returns config value
|
static ArrayList<String> |
getValueList(String key)
returns a list from config value values separated by ","
|
static ArrayList<String> |
getValueList(String key,
boolean isFailable)
returns a list from config value values separated by ","
|
static void |
loadConfig(String testId)
loads config And properties files to TestObject config map
|
static Map<String,Object> |
loadConfigProperties()
loads configs and profiles to TestObject config map
|
static void |
printMissingConfigVariables()
print a list of missing config variables
|
static void |
putValue(String key,
Object value)
puts key value pair in config
|
static void |
putValue(String key,
Object value,
boolean isLog)
puts key value pair in config
|
static void |
putValue(String key,
Object value,
String info) |
static void |
setGlobalValue(String key,
Object value)
set global config value
|
static void |
setParentValue(String key,
Object value)
set parent config value
|
public static String RESOURCE_PATH
public static void getAllFiles(File curDir)
curDir - target directorypublic static Map<String,String> getAllKeys(String path)
path - path to proeprties filepublic static void loadConfig(String testId)
testId - id of the testpublic static Map<String,Object> loadConfigProperties()
public static List<String> checkForDuplicateKeys()
public static List<String> getConfigs(Map<String,String> propertiesMap)
propertiesMap - public static List<String> getConfigProfiles(Map<String,String> propertiesMap)
propertiesMap - public static List<String> getConfigGroup(Map<String,String> propertiesMap)
propertiesMap - public static String getValue(String key)
key - get string value of key from propertiespublic static String getValue(String key, boolean isFailable)
key - get string value of key from propertiespublic static int getGlobalIntValue(String key)
key - key in properties filepublic static Object getGlobalObjectValue(String key)
key - key in properties filepublic static Boolean getGlobalBooleanValue(String key)
key - target key from properties filepublic static String getGlobalValue(String key)
key - get string value of key from propertiespublic static String getGlobalValue(String key, boolean isFailable)
key - get string value of key from propertiespublic static Boolean getBooleanValue(String key)
key - target key from properties filepublic static Boolean getBooleanValue(String key, boolean isFailable)
key - target key from properties filepublic static Object getObjectValue(String key)
key - key in properties filepublic static int getIntValue(String key)
key - key in properties filepublic static int getIntValue(String key, boolean isFailable)
key - key in properties filepublic static double getDoubleValue(String key)
key - key in properties filepublic static double getDoubleValue(String key, boolean isFailable)
key - key in properties filepublic static ArrayList<String> getValueList(String key)
key - key in properties filepublic static ArrayList<String> getValueList(String key, boolean isFailable)
key - key in properties filepublic static void putValue(String key, Object value)
key - key in properties filevalue - value associated with keypublic static void putValue(String key, Object value, boolean isLog)
key - key in properties filevalue - value associated with keypublic static void setParentValue(String key, Object value)
key - value - public static void setGlobalValue(String key, Object value)
key - value - public static boolean getParentValue(String key)
key - public static void printMissingConfigVariables()
Copyright © 2022. All rights reserved.