Skip to content

Commit

Permalink
support Java 8, fix test for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
dshimo committed Mar 6, 2024
1 parent 2937b68 commit a5a71a5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -266,19 +266,27 @@ public void parsePropertiesFromFile(File propertiesFile) throws Exception, FileN
*/
public void processServerEnv() throws Exception, FileNotFoundException {
final String serverEnvString = "server.env";
parsePropertiesFromFile(new File(libertyDirectoryPropertyToFile.get(ServerFeatureUtil.WLP_INSTALL_DIR), "etc" + File.separator + serverEnvString));
parsePropertiesFromFile(new File(libertyDirectoryPropertyToFile.get(ServerFeatureUtil.WLP_USER_DIR), "shared" + File.separator + serverEnvString));
parsePropertiesFromFile(new File(libertyDirectoryPropertyToFile.get(ServerFeatureUtil.SERVER_CONFIG_DIR), serverEnvString));
parsePropertiesFromFile(new File(libertyDirectoryPropertyToFile.get(ServerFeatureUtil.WLP_INSTALL_DIR),
"etc" + File.separator + serverEnvString));
parsePropertiesFromFile(new File(libertyDirectoryPropertyToFile.get(ServerFeatureUtil.WLP_USER_DIR),
"shared" + File.separator + serverEnvString));
parsePropertiesFromFile(new File(libertyDirectoryPropertyToFile.get(ServerFeatureUtil.SERVER_CONFIG_DIR),
serverEnvString));
}

/**
* Likely not needed to be processed by the LMP/LGP tools. These properties benefit the JVM.
* Likely not needed to be processed by the LMP/LGP tools. These properties benefit the JVM
* 1. ${wlp.user.dir}/shared/jvm.options
* 2. ${server.config.dir}/configDropins/defaults/
* 3. ${server.config.dir}/
* 4. ${server.config.dir}/configDropins/overrides/
* @throws FileNotFoundException
* @throws Exception
*/
public void processJvmOptions() throws FileNotFoundException, Exception {
final String jvmOptionsString = "jvm.options";
parsePropertiesFromFile(new File(libertyDirectoryPropertyToFile.get(ServerFeatureUtil.WLP_USER_DIR), jvmOptionsString));
parsePropertiesFromFile(new File(libertyDirectoryPropertyToFile.get(ServerFeatureUtil.WLP_USER_DIR),
"shared" + File.separator + jvmOptionsString));
parsePropertiesFromFile(getFileFromConfigDirectory(CONFIGDROPINS_DEFAULT + File.separator + jvmOptionsString));
parsePropertiesFromFile(getFileFromConfigDirectory(jvmOptionsString));
parsePropertiesFromFile(getFileFromConfigDirectory(CONFIGDROPINS_OVERRIDES + File.separator + jvmOptionsString));
Expand Down Expand Up @@ -413,7 +421,7 @@ public void processNestedVariableSourceDirs(File directory, String propertyPrefi
}

String propertyName = propertyPrefix + child.getName();
String propertyValue = Files.readString(child.toPath());
String propertyValue = new String(Files.readAllBytes(child.toPath()));
props.setProperty(propertyName, propertyValue);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public void variablesDir() throws FileNotFoundException, Exception {

Properties props = configDocument.getProperties();
assertEquals("9080", props.getProperty("httpPort"));
assertEquals("1000", props.getProperty("nested/httpPort"));
assertEquals("1000", props.getProperty(String.join(File.separator, "nested", "httpPort")));
assertEquals("1", props.getProperty("VALUE_1"));
assertEquals("2", props.getProperty("VALUE_2"));

Expand Down

0 comments on commit a5a71a5

Please sign in to comment.