< prev index next >

test/compiler/jvmci/compilerToVM/LookupTypeTest.java

Print this page
rev 11557 : 8132919: use package in compiler tests
Reviewed-by: duke


  23 
  24 /*
  25  * @test
  26  * @bug 8136421
  27  * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
  28  * @library / /testlibrary
  29  * @library ../common/patches
  30  * @modules java.base/jdk.internal.misc
  31  * @modules jdk.vm.ci/jdk.vm.ci.hotspot
  32  * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  33  * @build compiler.jvmci.compilerToVM.LookupTypeTest
  34  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
  35  *                   compiler.jvmci.compilerToVM.LookupTypeTest
  36  */
  37 
  38 package compiler.jvmci.compilerToVM;
  39 
  40 import compiler.jvmci.common.testcases.DoNotExtendClass;
  41 import compiler.jvmci.common.testcases.MultiSubclassedClass;
  42 import compiler.jvmci.common.testcases.SingleSubclass;
  43 import java.util.HashSet;
  44 import java.util.Set;
  45 import jdk.vm.ci.hotspot.CompilerToVMHelper;
  46 import jdk.vm.ci.hotspot.HotSpotResolvedObjectType;
  47 import jdk.test.lib.Asserts;
  48 import jdk.test.lib.Utils;


  49 



  50 public class LookupTypeTest {
  51     public static void main(String args[]) {
  52         LookupTypeTest test = new LookupTypeTest();
  53         for (TestCase tcase : createTestCases()) {
  54             test.runTest(tcase);
  55         }
  56     }
  57 
  58     private static Set<TestCase> createTestCases() {
  59         Set<TestCase> result = new HashSet<>();
  60         // a primitive class
  61         result.add(new TestCase(Utils.toJVMTypeSignature(int.class),
  62                 LookupTypeTest.class, true, false, InternalError.class));
  63         // lookup not existing class
  64         result.add(new TestCase("Lsome_not_existing;", LookupTypeTest.class,
  65                 true, false, ClassNotFoundException.class));
  66         // lookup invalid classname
  67         result.add(new TestCase("L!@#$%^&**()[]{}?;", LookupTypeTest.class,
  68                 true, false, ClassNotFoundException.class));
  69         // lookup package private class




  23 
  24 /*
  25  * @test
  26  * @bug 8136421
  27  * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
  28  * @library / /testlibrary
  29  * @library ../common/patches
  30  * @modules java.base/jdk.internal.misc
  31  * @modules jdk.vm.ci/jdk.vm.ci.hotspot
  32  * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  33  * @build compiler.jvmci.compilerToVM.LookupTypeTest
  34  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
  35  *                   compiler.jvmci.compilerToVM.LookupTypeTest
  36  */
  37 
  38 package compiler.jvmci.compilerToVM;
  39 
  40 import compiler.jvmci.common.testcases.DoNotExtendClass;
  41 import compiler.jvmci.common.testcases.MultiSubclassedClass;
  42 import compiler.jvmci.common.testcases.SingleSubclass;




  43 import jdk.test.lib.Asserts;
  44 import jdk.test.lib.Utils;
  45 import jdk.vm.ci.hotspot.CompilerToVMHelper;
  46 import jdk.vm.ci.hotspot.HotSpotResolvedObjectType;
  47 
  48 import java.util.HashSet;
  49 import java.util.Set;
  50 
  51 public class LookupTypeTest {
  52     public static void main(String args[]) {
  53         LookupTypeTest test = new LookupTypeTest();
  54         for (TestCase tcase : createTestCases()) {
  55             test.runTest(tcase);
  56         }
  57     }
  58 
  59     private static Set<TestCase> createTestCases() {
  60         Set<TestCase> result = new HashSet<>();
  61         // a primitive class
  62         result.add(new TestCase(Utils.toJVMTypeSignature(int.class),
  63                 LookupTypeTest.class, true, false, InternalError.class));
  64         // lookup not existing class
  65         result.add(new TestCase("Lsome_not_existing;", LookupTypeTest.class,
  66                 true, false, ClassNotFoundException.class));
  67         // lookup invalid classname
  68         result.add(new TestCase("L!@#$%^&**()[]{}?;", LookupTypeTest.class,
  69                 true, false, ClassNotFoundException.class));
  70         // lookup package private class


< prev index next >