/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.btrace.runtime;
import org.junit.Test;
/**
* Tests that shared methods have properly extended public access
* @author Jaroslav Bachorik
*/
public class BTRACE189Test extends InstrumentorTestBase {
@Test
public void annotatedClass() throws Exception {
originalBC = loadTargetClass("Main");
transform("issues/BTRACE189");
checkTrace(
"// access flags 0x9\n" +
"public static Lcom/sun/btrace/BTraceRuntime; runtime\n" +
"\n" +
"// access flags 0x49\n" +
"public static volatile I $btrace$$level = 0\n" +
"\n" +
"// access flags 0x9\n" +
"public static <clinit>()V\n" +
"TRYCATCHBLOCK L0 L1 L1 java/lang/Throwable\n" +
"L0\n" +
"LDC Ltraces/issues/BTRACE189;.class\n" +
"INVOKESTATIC com/sun/btrace/BTraceRuntime.forClass (Ljava/lang/Class;)Lcom/sun/btrace/BTraceRuntime;\n" +
"PUTSTATIC traces/issues/BTRACE189.runtime : Lcom/sun/btrace/BTraceRuntime;\n" +
"GETSTATIC traces/issues/BTRACE189.runtime : Lcom/sun/btrace/BTraceRuntime;\n" +
"INVOKESTATIC com/sun/btrace/BTraceRuntime.enter (Lcom/sun/btrace/BTraceRuntime;)Z\n" +
"IFNE L2\n" +
"INVOKESTATIC com/sun/btrace/BTraceRuntime.leave ()V\n" +
"RETURN\n" +
"L2\n" +
"INVOKESTATIC com/sun/btrace/BTraceRuntime.start ()V\n" +
"RETURN\n" +
"L1\n" +
"INVOKESTATIC com/sun/btrace/BTraceRuntime.handleException (Ljava/lang/Throwable;)V\n" +
"INVOKESTATIC com/sun/btrace/BTraceRuntime.leave ()V\n" +
"RETURN\n" +
"MAXSTACK = 1\n" +
"MAXLOCALS = 0\n" +
"\n" +
"TRYCATCHBLOCK L0 L1 L1 java/lang/Throwable\n" +
"GETSTATIC traces/issues/BTRACE189.runtime : Lcom/sun/btrace/BTraceRuntime;\n" +
"INVOKESTATIC com/sun/btrace/BTraceRuntime.enter (Lcom/sun/btrace/BTraceRuntime;)Z\n" +
"IFNE L0\n" +
"RETURN\n" +
"L0\n" +
"INVOKESTATIC com/sun/btrace/BTraceRuntime.leave ()V\n" +
"L1\n" +
"INVOKESTATIC com/sun/btrace/BTraceRuntime.handleException (Ljava/lang/Throwable;)V\n" +
"INVOKESTATIC com/sun/btrace/BTraceRuntime.leave ()V\n" +
"RETURN\n" +
"// access flags 0x9\n" +
"public static sharedMethod(Ljava/lang/String;)V"
);
}
}