Package ca.cdr.test.util
Class PropertiesTestUtil
java.lang.Object
ca.cdr.test.util.PropertiesTestUtil
Utility class for handling properties file operations in tests.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringloadContextPath(String thePropertiesLocation, String theModuleId) Reads a module'scontext_pathfrom a properties file.loadPortsFromPropertiesFile(String thePropertiesLocation) Loads a properties file and extracts port configurations organized by module type and module ID.
-
Constructor Details
-
PropertiesTestUtil
public PropertiesTestUtil()
-
-
Method Details
-
loadPortsFromPropertiesFile
public static Map<String,Map<String, loadPortsFromPropertiesFileInteger>> (String thePropertiesLocation) Loads a properties file and extracts port configurations organized by module type and module ID.- Parameters:
thePropertiesLocation- the path to the properties file. Can be a regular file path or a classpath resource prefixed with "classpath:"- Returns:
- a map where the key is module type and the value is a map of module ID to port number
- Throws:
RuntimeException- if the properties file cannot be read
-
loadContextPath
@Nullable public static String loadContextPath(@Nonnull String thePropertiesLocation, @Nonnull String theModuleId) Reads a module'scontext_pathfrom a properties file.- Parameters:
thePropertiesLocation- the path to the properties file. Can be a regular file path or a classpath resource prefixed with "classpath:"theModuleId- the module whosemodule.<id>.config.context_pathto read- Returns:
- the configured value, or null if the module sets none
- Throws:
RuntimeException- if the properties file cannot be read
-