mirror of
https://github.com/alibaba/testable-mock.git
synced 2025-01-25 03:40:38 +08:00
better log description, handling -> found
This commit is contained in:
parent
d4a69528a7
commit
c393d40d0d
@ -57,7 +57,7 @@ public class SourceClassHandler extends BaseClassHandler {
|
|||||||
|
|
||||||
private void transformMethod(MethodNode mn, Set<MethodInfo> memberInjectMethods,
|
private void transformMethod(MethodNode mn, Set<MethodInfo> memberInjectMethods,
|
||||||
Set<MethodInfo> newOperatorInjectMethods) {
|
Set<MethodInfo> newOperatorInjectMethods) {
|
||||||
LogUtil.diagnose(" Handling method %s", mn.name);
|
LogUtil.diagnose(" Found method %s", mn.name);
|
||||||
AbstractInsnNode[] instructions = mn.instructions.toArray();
|
AbstractInsnNode[] instructions = mn.instructions.toArray();
|
||||||
if (instructions.length == 0) {
|
if (instructions.length == 0) {
|
||||||
// native method (issue-52)
|
// native method (issue-52)
|
||||||
|
@ -66,14 +66,14 @@ public class TestableClassTransformer implements ClassFileTransformer {
|
|||||||
try {
|
try {
|
||||||
if (mockClassParser.isMockClass(cn)) {
|
if (mockClassParser.isMockClass(cn)) {
|
||||||
// it's a mock class
|
// it's a mock class
|
||||||
LogUtil.diagnose("Handling mock class %s", className);
|
LogUtil.diagnose("Found mock class %s", className);
|
||||||
bytes = new MockClassHandler(className).getBytes(bytes);
|
bytes = new MockClassHandler(className).getBytes(bytes);
|
||||||
BytecodeUtil.dumpByte(className, GlobalConfig.getDumpPath(), bytes);
|
BytecodeUtil.dumpByte(className, GlobalConfig.getDumpPath(), bytes);
|
||||||
} else {
|
} else {
|
||||||
String mockClass = foundMockForTestClass(className);
|
String mockClass = foundMockForTestClass(className);
|
||||||
if (mockClass != null) {
|
if (mockClass != null) {
|
||||||
// it's a test class with testable enabled
|
// it's a test class with testable enabled
|
||||||
LogUtil.diagnose("Handling test class %s", className);
|
LogUtil.diagnose("Found test class %s", className);
|
||||||
bytes = new TestClassHandler().getBytes(bytes);
|
bytes = new TestClassHandler().getBytes(bytes);
|
||||||
BytecodeUtil.dumpByte(className, GlobalConfig.getDumpPath(), bytes);
|
BytecodeUtil.dumpByte(className, GlobalConfig.getDumpPath(), bytes);
|
||||||
} else {
|
} else {
|
||||||
@ -81,7 +81,7 @@ public class TestableClassTransformer implements ClassFileTransformer {
|
|||||||
if (mockClass != null) {
|
if (mockClass != null) {
|
||||||
// it's a source class with testable enabled
|
// it's a source class with testable enabled
|
||||||
List<MethodInfo> injectMethods = mockClassParser.getTestableMockMethods(mockClass);
|
List<MethodInfo> injectMethods = mockClassParser.getTestableMockMethods(mockClass);
|
||||||
LogUtil.diagnose("Handling source class %s", className);
|
LogUtil.diagnose("Found source class %s", className);
|
||||||
bytes = new SourceClassHandler(injectMethods, mockClass).getBytes(bytes);
|
bytes = new SourceClassHandler(injectMethods, mockClass).getBytes(bytes);
|
||||||
BytecodeUtil.dumpByte(className, GlobalConfig.getDumpPath(), bytes);
|
BytecodeUtil.dumpByte(className, GlobalConfig.getDumpPath(), bytes);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user