mirror of
https://github.com/alibaba/testable-mock.git
synced 2025-03-26 12:05:04 +08:00
add author doc
This commit is contained in:
parent
6103a691ce
commit
612173f193
@ -4,6 +4,9 @@ import com.alibaba.testable.transformer.TestableFileTransformer;
|
||||
|
||||
import java.lang.instrument.Instrumentation;
|
||||
|
||||
/**
|
||||
* @author flin
|
||||
*/
|
||||
public class PreMain {
|
||||
|
||||
public static void premain(String agentArgs, Instrumentation inst) {
|
||||
|
@ -1,5 +1,8 @@
|
||||
package com.alibaba.testable.model;
|
||||
|
||||
/**
|
||||
* @author flin
|
||||
*/
|
||||
public class MethodInfo {
|
||||
|
||||
private int access;
|
||||
|
@ -11,6 +11,9 @@ import java.security.ProtectionDomain;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author flin
|
||||
*/
|
||||
public class TestableFileTransformer implements ClassFileTransformer {
|
||||
|
||||
private static final String ENABLE_TESTABLE = "com.alibaba.testable.annotation.EnableTestable";
|
||||
@ -18,7 +21,7 @@ public class TestableFileTransformer implements ClassFileTransformer {
|
||||
private static final String SLASH = "/";
|
||||
private static final String TEST_POSTFIX = "Test";
|
||||
|
||||
private static Set<String> loadedClassNames = new HashSet<String>();
|
||||
private static final Set<String> loadedClassNames = new HashSet<String>();
|
||||
|
||||
public byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined,
|
||||
ProtectionDomain protectionDomain, byte[] classfileBuffer) {
|
||||
|
@ -11,7 +11,7 @@ public class MethodRecordVisitor extends ClassVisitor {
|
||||
/**
|
||||
* Member methods
|
||||
*/
|
||||
private List<MethodInfo> methods = new ArrayList<MethodInfo>();
|
||||
private final List<MethodInfo> methods = new ArrayList<MethodInfo>();
|
||||
private boolean needTransform;
|
||||
|
||||
private static final String ENABLE_TESTABLE_INJECT = "Lcom/alibaba/testable/annotation/EnableTestableInject;";
|
||||
|
@ -8,6 +8,9 @@ import org.objectweb.asm.Opcodes;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author flin
|
||||
*/
|
||||
public class TestableVisitor extends ClassVisitor {
|
||||
|
||||
private List<MethodInfo> methods;
|
||||
|
Loading…
Reference in New Issue
Block a user