Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix asm testcase. #2020

Merged
merged 2 commits into from
Aug 29, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@
import com.navercorp.pinpoint.profiler.instrument.mock.BasicInterceptor;
import com.navercorp.pinpoint.profiler.instrument.mock.ExceptionInterceptor;
import com.navercorp.pinpoint.profiler.instrument.mock.StaticInterceptor;
import com.navercorp.pinpoint.profiler.interceptor.registry.DefaultInterceptorRegistryBinder;
import com.navercorp.pinpoint.profiler.interceptor.registry.InterceptorRegistryBinder;
import com.navercorp.pinpoint.test.TestInterceptorRegistryBinder;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
Expand All @@ -36,26 +37,29 @@
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.fail;

public class ASMMethodNodeAdapterAddInterceptorTest {
private final static InterceptorRegistryBinder interceptorRegistryBinder = new DefaultInterceptorRegistryBinder();
private final static InterceptorRegistryBinder interceptorRegistryBinder = new TestInterceptorRegistryBinder();
private ASMClassNodeLoader.TestClassLoader classLoader;

@BeforeClass
public static void beforeClass() {
interceptorRegistryBinder.bind();
}

@AfterClass
public static void afterClass() {
interceptorRegistryBinder.unbind();
}

@Before
public void before() {
this.classLoader = ASMClassNodeLoader.getClassLoader();
Expand Down Expand Up @@ -471,7 +475,7 @@ private void invokeMethod(final Class clazz, final String methodName, final Clas
private Class addInterceptor(final int interceptorId, final String targetClassName, final Class<?> interceptorClass) {
final InterceptorDefinition interceptorDefinition = new InterceptorDefinitionFactory().createInterceptorDefinition(interceptorClass);
try {
classLoader.setTrace(true);
classLoader.setTrace(false);
classLoader.setVerify(false);
classLoader.setTargetClassName(targetClassName);
classLoader.setCallbackHandler(new ASMClassNodeLoader.CallbackHandler() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void before() {
@Test
public void rename() throws Exception {
final String targetClassName = "com.navercorp.pinpoint.profiler.instrument.mock.NormalClass";
classLoader.setTrace(true);
classLoader.setTrace(false);
classLoader.setTargetClassName(targetClassName);
classLoader.setCallbackHandler(new ASMClassNodeLoader.CallbackHandler() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ public void addInterceptor() throws Exception {

ASMClassNodeLoader.TestClassLoader classLoader = ASMClassNodeLoader.getClassLoader();

classLoader.setTrace(true);
classLoader.setVerify(true);
classLoader.setTrace(false);
classLoader.setVerify(false);
classLoader.setTargetClassName(targetClassName);
classLoader.setCallbackHandler(new ASMClassNodeLoader.CallbackHandler() {
@Override
Expand Down