/** * @param props Initial properties. * @param file Property file. * @return Loaded properties. */ private static Map<String, String> loadFromFile(Map<String, String> props, File file) { try { try (InputStream in = new FileInputStream(file)) { Properties fileProps = new Properties(); fileProps.load(in); for (Entry<Object, Object> prop : fileProps.entrySet()) props.put((String) prop.getKey(), (String) prop.getValue()); for (Entry<String, String> prop : props.entrySet()) prop.setValue(substituteProperties(prop.getValue())); } } catch (IOException e) { e.printStackTrace(); assert false : "Failed to load test configuration properties: " + file; } return props; } }