author | neliasso |
Tue, 20 Oct 2015 18:07:28 +0200 | |
changeset 33451 | 0712796e4039 |
child 34218 | 4b22b04519e6 |
permissions | -rw-r--r-- |
33451
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
1 |
/* |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
2 |
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
4 |
* |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
8 |
* |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
13 |
* accompanied this code). |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
14 |
* |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
18 |
* |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
21 |
* questions. |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
22 |
*/ |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
23 |
|
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
24 |
/* |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
25 |
* @test InlineMatcherTest |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
26 |
* @bug 8074095 |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
27 |
* @library /testlibrary /../../test/lib |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
28 |
* @run main ClassFileInstaller sun.hotspot.WhiteBox |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
29 |
* sun.hotspot.WhiteBox$WhiteBoxPermission |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
30 |
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI InlineMatcherTest |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
31 |
* @summary Testing of compiler/InlineMatcher |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
32 |
*/ |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
33 |
|
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
34 |
import java.lang.reflect.Method; |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
35 |
import java.util.ArrayList; |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
36 |
import sun.hotspot.WhiteBox; |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
37 |
|
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
38 |
public class InlineMatcherTest { |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
39 |
|
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
40 |
/** Instance of WhiteBox */ |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
41 |
protected static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox(); |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
42 |
|
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
43 |
Method helper; |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
44 |
Method getDate; |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
45 |
Method inner; |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
46 |
Method toString; |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
47 |
|
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
48 |
final public static int FORCE_INLINE = 2; |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
49 |
final public static int DONT_INLINE = 1; |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
50 |
final public static int NO_MATCH = 0; |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
51 |
final public static int PARSING_FAILURE = -1; |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
52 |
|
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
53 |
public InlineMatcherTest() { |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
54 |
|
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
55 |
} |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
56 |
|
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
57 |
public void test() throws Exception { |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
58 |
// instantiate before calling getMethod on innerHelper |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
59 |
TestCases testCases = new TestCases(); |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
60 |
|
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
61 |
helper = getMethod(InlineMatcherTest.class, "helper"); |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
62 |
|
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
63 |
testCases.add(helper, "*.*", PARSING_FAILURE); |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
64 |
testCases.add(helper, "+*.*", FORCE_INLINE); |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
65 |
testCases.add(helper, "++*.*", NO_MATCH); // + is a valid part of the |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
66 |
// class name |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
67 |
testCases.add(helper, "-*.*", DONT_INLINE); |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
68 |
testCases.add(helper, "--*.*", NO_MATCH); // - is a valid part of the |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
69 |
// class name |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
70 |
|
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
71 |
testCases.add(helper, "+InlineMatcherTest.*", FORCE_INLINE); |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
72 |
testCases.add(helper, "+InlineMatcherTest.helper", FORCE_INLINE); |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
73 |
testCases.add(helper, "+InlineMatcherTest.helper()", FORCE_INLINE); |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
74 |
testCases.add(helper, "+InlineMatcherTest.helper()V", FORCE_INLINE); |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
75 |
testCases.add(helper, "+InlineMatcherTest.helper(", FORCE_INLINE); |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
76 |
|
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
77 |
testCases.add(helper, "-InlineMatcherTest.*", DONT_INLINE); |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
78 |
testCases.add(helper, "-InlineMatcherTest.helper", DONT_INLINE); |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
79 |
testCases.add(helper, "-InlineMatcherTest.helper()", DONT_INLINE); |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
80 |
testCases.add(helper, "-InlineMatcherTest.helper()V", DONT_INLINE); |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
81 |
testCases.add(helper, "-InlineMatcherTest.helper(", DONT_INLINE); |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
82 |
|
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
83 |
testCases.add(helper, "+abc.*", NO_MATCH); |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
84 |
testCases.add(helper, "+*.abc", NO_MATCH); |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
85 |
testCases.add(helper, "-abc.*", NO_MATCH); |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
86 |
testCases.add(helper, "-*.abcls ", NO_MATCH); |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
87 |
|
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
88 |
int failures = 0; |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
89 |
|
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
90 |
for (TestCase t : testCases) { |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
91 |
System.out.println("Test case: " + t.pattern); |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
92 |
if (!t.test()) { |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
93 |
failures++; |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
94 |
System.out.println(" * FAILED"); |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
95 |
} |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
96 |
} |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
97 |
if (failures != 0) { |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
98 |
throw new Exception("There where " + failures + " failures in this test"); |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
99 |
} |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
100 |
} |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
101 |
|
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
102 |
public static void main(String... args) throws Exception { |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
103 |
InlineMatcherTest test = new InlineMatcherTest(); |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
104 |
test.test(); |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
105 |
} |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
106 |
|
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
107 |
public void helper() { |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
108 |
|
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
109 |
} |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
110 |
|
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
111 |
private static Method getMethod(Class klass, String name, Class<?>... parameterTypes) { |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
112 |
try { |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
113 |
return klass.getDeclaredMethod(name, parameterTypes); |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
114 |
} catch (NoSuchMethodException | SecurityException e) { |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
115 |
throw new RuntimeException("exception on getting method Helper." + name, e); |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
116 |
} |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
117 |
} |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
118 |
|
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
119 |
class TestCase { |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
120 |
String pattern; |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
121 |
Method testTarget; |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
122 |
int expectedResult; |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
123 |
|
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
124 |
public TestCase(Method testTarget, String pattern, int expectedResult) { |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
125 |
this.testTarget = testTarget; |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
126 |
this.pattern = pattern; |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
127 |
this.expectedResult = expectedResult; |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
128 |
} |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
129 |
|
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
130 |
public String resultAsStr(int errorCode) { |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
131 |
switch (errorCode) { |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
132 |
case PARSING_FAILURE: |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
133 |
return "Parsing failed"; |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
134 |
case NO_MATCH: |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
135 |
return "No match"; |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
136 |
case DONT_INLINE: |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
137 |
return "Dont Inline"; |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
138 |
case FORCE_INLINE: |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
139 |
return "Force Inline"; |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
140 |
default: |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
141 |
return "Unknown error"; |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
142 |
} |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
143 |
} |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
144 |
|
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
145 |
boolean test() { |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
146 |
int result = WHITE_BOX.matchesInline(testTarget, pattern); |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
147 |
if (result != expectedResult) { |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
148 |
System.out |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
149 |
.println("FAIL Wrong result, Got: " + resultAsStr(result) + "\n TestCase: " + this.toString()); |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
150 |
return false; |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
151 |
} |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
152 |
return true; |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
153 |
} |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
154 |
|
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
155 |
@Override |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
156 |
public String toString() { |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
157 |
return "Method: '" + testTarget.toString() + "' Pattern: '" + pattern + "' Expected: " |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
158 |
+ resultAsStr(expectedResult); |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
159 |
} |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
160 |
|
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
161 |
public void innerHelper() { |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
162 |
|
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
163 |
} |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
164 |
} |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
165 |
|
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
166 |
class TestCases extends ArrayList<TestCase> { |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
167 |
private static final long serialVersionUID = 1L; |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
168 |
|
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
169 |
public boolean add(Method testTarget, String pattern, int expectedResult) { |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
170 |
return super.add(new TestCase(testTarget, pattern, expectedResult)); |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
171 |
} |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
172 |
} |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
diff
changeset
|
173 |
} |