< prev index next >

test/jdk/jdk/internal/reflect/constantPool/ConstantPoolTest.java

Print this page
rev 51958 : 8211122: Reduce the number of internal classes made accessible to jdk.unsupported
Reviewed-by: alanb, dfuchs, kvn
rev 51959 : resolve JDK-8211122


   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test
  26  * @bug 8141615
  27  * @summary Tests new public methods at ConstantPool
  28  * @modules java.base/jdk.internal.misc
  29  *          java.base/jdk.internal.reflect
  30  * @library /lib/testlibrary
  31  * @compile ConstantPoolTestDummy.jasm
  32  * @run main jdk.internal.reflect.constantPool.ConstantPoolTest
  33  */
  34 
  35 package jdk.internal.reflect.constantPool;
  36 
  37 import java.util.HashMap;
  38 import java.util.Map;
  39 import jdk.internal.misc.SharedSecrets;
  40 import jdk.testlibrary.Asserts;
  41 import jdk.internal.reflect.ConstantPool;

  42 
  43 public class ConstantPoolTest {
  44 
  45     private static final Class<?> TEST_CLASS = ConstantPoolTestDummy.class;
  46     private static final ConstantPool CP = SharedSecrets.getJavaLangAccess()
  47             .getConstantPool(TEST_CLASS);
  48 
  49     public static void main(String[] s) {
  50         for (TestCase testCase : TestCase.values()) {
  51             testCase.test();
  52         }
  53     }
  54 
  55     public static enum TestCase {
  56         GET_TAG_AT {
  57             {
  58                 referenceMap.put(1, ConstantPool.Tag.METHODREF);
  59                 referenceMap.put(2, ConstantPool.Tag.CLASS);
  60                 referenceMap.put(4, ConstantPool.Tag.UTF8);
  61                 referenceMap.put(10, ConstantPool.Tag.NAMEANDTYPE);




   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test
  26  * @bug 8141615
  27  * @summary Tests new public methods at ConstantPool
  28  * @modules java.base/jdk.internal.access
  29  *          java.base/jdk.internal.reflect
  30  * @library /lib/testlibrary
  31  * @compile ConstantPoolTestDummy.jasm
  32  * @run main jdk.internal.reflect.constantPool.ConstantPoolTest
  33  */
  34 
  35 package jdk.internal.reflect.constantPool;
  36 
  37 import java.util.HashMap;
  38 import java.util.Map;
  39 import jdk.internal.access.SharedSecrets;

  40 import jdk.internal.reflect.ConstantPool;
  41 import jdk.testlibrary.Asserts;
  42 
  43 public class ConstantPoolTest {
  44 
  45     private static final Class<?> TEST_CLASS = ConstantPoolTestDummy.class;
  46     private static final ConstantPool CP = SharedSecrets.getJavaLangAccess()
  47             .getConstantPool(TEST_CLASS);
  48 
  49     public static void main(String[] s) {
  50         for (TestCase testCase : TestCase.values()) {
  51             testCase.test();
  52         }
  53     }
  54 
  55     public static enum TestCase {
  56         GET_TAG_AT {
  57             {
  58                 referenceMap.put(1, ConstantPool.Tag.METHODREF);
  59                 referenceMap.put(2, ConstantPool.Tag.CLASS);
  60                 referenceMap.put(4, ConstantPool.Tag.UTF8);
  61                 referenceMap.put(10, ConstantPool.Tag.NAMEANDTYPE);


< prev index next >