Skip to content

Commit 1718aba

Browse files
author
Alexey Semenyuk
committedNov 19, 2020
8227400: Adjust jib profiles to make 3rd party tools for creating installers available on Mach5 test machines
Reviewed-by: almatvee, herrick
1 parent 9bb8223 commit 1718aba

File tree

4 files changed

+21
-5
lines changed

4 files changed

+21
-5
lines changed
 

‎src/jdk.jpackage/share/classes/jdk/jpackage/internal/Executor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ private static String createLogMessage(ProcessBuilder pb, boolean quiet) {
218218
StringBuilder sb = new StringBuilder();
219219
sb.append((quiet) ? pb.command().get(0) : pb.command());
220220
if (pb.directory() != null) {
221-
sb.append(String.format("in %s", pb.directory().getAbsolutePath()));
221+
sb.append(String.format(" in %s", pb.directory().getAbsolutePath()));
222222
}
223223
return sb.toString();
224224
}

‎test/jdk/tools/jpackage/helpers/jdk/jpackage/test/JPackageCommand.java

+14
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
import java.util.function.Function;
4444
import java.util.function.Predicate;
4545
import java.util.function.Supplier;
46+
import java.util.regex.Matcher;
4647
import java.util.regex.Pattern;
4748
import java.util.stream.Collectors;
4849
import java.util.stream.Stream;
@@ -835,6 +836,19 @@ public static String escapeAndJoin(List<String> args) {
835836
}).collect(Collectors.joining(" "));
836837
}
837838

839+
public static Stream<String> stripTimestamps(Stream<String> stream) {
840+
// [HH:mm:ss.SSS]
841+
final Pattern timestampRegexp = Pattern.compile(
842+
"^\\[\\d\\d:\\d\\d:\\d\\d.\\d\\d\\d\\] ");
843+
return stream.map(str -> {
844+
Matcher m = timestampRegexp.matcher(str);
845+
if (m.find()) {
846+
str = str.substring(m.end());
847+
}
848+
return str;
849+
});
850+
}
851+
838852
@Override
839853
protected boolean isMutable() {
840854
return !immutable;

‎test/jdk/tools/jpackage/windows/WinResourceTest.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import jdk.jpackage.test.TKit;
2727
import jdk.jpackage.test.PackageTest;
2828
import jdk.jpackage.test.PackageType;
29+
import jdk.jpackage.test.JPackageCommand;
2930
import jdk.jpackage.test.Annotations.Test;
3031
import jdk.jpackage.test.Annotations.Parameters;
3132
import java.util.List;
@@ -85,7 +86,8 @@ public void test() throws IOException {
8586
// examining its output
8687
TKit.assertTextStream(expectedLogMessage)
8788
.predicate(String::startsWith)
88-
.apply(result.getOutput().stream());
89+
.apply(JPackageCommand.stripTimestamps(
90+
result.getOutput().stream()));
8991
TKit.assertTextStream("error CNDL0104 : Not a valid source file")
9092
.apply(result.getOutput().stream());
9193
})

‎test/jdk/tools/jpackage/windows/WinScriptTest.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -124,18 +124,18 @@ private static class ScriptData {
124124
}
125125

126126
void assertJPackageOutput(List<String> output) {
127-
TKit.assertTextStream(String.format("jp: %s", echoText))
127+
TKit.assertTextStream(String.format(" jp: %s", echoText))
128128
.predicate(String::equals)
129129
.apply(output.stream());
130130

131-
String cwdPattern = String.format("jp: CWD(%s)=", envVarName);
131+
String cwdPattern = String.format(" jp: CWD(%s)=", envVarName);
132132
TKit.assertTextStream(cwdPattern)
133133
.predicate(String::startsWith)
134134
.apply(output.stream());
135135
String cwd = output.stream().filter(line -> line.startsWith(
136136
cwdPattern)).findFirst().get().substring(cwdPattern.length());
137137

138-
String envVarPattern = String.format("jp: %s=", envVarName);
138+
String envVarPattern = String.format(" jp: %s=", envVarName);
139139
TKit.assertTextStream(envVarPattern)
140140
.predicate(String::startsWith)
141141
.apply(output.stream());

1 commit comments

Comments
 (1)

openjdk-notifier[bot] commented on Nov 19, 2020

@openjdk-notifier[bot]
Please sign in to comment.