jdk/test/lib/testlibrary/OutputAnalyzerTest.java
author jjg
Mon, 25 Nov 2013 17:42:28 -0800
changeset 21894 3535c1819067
parent 15645 8d05e519bffb
child 27189 b90845965ee9
permissions -rw-r--r--
8028318: [doclint] doclint will reject existing user-written doc comments using custom tags that follow the recommended rules Reviewed-by: darcy
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
15645
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
     1
/*
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
     2
 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
     4
 *
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
     7
 * published by the Free Software Foundation.
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
     8
 *
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    13
 * accompanied this code).
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    14
 *
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    18
 *
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    21
 * questions.
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    22
 */
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    23
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    24
/*
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    25
 * @test
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    26
 * @summary Test the OutputAnalyzer utility class
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    27
 * @library /testlibrary
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    28
 */
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    29
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    30
import jdk.testlibrary.OutputAnalyzer;
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    31
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    32
public class OutputAnalyzerTest {
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    33
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    34
    public static void main(String args[]) throws Exception {
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    35
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    36
        String stdout = "aaaaaa";
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    37
        String stderr = "bbbbbb";
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    38
        String nonExistingString = "cccc";
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    39
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    40
        OutputAnalyzer output = new OutputAnalyzer(stdout, stderr);
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    41
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    42
        if (!stdout.equals(output.getStdout())) {
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    43
            throw new Exception("getStdout() returned '" + output.getStdout()
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    44
                    + "', expected '" + stdout + "'");
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    45
        }
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    46
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    47
        if (!stderr.equals(output.getStderr())) {
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    48
            throw new Exception("getStderr() returned '" + output.getStderr()
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    49
                    + "', expected '" + stderr + "'");
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    50
        }
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    51
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    52
        try {
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    53
            output.shouldContain(stdout);
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    54
            output.stdoutShouldContain(stdout);
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    55
            output.shouldContain(stderr);
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    56
            output.stderrShouldContain(stderr);
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    57
        } catch (RuntimeException e) {
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    58
            throw new Exception("shouldContain() failed", e);
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    59
        }
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    60
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    61
        try {
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    62
            output.shouldContain(nonExistingString);
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    63
            throw new Exception("shouldContain() failed to throw exception");
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    64
        } catch (RuntimeException e) {
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    65
            // expected
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    66
        }
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    67
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    68
        try {
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    69
            output.stdoutShouldContain(stderr);
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    70
            throw new Exception(
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    71
                    "stdoutShouldContain() failed to throw exception");
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    72
        } catch (RuntimeException e) {
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    73
            // expected
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    74
        }
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    75
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    76
        try {
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    77
            output.stderrShouldContain(stdout);
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    78
            throw new Exception(
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    79
                    "stdoutShouldContain() failed to throw exception");
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    80
        } catch (RuntimeException e) {
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    81
            // expected
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    82
        }
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    83
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    84
        try {
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    85
            output.shouldNotContain(nonExistingString);
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    86
            output.stdoutShouldNotContain(nonExistingString);
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    87
            output.stderrShouldNotContain(nonExistingString);
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    88
        } catch (RuntimeException e) {
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    89
            throw new Exception("shouldNotContain() failed", e);
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    90
        }
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    91
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    92
        try {
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    93
            output.shouldNotContain(stdout);
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    94
            throw new Exception("shouldContain() failed to throw exception");
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    95
        } catch (RuntimeException e) {
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    96
            // expected
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    97
        }
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    98
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
    99
        try {
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   100
            output.stdoutShouldNotContain(stdout);
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   101
            throw new Exception("shouldContain() failed to throw exception");
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   102
        } catch (RuntimeException e) {
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   103
            // expected
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   104
        }
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   105
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   106
        try {
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   107
            output.stderrShouldNotContain(stderr);
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   108
            throw new Exception("shouldContain() failed to throw exception");
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   109
        } catch (RuntimeException e) {
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   110
            // expected
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   111
        }
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   112
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   113
        String stdoutPattern = "[a]";
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   114
        String stderrPattern = "[b]";
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   115
        String nonExistingPattern = "[c]";
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   116
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   117
        // Should match
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   118
        try {
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   119
            output.shouldMatch(stdoutPattern);
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   120
            output.stdoutShouldMatch(stdoutPattern);
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   121
            output.shouldMatch(stderrPattern);
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   122
            output.stderrShouldMatch(stderrPattern);
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   123
        } catch (RuntimeException e) {
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   124
            throw new Exception("shouldMatch() failed", e);
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   125
        }
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   126
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   127
        try {
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   128
            output.shouldMatch(nonExistingPattern);
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   129
            throw new Exception("shouldMatch() failed to throw exception");
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   130
        } catch (RuntimeException e) {
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   131
            // expected
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   132
        }
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   133
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   134
        try {
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   135
            output.stdoutShouldMatch(stderrPattern);
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   136
            throw new Exception(
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   137
                    "stdoutShouldMatch() failed to throw exception");
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   138
        } catch (RuntimeException e) {
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   139
            // expected
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   140
        }
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   141
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   142
        try {
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   143
            output.stderrShouldMatch(stdoutPattern);
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   144
            throw new Exception(
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   145
                    "stderrShouldMatch() failed to throw exception");
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   146
        } catch (RuntimeException e) {
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   147
            // expected
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   148
        }
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   149
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   150
        // Should not match
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   151
        try {
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   152
            output.shouldNotMatch(nonExistingPattern);
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   153
            output.stdoutShouldNotMatch(nonExistingPattern);
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   154
            output.stderrShouldNotMatch(nonExistingPattern);
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   155
        } catch (RuntimeException e) {
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   156
            throw new Exception("shouldNotMatch() failed", e);
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   157
        }
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   158
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   159
        try {
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   160
            output.shouldNotMatch(stdoutPattern);
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   161
            throw new Exception("shouldNotMatch() failed to throw exception");
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   162
        } catch (RuntimeException e) {
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   163
            // expected
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   164
        }
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   165
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   166
        try {
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   167
            output.stdoutShouldNotMatch(stdoutPattern);
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   168
            throw new Exception("shouldNotMatch() failed to throw exception");
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   169
        } catch (RuntimeException e) {
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   170
            // expected
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   171
        }
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   172
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   173
        try {
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   174
            output.stderrShouldNotMatch(stderrPattern);
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   175
            throw new Exception("shouldNotMatch() failed to throw exception");
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   176
        } catch (RuntimeException e) {
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   177
            // expected
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   178
        }
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   179
    }
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   180
8d05e519bffb 8007142: Add utility classes for writing better multiprocess tests in jtreg
ykantser
parents:
diff changeset
   181
}