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 liberty-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
<dependency>
<groupId>io.openliberty.tools</groupId>
<artifactId>ci.common</artifactId>
<version>1.8.40</version>
<version>1.8.41-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,12 @@

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileInputStream;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathFactory;

import java.util.Scanner;

import org.junit.Test;

import org.junit.Assert;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;

/**
*
Expand Down Expand Up @@ -57,6 +48,21 @@ public void testToolchainLogExists() throws Exception {
Assert.assertTrue("Did not find project properties contain java.home message for status goal in build.log", logContainsMessage(buildLog, String.format(TOOLCHAIN_NOT_HONORED_WARNING, "status")));
}

@Test
public void verifyLogMessageForExpansionVariables() throws Exception {
File buildLog = new File("../build.log");
Assert.assertTrue(buildLog.exists());
String os = System.getProperty("os.name");
if (os != null && os.toLowerCase().startsWith("windows")) {
Assert.assertTrue("Did not find variable expansion message in build.log", logContainsMessage(buildLog, "Resolving Property EXP_VAR for expression !EXP_VAR!_!EXP_VAR3!. Resolved expression value is TEST"));
Assert.assertTrue("Did not find second variable expansion message in build.log", logContainsMessage(buildLog, "Resolving Property EXP_VAR3 for expression !EXP_VAR!_!EXP_VAR3!. Resolved expression value is TEST_WINDOWS"));
}else {
Assert.assertTrue("Did not find variable expansion message in build.log", logContainsMessage(buildLog, "Resolving Property EXP_VAR for expression ${EXP_VAR}_${EXP_VAR2}. Resolved expression value is TEST"));
Assert.assertTrue("Did not find second variable expansion message in build.log", logContainsMessage(buildLog, "Resolving Property EXP_VAR2 for expression ${EXP_VAR}_${EXP_VAR2}. Resolved expression value is TEST_UNIX"));
}

}

private boolean logContainsMessage( File logFile, String message) throws FileNotFoundException {

Assert.assertTrue("Log file not found at location: "+ LOG_LOCATION, logFile.exists());
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
JAVA_HOME=<REPLACE_JDK_PATH>
JAVA_HOME=<REPLACE_JDK_PATH>

EXP_VAR=TEST
EXP_VAR2=UNIX
EXP_VAR3=WINDOWS
TEST_EXP_VAR_UNIX=${EXP_VAR}_${EXP_VAR2}
TEST_EXP_VAR_WIN=!EXP_VAR!_!EXP_VAR3!