From 7e77f77fa2b4bae9cec48ec3a0a446573181a2e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=87=91=E6=88=9F?= Date: Tue, 17 Nov 2020 13:09:34 +0800 Subject: [PATCH] print count of mock method found --- .../com/alibaba/testable/agent/handler/SourceClassHandler.java | 2 ++ .../testable/agent/transformer/TestableClassTransformer.java | 1 + 2 files changed, 3 insertions(+) diff --git a/testable-agent/src/main/java/com/alibaba/testable/agent/handler/SourceClassHandler.java b/testable-agent/src/main/java/com/alibaba/testable/agent/handler/SourceClassHandler.java index fa72454..d34e369 100644 --- a/testable-agent/src/main/java/com/alibaba/testable/agent/handler/SourceClassHandler.java +++ b/testable-agent/src/main/java/com/alibaba/testable/agent/handler/SourceClassHandler.java @@ -52,6 +52,8 @@ public class SourceClassHandler extends BaseClassHandler { private void transformMethod(ClassNode cn, MethodNode mn, Set memberInjectMethods, Set newOperatorInjectMethods) { + LogUtil.debug(" Received %d member mock methods, %d constructor mock methods", + memberInjectMethods.size(), newOperatorInjectMethods.size()); AbstractInsnNode[] instructions = mn.instructions.toArray(); List memberInjectMethodList = new ArrayList(memberInjectMethods); int i = 0; diff --git a/testable-agent/src/main/java/com/alibaba/testable/agent/transformer/TestableClassTransformer.java b/testable-agent/src/main/java/com/alibaba/testable/agent/transformer/TestableClassTransformer.java index a1169db..280232f 100644 --- a/testable-agent/src/main/java/com/alibaba/testable/agent/transformer/TestableClassTransformer.java +++ b/testable-agent/src/main/java/com/alibaba/testable/agent/transformer/TestableClassTransformer.java @@ -79,6 +79,7 @@ public class TestableClassTransformer implements ClassFileTransformer { for (MethodNode mn : cn.methods) { checkMethodAnnotation(cn, methodInfos, mn); } + LogUtil.debug(" Found %d mock methods", methodInfos.size()); return methodInfos; } catch (Exception e) { return new ArrayList();