test/runtime/RedefineObject/TestRedefineObject.java

Thu, 01 May 2014 14:57:02 -0700

author
amurillo
date
Thu, 01 May 2014 14:57:02 -0700
changeset 6651
4bc28e6b9aba
parent 6198
55fb97c4c58d
child 6876
710a3c8b516e
permissions
-rw-r--r--

Added tag hs25.20-b13 for changeset 798f5b02be89

coleenp@5100 1 /*
mikael@6198 2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
coleenp@5100 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
coleenp@5100 4 *
coleenp@5100 5 * This code is free software; you can redistribute it and/or modify it
coleenp@5100 6 * under the terms of the GNU General Public License version 2 only, as
coleenp@5100 7 * published by the Free Software Foundation.
coleenp@5100 8 *
coleenp@5100 9 * This code is distributed in the hope that it will be useful, but WITHOUT
coleenp@5100 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
coleenp@5100 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
coleenp@5100 12 * version 2 for more details (a copy is included in the LICENSE file that
coleenp@5100 13 * accompanied this code).
coleenp@5100 14 *
coleenp@5100 15 * You should have received a copy of the GNU General Public License version
coleenp@5100 16 * 2 along with this work; if not, write to the Free Software Foundation,
coleenp@5100 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
coleenp@5100 18 *
coleenp@5100 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
coleenp@5100 20 * or visit www.oracle.com if you need additional information or have any
coleenp@5100 21 * questions.
coleenp@5100 22 */
coleenp@5100 23 import java.io.PrintWriter;
coleenp@5100 24 import com.oracle.java.testlibrary.*;
coleenp@5100 25
coleenp@5100 26 /*
coleenp@5100 27 * Test to redefine java/lang/Object and verify that it doesn't crash on vtable
coleenp@5100 28 * call on basic array type.
coleenp@5508 29 * Test to redefine java/lang/ClassLoader and java/lang/reflect/Method to make
coleenp@5508 30 * sure cached versions used afterward are the current version.
coleenp@5100 31 *
coleenp@5100 32 * @test
coleenp@5100 33 * @bug 8005056
coleenp@5508 34 * @bug 8009728
coleenp@5100 35 * @library /testlibrary
coleenp@5100 36 * @build Agent
coleenp@5100 37 * @run main ClassFileInstaller Agent
ctornqvi@5133 38 * @run main TestRedefineObject
coleenp@5508 39 * @run main/othervm -javaagent:agent.jar -XX:TraceRedefineClasses=5 Agent
coleenp@5100 40 */
ctornqvi@5133 41 public class TestRedefineObject {
coleenp@5100 42 public static void main(String[] args) throws Exception {
coleenp@5100 43
coleenp@5100 44 PrintWriter pw = new PrintWriter("MANIFEST.MF");
coleenp@5100 45 pw.println("Premain-Class: Agent");
coleenp@5100 46 pw.println("Can-Retransform-Classes: true");
coleenp@5100 47 pw.close();
coleenp@5100 48
coleenp@5100 49 ProcessBuilder pb = new ProcessBuilder();
coleenp@5100 50 pb.command(new String[] { JDKToolFinder.getJDKTool("jar"), "cmf", "MANIFEST.MF", "agent.jar", "Agent.class"});
coleenp@5100 51 pb.start().waitFor();
coleenp@5100 52 }
coleenp@5100 53 }

mercurial