Merge
This commit is contained in:
commit
b5eefa753f
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
|
# Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
#
|
#
|
||||||
# This code is free software; you can redistribute it and/or modify it
|
# This code is free software; you can redistribute it and/or modify it
|
||||||
@ -185,6 +185,9 @@ BUNDLE_UP_AND_EXIT = \
|
|||||||
( \
|
( \
|
||||||
jtregExitCode=$$? && \
|
jtregExitCode=$$? && \
|
||||||
_summary="$(SUMMARY_TXT)"; \
|
_summary="$(SUMMARY_TXT)"; \
|
||||||
|
if [ $${jtregExitCode} = 1 ] ; then \
|
||||||
|
jtregExitCode=0; \
|
||||||
|
fi; \
|
||||||
$(RM) -f $(STATS_TXT) $(RUNLIST) $(PASSLIST) $(FAILLIST) $(EXITCODE); \
|
$(RM) -f $(STATS_TXT) $(RUNLIST) $(PASSLIST) $(FAILLIST) $(EXITCODE); \
|
||||||
$(ECHO) "$${jtregExitCode}" > $(EXITCODE); \
|
$(ECHO) "$${jtregExitCode}" > $(EXITCODE); \
|
||||||
if [ -r "$${_summary}" ] ; then \
|
if [ -r "$${_summary}" ] ; then \
|
||||||
|
@ -40,6 +40,7 @@ import java.io.File;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Optional;
|
||||||
import jdk.testlibrary.JDKToolLauncher;
|
import jdk.testlibrary.JDKToolLauncher;
|
||||||
import jdk.testlibrary.Utils;
|
import jdk.testlibrary.Utils;
|
||||||
import jdk.testlibrary.OutputAnalyzer;
|
import jdk.testlibrary.OutputAnalyzer;
|
||||||
@ -111,7 +112,8 @@ public class BasicLauncherTest {
|
|||||||
* @param vmArgs - vm and java arguments to launch test app
|
* @param vmArgs - vm and java arguments to launch test app
|
||||||
* @return exit code of tool
|
* @return exit code of tool
|
||||||
*/
|
*/
|
||||||
public static void launch(String expectedMessage, List<String> toolArgs)
|
public static void launch(String expectedMessage,
|
||||||
|
Optional<String> unexpectedMessage, List<String> toolArgs)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
|
||||||
System.out.println("Starting LingeredApp");
|
System.out.println("Starting LingeredApp");
|
||||||
@ -131,6 +133,7 @@ public class BasicLauncherTest {
|
|||||||
processBuilder.redirectError(ProcessBuilder.Redirect.INHERIT);
|
processBuilder.redirectError(ProcessBuilder.Redirect.INHERIT);
|
||||||
OutputAnalyzer output = ProcessTools.executeProcess(processBuilder);;
|
OutputAnalyzer output = ProcessTools.executeProcess(processBuilder);;
|
||||||
output.shouldContain(expectedMessage);
|
output.shouldContain(expectedMessage);
|
||||||
|
unexpectedMessage.ifPresent(output::shouldNotContain);
|
||||||
output.shouldHaveExitValue(0);
|
output.shouldHaveExitValue(0);
|
||||||
|
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
@ -140,13 +143,16 @@ public class BasicLauncherTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void launch(String expectedMessage, String... toolArgs)
|
public static void launch(String expectedMessage,
|
||||||
|
String unexpectedMessage, String... toolArgs)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
|
||||||
launch(expectedMessage, Arrays.asList(toolArgs));
|
launch(expectedMessage, Optional.ofNullable(unexpectedMessage),
|
||||||
|
Arrays.asList(toolArgs));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void launchNotOSX(String expectedMessage, String... toolArgs)
|
public static void launchNotOSX(String expectedMessage,
|
||||||
|
String unexpectedMessage, String... toolArgs)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
|
||||||
if (Platform.isOSX()) {
|
if (Platform.isOSX()) {
|
||||||
@ -154,6 +160,8 @@ public class BasicLauncherTest {
|
|||||||
System.out.println("This test is not expected to work on OS X. Skipping");
|
System.out.println("This test is not expected to work on OS X. Skipping");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
launch(expectedMessage, unexpectedMessage, toolArgs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void testHeapDump() throws IOException {
|
public static void testHeapDump() throws IOException {
|
||||||
@ -164,7 +172,7 @@ public class BasicLauncherTest {
|
|||||||
}
|
}
|
||||||
dump.deleteOnExit();
|
dump.deleteOnExit();
|
||||||
|
|
||||||
launch("heap written to", "jmap",
|
launch("heap written to", null, "jmap",
|
||||||
"--binaryheap", "--dumpfile=" + dump.getAbsolutePath());
|
"--binaryheap", "--dumpfile=" + dump.getAbsolutePath());
|
||||||
|
|
||||||
assertTrue(dump.exists() && dump.isFile(),
|
assertTrue(dump.exists() && dump.isFile(),
|
||||||
@ -182,11 +190,12 @@ public class BasicLauncherTest {
|
|||||||
|
|
||||||
launchCLHSDB();
|
launchCLHSDB();
|
||||||
|
|
||||||
launch("compiler detected", "jmap", "--clstats");
|
launch("compiler detected", null, "jmap", "--clstats");
|
||||||
launchNotOSX("No deadlocks found", "jstack");
|
launchNotOSX("No deadlocks found", null, "jstack");
|
||||||
launch("compiler detected", "jmap");
|
launch("compiler detected", null, "jmap");
|
||||||
launch("Java System Properties", "jinfo");
|
launch("Java System Properties",
|
||||||
launch("java.threads", "jsnap");
|
"System Properties info not available", "jinfo");
|
||||||
|
launch("java.threads", null, "jsnap");
|
||||||
|
|
||||||
testHeapDump();
|
testHeapDump();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user