test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveMethodTest.java
equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
37 import jdk.vm.ci.runtime.JVMCI; |
37 import jdk.vm.ci.runtime.JVMCI; |
38 import org.junit.Test; |
38 import org.junit.Test; |
39 |
39 |
40 import static org.junit.Assert.assertEquals; |
40 import static org.junit.Assert.assertEquals; |
41 import static org.junit.Assert.assertNull; |
41 import static org.junit.Assert.assertNull; |
|
42 import static org.junit.Assert.assertNotNull; |
42 |
43 |
43 public class ResolvedJavaTypeResolveMethodTest { |
44 public class ResolvedJavaTypeResolveMethodTest { |
44 public final MetaAccessProvider metaAccess; |
45 public final MetaAccessProvider metaAccess; |
45 |
46 |
46 public ResolvedJavaTypeResolveMethodTest() { |
47 public ResolvedJavaTypeResolveMethodTest() { |
115 ResolvedJavaType a = getType(A.class); |
116 ResolvedJavaType a = getType(A.class); |
116 ResolvedJavaType b = getType(B.class); |
117 ResolvedJavaType b = getType(B.class); |
117 ResolvedJavaType c = getType(C.class); |
118 ResolvedJavaType c = getType(C.class); |
118 ResolvedJavaMethod priv = getMethod(a, "priv"); |
119 ResolvedJavaMethod priv = getMethod(a, "priv"); |
119 |
120 |
120 assertNull(a.resolveMethod(priv, c)); |
121 // nestmates have access to private methods |
121 assertNull(b.resolveMethod(priv, c)); |
122 assertNotNull(a.resolveMethod(priv, c)); |
|
123 assertNotNull(b.resolveMethod(priv, c)); |
122 } |
124 } |
123 |
125 |
124 @Test |
126 @Test |
125 public void testAbstractMethod() { |
127 public void testAbstractMethod() { |
126 ResolvedJavaType a = getType(A.class); |
128 ResolvedJavaType a = getType(A.class); |