Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
push:
branches: '**'
pull_request:
branches: [ main ]
branches: [ main, 1.x ]

jobs:
build:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ private static class CapturingLogger extends TestLogger {
}

// server.env is placed in serverDir because SERVER_CONFIG_DIR maps there, making it visible to processServerEnv()
// A minimal server.xml is required so that ServerConfigDocument.<init> does not NPE when it calls parseDocument(serverXMLFile).
private ServerConfigDocument buildDoc(CapturingLogger log, File serverDir, String serverEnvContent) throws Exception {
Files.write(new File(serverDir, "server.xml").toPath(),
"<server/>".getBytes());
Files.write(new File(serverDir, "server.env").toPath(), serverEnvContent.getBytes());

Map<String, File> dirMap = new HashMap<>();
Expand Down Expand Up @@ -118,11 +121,14 @@ public void testWindowsStyleBackslashesPreservedInLog() throws Exception {
CapturingLogger log = new CapturingLogger();
File serverDir = tmp.newFolder("server-win");

// Reproduces the exact scenario from issue #2076
String envContent = "IBM_JAVA_SEMERU_HOME=C:\\MyData\\java\\ibm-semeru-certified\nJAVA_HOME=!IBM_JAVA_SEMERU_HOME!\\jdk-21.0.10+7\n";
// Reproduces the exact scenario from issue #2076.
// Backslashes must be doubled in the .properties file format so that Properties.load() preserves them as single backslashes.
String envContent = "IBM_JAVA_SEMERU_HOME=C:\\\\MyData\\\\java\\\\ibm-semeru-certified\nJAVA_HOME=!IBM_JAVA_SEMERU_HOME!\\\\jdk-21.0.10+7\n";
buildDoc(log, serverDir, envContent).processServerEnv();

String expectedMsg = "Resolved environment variable \"IBM_JAVA_SEMERU_HOME\" in path \"!IBM_JAVA_SEMERU_HOME!\\jdk-21.0.10+7\" to \"C:\\MyData\\java\\ibm-semeru-certified\\jdk-21.0.10+7\"";
// per-var log: shows only what IBM_JAVA_SEMERU_HOME itself resolved to, not the full concatenated value
String expectedMsg = "Resolved environment variable \"IBM_JAVA_SEMERU_HOME\" in path \"!IBM_JAVA_SEMERU_HOME!\\jdk-21.0.10+7\" to \"C:\\MyData\\java\\ibm-semeru-certified\"";
// summary log: shows the full expression after all substitutions
String expectedSummary = "Resolved path \"!IBM_JAVA_SEMERU_HOME!\\jdk-21.0.10+7\" to \"C:\\MyData\\java\\ibm-semeru-certified\\jdk-21.0.10+7\"";
assertTrue("Log message with backslashes not found — backslashes may have been dropped.\nActual: " + log.infoMessages,
log.infoMessages.stream().anyMatch(m -> m.equals(expectedMsg)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ public DevTestUtil(File serverDirectory, File buildDir, boolean container) {
container, null, null, null, 0, false, null, false, null, null, false, null, null, null, false, null, null, null, Collections.emptyMap());
}

/**
* Returns null for all container CLI commands to avoid requiring a running container engine.
*/
@Override
protected String execContainerCmdWithPrefix(String command, int timeout, boolean throwExceptionOnError) {
return null;
}

/**
* Sets the container port fields without going through findLocalPort (which calls Docker).
* Only meaningful when container=true.
Expand Down
Loading