21 * questions. |
21 * questions. |
22 */ |
22 */ |
23 |
23 |
24 /* |
24 /* |
25 * @test MethodMatcherTest |
25 * @test MethodMatcherTest |
26 * @modules java.base/jdk.internal.misc |
|
27 * @library /testlibrary /test/lib |
|
28 * @build sun.hotspot.WhiteBox |
|
29 * @run main ClassFileInstaller sun.hotspot.WhiteBox |
|
30 * sun.hotspot.WhiteBox$WhiteBoxPermission |
|
31 * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI MethodMatcherTest |
|
32 * @summary Testing of compiler/MethodMatcher |
26 * @summary Testing of compiler/MethodMatcher |
33 * @bug 8135068 |
27 * @bug 8135068 |
|
28 * @library /testlibrary /test/lib |
|
29 * @modules java.base/jdk.internal.misc |
|
30 * @build sun.hotspot.WhiteBox |
|
31 * @run driver ClassFileInstaller sun.hotspot.WhiteBox |
|
32 * sun.hotspot.WhiteBox$WhiteBoxPermission |
|
33 * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI |
|
34 * compiler.oracle.MethodMatcherTest |
34 */ |
35 */ |
|
36 |
|
37 package compiler.oracle; |
|
38 |
|
39 import sun.hotspot.WhiteBox; |
35 |
40 |
36 import java.lang.reflect.Method; |
41 import java.lang.reflect.Method; |
37 import java.util.ArrayList; |
42 import java.util.ArrayList; |
38 |
|
39 import sun.hotspot.WhiteBox; |
|
40 |
43 |
41 public class MethodMatcherTest { |
44 public class MethodMatcherTest { |
42 |
45 |
43 /** Instance of WhiteBox */ |
46 /** Instance of WhiteBox */ |
44 protected static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox(); |
47 protected static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox(); |
81 testCases.add(helper, "*Klass nonexistent::)(I[Ljava/lang/String;Ljava/lang/Integer;[B[[D)V", PARSING_FAILURE); |
84 testCases.add(helper, "*Klass nonexistent::)(I[Ljava/lang/String;Ljava/lang/Integer;[B[[D)V", PARSING_FAILURE); |
82 testCases.add(helper, "pool,su]b,Klass*,*)method*/", PARSING_FAILURE); |
85 testCases.add(helper, "pool,su]b,Klass*,*)method*/", PARSING_FAILURE); |
83 testCases.add(helper, "_pool,sub,Klass*,met@%hod,(0)V", PARSING_FAILURE); |
86 testCases.add(helper, "_pool,sub,Klass*,met@%hod,(0)V", PARSING_FAILURE); |
84 |
87 |
85 testCases.add(helper, "*.*", MATCH); |
88 testCases.add(helper, "*.*", MATCH); |
86 testCases.add(helper, "MethodMatcherTest.*", MATCH); |
89 testCases.add(helper, "compiler/oracle/MethodMatcherTest.*", MATCH); |
87 testCases.add(helper, "MethodMatcherTest.helper", MATCH); |
90 testCases.add(helper, "compiler/oracle/MethodMatcherTest.helper", MATCH); |
88 testCases.add(helper, "MethodMatcherTest.helper()", MATCH); |
91 testCases.add(helper, "compiler/oracle/MethodMatcherTest.helper()", MATCH); |
89 testCases.add(helper, "MethodMatcherTest.helper()V", MATCH); |
92 testCases.add(helper, "compiler/oracle/MethodMatcherTest.helper()V", MATCH); |
90 testCases.add(helper, "MethodMatcherTest.helper()V;", NO_MATCH); |
93 testCases.add(helper, "compiler/oracle/MethodMatcherTest.helper()V;", NO_MATCH); |
91 testCases.add(helper, "MethodMatcherTest.helper()I", NO_MATCH); |
94 testCases.add(helper, "compiler/oracle/MethodMatcherTest.helper()I", NO_MATCH); |
92 testCases.add(helper, "MethodMatcherTest.helperX", NO_MATCH); |
95 testCases.add(helper, "compiler/oracle/MethodMatcherTest.helperX", NO_MATCH); |
93 testCases.add(helper, "MethodMatcherTestX.helper;", NO_MATCH); |
96 testCases.add(helper, "compiler/oracle/MethodMatcherTest.helper;", NO_MATCH); |
94 testCases.add(helper, "abc.*", NO_MATCH); |
97 testCases.add(helper, "abc.*", NO_MATCH); |
95 testCases.add(helper, "*.abc", NO_MATCH); |
98 testCases.add(helper, "*.abc", NO_MATCH); |
96 |
99 |
97 testCases.add(getDate, "*.*", MATCH); |
100 testCases.add(getDate, "*.*", MATCH); |
98 testCases.add(getDate, "*.getDate", MATCH); |
101 testCases.add(getDate, "*.getDate", MATCH); |
99 testCases.add(getDate, "java/util/Date.getDate", MATCH); |
102 testCases.add(getDate, "java/util/Date.getDate", MATCH); |
100 testCases.add(getDate, "java/util/Date.*", MATCH); |
103 testCases.add(getDate, "java/util/Date.*", MATCH); |
101 |
104 |
102 testCases.add(inner, "*.*", MATCH); |
105 testCases.add(inner, "*.*", MATCH); |
103 testCases.add(inner, "MethodMatcherTest$TestCases.innerHelper", MATCH); |
106 testCases.add(inner, "compiler/oracle/MethodMatcherTest$TestCases.innerHelper", MATCH); |
104 testCases.add(inner, "MethodMatcherTest*.innerHelper", MATCH); |
107 testCases.add(inner, "compiler/oracle/MethodMatcherTest*.innerHelper", MATCH); |
105 testCases.add(inner, "MethodMatcherTest$*.innerHelper", MATCH); |
108 testCases.add(inner, "compiler/oracle/MethodMatcherTest$*.innerHelper", MATCH); |
106 testCases.add(inner, "*$TestCases.innerHelper", MATCH); |
109 testCases.add(inner, "*$TestCases.innerHelper", MATCH); |
107 testCases.add(inner, "*TestCases.innerHelper", MATCH); |
110 testCases.add(inner, "*TestCases.innerHelper", MATCH); |
108 testCases.add(inner, "TestCases.innerHelper", NO_MATCH); |
111 testCases.add(inner, "TestCases.innerHelper", NO_MATCH); |
109 testCases.add(inner, "MethodMatcherTest.innerHelper", NO_MATCH); |
112 testCases.add(inner, "compiler/oracle/MethodMatcherTest.innerHelper", NO_MATCH); |
110 |
113 |
111 testCases.add(toString, "*.*", MATCH); |
114 testCases.add(toString, "*.*", MATCH); |
112 testCases.add(toString, "java/lang/String.toString", MATCH); |
115 testCases.add(toString, "java/lang/String.toString", MATCH); |
113 testCases.add(toString, "java.lang.String::toString", MATCH); |
116 testCases.add(toString, "java.lang.String::toString", MATCH); |
114 |
117 |