Java Code Examples for jdk.testlibrary.OutputAnalyzer#stdoutShouldMatch()

The following examples show how to use jdk.testlibrary.OutputAnalyzer#stdoutShouldMatch() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LeadingGarbage.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
void createNormalZip() throws Throwable {
    createFiles();
    String[] cmd = { jar, "c0Mf", "normal.zip", "a", "b" };
    ProcessBuilder pb = new ProcessBuilder(cmd);
    OutputAnalyzer a = ProcessTools.executeProcess(pb);
    a.shouldHaveExitValue(0);
    a.stdoutShouldMatch("\\A\\Z");
    a.stderrShouldMatch("\\A\\Z");
    deleteFiles();
}
 
Example 2
Source File: LeadingGarbage.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
void assertCanList(String zipFileName) throws Throwable {
    String[] cmd = { jar, "tf", zipFileName };
    ProcessBuilder pb = new ProcessBuilder(cmd);
    OutputAnalyzer a = ProcessTools.executeProcess(pb);
    a.shouldHaveExitValue(0);
    StringBuilder expected = new StringBuilder();
    for (File file : files)
        expected.append(file.getName()).append(System.lineSeparator());
    a.stdoutShouldMatch(expected.toString());
    a.stderrShouldMatch("\\A\\Z");
}
 
Example 3
Source File: LeadingGarbage.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
void assertCanExtract(String zipFileName) throws Throwable {
    String[] cmd = { jar, "xf", zipFileName };
    ProcessBuilder pb = new ProcessBuilder(cmd);
    OutputAnalyzer a = ProcessTools.executeProcess(pb);
    a.shouldHaveExitValue(0);
    a.stdoutShouldMatch("\\A\\Z");
    a.stderrShouldMatch("\\A\\Z");
    assertFilesExist();
}
 
Example 4
Source File: JcmdAsserts.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
public static void assertRecordingIsUnstarted(OutputAnalyzer output,
        String name, String duration) {
    output.stdoutShouldMatch("^\\s*Recording: recording=\\d+\\s+name=\"" + name
            + "\"\\s+duration=" + duration + "\\s+.*\\W{1}unstarted\\W{1}");
}
 
Example 5
Source File: JcmdAsserts.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
public static void assertRecordingIsStopped(OutputAnalyzer output, String name) {
    output.stdoutShouldMatch("^\\s*Recording: recording=\\d+\\s+name=\"" + name
            + "\"\\s+.*\\W{1}stopped\\W{1}");
}
 
Example 6
Source File: JcmdAsserts.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
public static void assertRecordingIsStopped(OutputAnalyzer output, String name, String duration) {
    output.stdoutShouldMatch("^\\s*Recording: recording=\\d+\\s+name=\"" + name
            + "\"\\s+duration=" + duration + "\\s+.*\\W{1}stopped\\W{1}");
}
 
Example 7
Source File: JcmdAsserts.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
public static void assertRecordingIsScheduled(OutputAnalyzer output, String name, String delay) {
    output.stdoutShouldMatch(
            "^\\s*Recording\\s+" + name + "\\s+scheduled to start in " + delay);
}
 
Example 8
Source File: JcmdAsserts.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
public static void assertThreadSleepThresholdIsSet(OutputAnalyzer output) throws Exception {
    output.stdoutShouldMatch("\\s+\\W{1}" + EventNames.ThreadSleep + "\\W{1}" +
            NEW_LINE + ".*threshold=1 ms.*");
}
 
Example 9
Source File: JcmdAsserts.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
public static void assertMonitorWaitThresholdIsSet(OutputAnalyzer output) throws Exception {
    output.stdoutShouldMatch("\\s+\\W{1}" + EventNames.JavaMonitorWait + "\\W{1}" +
            NEW_LINE + ".*threshold=1 ms.*");
}
 
Example 10
Source File: JcmdAsserts.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
public static void assertRecordingIsUnstarted(OutputAnalyzer output,
        String name, String duration) {
    output.stdoutShouldMatch("^\\s*Recording: recording=\\d+\\s+name=\"" + name
            + "\"\\s+duration=" + duration + "\\s+.*\\W{1}unstarted\\W{1}");
}
 
Example 11
Source File: JcmdAsserts.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
public static void assertRecordingIsStopped(OutputAnalyzer output, String name) {
    output.stdoutShouldMatch("^\\s*Recording: recording=\\d+\\s+name=\"" + name
            + "\"\\s+.*\\W{1}stopped\\W{1}");
}
 
Example 12
Source File: JcmdAsserts.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
public static void assertRecordingIsStopped(OutputAnalyzer output, String name, String duration) {
    output.stdoutShouldMatch("^\\s*Recording: recording=\\d+\\s+name=\"" + name
            + "\"\\s+duration=" + duration + "\\s+.*\\W{1}stopped\\W{1}");
}
 
Example 13
Source File: JcmdAsserts.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
public static void assertRecordingIsScheduled(OutputAnalyzer output, String name, String delay) {
    output.stdoutShouldMatch(
            "^\\s*Recording\\s+" + name + "\\s+scheduled to start in " + delay);
}
 
Example 14
Source File: JcmdAsserts.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
public static void assertThreadSleepThresholdIsSet(OutputAnalyzer output) throws Exception {
    output.stdoutShouldMatch("\\s+\\W{1}" + EventNames.ThreadSleep + "\\W{1}" +
            NEW_LINE + ".*threshold=1 ms.*");
}
 
Example 15
Source File: JcmdAsserts.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
public static void assertMonitorWaitThresholdIsSet(OutputAnalyzer output) throws Exception {
    output.stdoutShouldMatch("\\s+\\W{1}" + EventNames.JavaMonitorWait + "\\W{1}" +
            NEW_LINE + ".*threshold=1 ms.*");
}