< prev index next >

test/hotspot/jtreg/runtime/appcds/OldClassTest.java

Print this page

        

*** 22,32 **** * */ /* * @test ! * @summary classes with major version < JDK_6 (50) should not be included in CDS * @requires vm.cds * @library /test/lib * @modules java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.misc * java.management --- 22,32 ---- * */ /* * @test ! * @summary classes with major version < JDK_1.5 (48) should not be included in CDS * @requires vm.cds * @library /test/lib * @modules java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.misc * java.management
*** 59,82 **** System.out.println("Already up-to-date: " + jarFile); } String appClasses[] = TestCommon.list("Hello"); ! // CASE 1: pre-JDK 6 compiled classes should be excluded from the dump OutputAnalyzer output = TestCommon.dump(jar, appClasses); ! TestCommon.checkExecReturn(output, 0, true, "Pre JDK 6 class not supported by CDS"); TestCommon.run( "-cp", jar, "Hello") .assertNormalExit("Hello Unicode world (Old)"); // CASE 2: if we exlcude old version of this class, we should not pick up // the newer version of this class in a subsequent classpath element. String classpath = jar + File.pathSeparator + jarSrcFile.getPath(); output = TestCommon.dump(classpath, appClasses); ! TestCommon.checkExecReturn(output, 0, true, "Pre JDK 6 class not supported by CDS"); TestCommon.run( "-cp", classpath, "Hello") .assertNormalExit("Hello Unicode world (Old)"); --- 59,82 ---- System.out.println("Already up-to-date: " + jarFile); } String appClasses[] = TestCommon.list("Hello"); ! // CASE 1: pre-JDK 1.5 compiled classes should be excluded from the dump OutputAnalyzer output = TestCommon.dump(jar, appClasses); ! TestCommon.checkExecReturn(output, 0, true, "Pre JDK 1.5 class not supported by CDS"); TestCommon.run( "-cp", jar, "Hello") .assertNormalExit("Hello Unicode world (Old)"); // CASE 2: if we exlcude old version of this class, we should not pick up // the newer version of this class in a subsequent classpath element. String classpath = jar + File.pathSeparator + jarSrcFile.getPath(); output = TestCommon.dump(classpath, appClasses); ! TestCommon.checkExecReturn(output, 0, true, "Pre JDK 1.5 class not supported by CDS"); TestCommon.run( "-cp", classpath, "Hello") .assertNormalExit("Hello Unicode world (Old)");
*** 125,135 **** ClassWriter cw = new ClassWriter(0); FieldVisitor fv; MethodVisitor mv; AnnotationVisitor av0; ! cw.visit(V1_5, ACC_PUBLIC + ACC_SUPER, "Hello", null, "java/lang/Object", null); { mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null); mv.visitCode(); mv.visitVarInsn(ALOAD, 0); --- 125,136 ---- ClassWriter cw = new ClassWriter(0); FieldVisitor fv; MethodVisitor mv; AnnotationVisitor av0; ! //WAS cw.visit(V1_6, ACC_PUBLIC + ACC_SUPER, "Hello", null, "java/lang/Object", null); ! cw.visit(V1_4, ACC_PUBLIC + ACC_SUPER, "Hello", null, "java/lang/Object", null); { mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null); mv.visitCode(); mv.visitVarInsn(ALOAD, 0);
< prev index next >