test/runtime/RedefineObject/TestRedefineObject.java

Thu, 18 Jul 2013 03:38:10 -0700

author
cl
date
Thu, 18 Jul 2013 03:38:10 -0700
changeset 5396
bb416ee2a79b
parent 5133
17db82f22f1e
child 5508
85147f28faba
permissions
-rw-r--r--

Added tag jdk8-b99 for changeset 81b6cb70717c

coleenp@5100 1 /*
coleenp@5100 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@5100 29 *
coleenp@5100 30 * @test
coleenp@5100 31 * @bug 8005056
coleenp@5100 32 * @library /testlibrary
coleenp@5100 33 * @build Agent
coleenp@5100 34 * @run main ClassFileInstaller Agent
ctornqvi@5133 35 * @run main TestRedefineObject
coleenp@5100 36 * @run main/othervm -javaagent:agent.jar Agent
coleenp@5100 37 */
ctornqvi@5133 38 public class TestRedefineObject {
coleenp@5100 39 public static void main(String[] args) throws Exception {
coleenp@5100 40
coleenp@5100 41 PrintWriter pw = new PrintWriter("MANIFEST.MF");
coleenp@5100 42 pw.println("Premain-Class: Agent");
coleenp@5100 43 pw.println("Can-Retransform-Classes: true");
coleenp@5100 44 pw.close();
coleenp@5100 45
coleenp@5100 46 ProcessBuilder pb = new ProcessBuilder();
coleenp@5100 47 pb.command(new String[] { JDKToolFinder.getJDKTool("jar"), "cmf", "MANIFEST.MF", "agent.jar", "Agent.class"});
coleenp@5100 48 pb.start().waitFor();
coleenp@5100 49 }
coleenp@5100 50 }

mercurial