Mercurial > hg > graal-compiler
annotate test/testlibrary_tests/OutputAnalyzerTest.java @ 13816:d006a6332db8
Make sure a compile id is assigned
author | Tom Rodriguez <tom.rodriguez@oracle.com> |
---|---|
date | Wed, 29 Jan 2014 14:06:32 -0800 |
parents | 5b1191bf0b4b |
children |
rev | line source |
---|---|
7960
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
1 /* |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
4 * |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
8 * |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
13 * accompanied this code). |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
14 * |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
18 * |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
21 * questions. |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
22 */ |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
23 |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
24 /* |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
25 * @test |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
26 * @summary Test the OutputAnalyzer utility class |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
27 * @library /testlibrary |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
28 */ |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
29 |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
30 import com.oracle.java.testlibrary.OutputAnalyzer; |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
31 |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
32 public class OutputAnalyzerTest { |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
33 |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
34 public static void main(String args[]) throws Exception { |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
35 |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
36 String stdout = "aaaaaa"; |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
37 String stderr = "bbbbbb"; |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
38 |
9056
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
39 // Regexps used for testing pattern matching of the test input |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
40 String stdoutPattern = "[a]"; |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
41 String stderrPattern = "[b]"; |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
42 String nonExistingPattern = "[c]"; |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
43 |
7960
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
44 OutputAnalyzer output = new OutputAnalyzer(stdout, stderr); |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
45 |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
46 if (!stdout.equals(output.getStdout())) { |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
47 throw new Exception("getStdout() returned '" + output.getStdout() + "', expected '" + stdout + "'"); |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
48 } |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
49 |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
50 if (!stderr.equals(output.getStderr())) { |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
51 throw new Exception("getStderr() returned '" + output.getStderr() + "', expected '" + stderr + "'"); |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
52 } |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
53 |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
54 try { |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
55 output.shouldContain(stdout); |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
56 output.stdoutShouldContain(stdout); |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
57 output.shouldContain(stderr); |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
58 output.stderrShouldContain(stderr); |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
59 } catch (RuntimeException e) { |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
60 throw new Exception("shouldContain() failed", e); |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
61 } |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
62 |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
63 try { |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
64 output.shouldContain("cccc"); |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
65 throw new Exception("shouldContain() failed to throw exception"); |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
66 } catch (RuntimeException e) { |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
67 // expected |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
68 } |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
69 |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
70 try { |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
71 output.stdoutShouldContain(stderr); |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
72 throw new Exception("stdoutShouldContain() failed to throw exception"); |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
73 } catch (RuntimeException e) { |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
74 // expected |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
75 } |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
76 |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
77 try { |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
78 output.stderrShouldContain(stdout); |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
79 throw new Exception("stdoutShouldContain() failed to throw exception"); |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
80 } catch (RuntimeException e) { |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
81 // expected |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
82 } |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
83 |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
84 try { |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
85 output.shouldNotContain("cccc"); |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
86 output.stdoutShouldNotContain("cccc"); |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
87 output.stderrShouldNotContain("cccc"); |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
88 } catch (RuntimeException e) { |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
89 throw new Exception("shouldNotContain() failed", e); |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
90 } |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
91 |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
92 try { |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
93 output.shouldNotContain(stdout); |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
94 throw new Exception("shouldContain() failed to throw exception"); |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
95 } catch (RuntimeException e) { |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
96 // expected |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
97 } |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
98 |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
99 try { |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
100 output.stdoutShouldNotContain(stdout); |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
101 throw new Exception("shouldContain() failed to throw exception"); |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
102 } catch (RuntimeException e) { |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
103 // expected |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
104 } |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
105 |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
106 try { |
9056
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
107 output.stderrShouldNotContain(stderr); |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
108 throw new Exception("shouldContain() failed to throw exception"); |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
109 } catch (RuntimeException e) { |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
110 // expected |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
111 } |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
112 |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
113 // Should match |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
114 try { |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
115 output.shouldMatch(stdoutPattern); |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
116 output.stdoutShouldMatch(stdoutPattern); |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
117 output.shouldMatch(stderrPattern); |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
118 output.stderrShouldMatch(stderrPattern); |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
119 } catch (RuntimeException e) { |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
120 throw new Exception("shouldMatch() failed", e); |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
121 } |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
122 |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
123 try { |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
124 output.shouldMatch(nonExistingPattern); |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
125 throw new Exception("shouldMatch() failed to throw exception"); |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
126 } catch (RuntimeException e) { |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
127 // expected |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
128 } |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
129 |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
130 try { |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
131 output.stdoutShouldMatch(stderrPattern); |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
132 throw new Exception( |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
133 "stdoutShouldMatch() failed to throw exception"); |
7960
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
134 } catch (RuntimeException e) { |
9056
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
135 // expected |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
136 } |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
137 |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
138 try { |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
139 output.stderrShouldMatch(stdoutPattern); |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
140 throw new Exception( |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
141 "stderrShouldMatch() failed to throw exception"); |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
142 } catch (RuntimeException e) { |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
143 // expected |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
144 } |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
145 |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
146 // Should not match |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
147 try { |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
148 output.shouldNotMatch(nonExistingPattern); |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
149 output.stdoutShouldNotMatch(nonExistingPattern); |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
150 output.stderrShouldNotMatch(nonExistingPattern); |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
151 } catch (RuntimeException e) { |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
152 throw new Exception("shouldNotMatch() failed", e); |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
153 } |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
154 |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
155 try { |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
156 output.shouldNotMatch(stdoutPattern); |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
157 throw new Exception("shouldNotMatch() failed to throw exception"); |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
158 } catch (RuntimeException e) { |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
159 // expected |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
160 } |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
161 |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
162 try { |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
163 output.stdoutShouldNotMatch(stdoutPattern); |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
164 throw new Exception("shouldNotMatch() failed to throw exception"); |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
165 } catch (RuntimeException e) { |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
166 // expected |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
167 } |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
168 |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
169 try { |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
170 output.stderrShouldNotMatch(stderrPattern); |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
171 throw new Exception("shouldNotMatch() failed to throw exception"); |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
172 } catch (RuntimeException e) { |
3b890cd4da64
8009125: Add NMT tests for Virtual Memory operations
ctornqvi
parents:
7960
diff
changeset
|
173 // expected |
7960
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
174 } |
12238
9e11762cee52
8024650: Don't adjust MaxMetaspaceSize up to MetaspaceSize
stefank
parents:
9056
diff
changeset
|
175 |
9e11762cee52
8024650: Don't adjust MaxMetaspaceSize up to MetaspaceSize
stefank
parents:
9056
diff
changeset
|
176 { |
9e11762cee52
8024650: Don't adjust MaxMetaspaceSize up to MetaspaceSize
stefank
parents:
9056
diff
changeset
|
177 String aaaa = "aaaa"; |
9e11762cee52
8024650: Don't adjust MaxMetaspaceSize up to MetaspaceSize
stefank
parents:
9056
diff
changeset
|
178 String result = output.firstMatch(aaaa); |
9e11762cee52
8024650: Don't adjust MaxMetaspaceSize up to MetaspaceSize
stefank
parents:
9056
diff
changeset
|
179 if (!aaaa.equals(result)) { |
9e11762cee52
8024650: Don't adjust MaxMetaspaceSize up to MetaspaceSize
stefank
parents:
9056
diff
changeset
|
180 throw new Exception("firstMatch(String) faild to match. Expected: " + aaaa + " got: " + result); |
9e11762cee52
8024650: Don't adjust MaxMetaspaceSize up to MetaspaceSize
stefank
parents:
9056
diff
changeset
|
181 } |
9e11762cee52
8024650: Don't adjust MaxMetaspaceSize up to MetaspaceSize
stefank
parents:
9056
diff
changeset
|
182 } |
9e11762cee52
8024650: Don't adjust MaxMetaspaceSize up to MetaspaceSize
stefank
parents:
9056
diff
changeset
|
183 |
9e11762cee52
8024650: Don't adjust MaxMetaspaceSize up to MetaspaceSize
stefank
parents:
9056
diff
changeset
|
184 { |
9e11762cee52
8024650: Don't adjust MaxMetaspaceSize up to MetaspaceSize
stefank
parents:
9056
diff
changeset
|
185 String aa = "aa"; |
9e11762cee52
8024650: Don't adjust MaxMetaspaceSize up to MetaspaceSize
stefank
parents:
9056
diff
changeset
|
186 String aa_grouped_aa = aa + "(" + aa + ")"; |
9e11762cee52
8024650: Don't adjust MaxMetaspaceSize up to MetaspaceSize
stefank
parents:
9056
diff
changeset
|
187 String result = output.firstMatch(aa_grouped_aa, 1); |
9e11762cee52
8024650: Don't adjust MaxMetaspaceSize up to MetaspaceSize
stefank
parents:
9056
diff
changeset
|
188 if (!aa.equals(result)) { |
9e11762cee52
8024650: Don't adjust MaxMetaspaceSize up to MetaspaceSize
stefank
parents:
9056
diff
changeset
|
189 throw new Exception("firstMatch(String, int) failed to match. Expected: " + aa + " got: " + result); |
9e11762cee52
8024650: Don't adjust MaxMetaspaceSize up to MetaspaceSize
stefank
parents:
9056
diff
changeset
|
190 } |
9e11762cee52
8024650: Don't adjust MaxMetaspaceSize up to MetaspaceSize
stefank
parents:
9056
diff
changeset
|
191 } |
7960
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
192 } |
9be6cde7919d
8006413: Add utility classes for writing better multiprocess tests in jtreg
ctornqvi
parents:
diff
changeset
|
193 } |