mirror of
https://github.com/alibaba/testable-mock.git
synced 2025-01-24 19:31:17 +08:00
fix loging
This commit is contained in:
parent
7b2f967626
commit
1ced04bf29
@ -40,7 +40,7 @@ public class TestClassHandler extends BaseClassWithContextHandler {
|
||||
protected void transform(ClassNode cn) {
|
||||
Framework framework = checkFramework(cn);
|
||||
if (framework == null) {
|
||||
LogUtil.warn("Failed to detect test framework for " + cn.name);
|
||||
LogUtil.warn("Failed to detect test framework for %s", cn.name);
|
||||
return;
|
||||
}
|
||||
if (!framework.hasTestAfterMethod) {
|
||||
@ -50,7 +50,7 @@ public class TestClassHandler extends BaseClassWithContextHandler {
|
||||
handleTestableUtil(mn);
|
||||
handleTestCaseMethod(mn, framework);
|
||||
}
|
||||
LogUtil.diagnose(String.format(" Found %d test cases", testCaseCount));
|
||||
LogUtil.diagnose(" Found %d test cases", testCaseCount);
|
||||
}
|
||||
|
||||
private Framework checkFramework(ClassNode cn) {
|
||||
@ -96,7 +96,7 @@ public class TestClassHandler extends BaseClassWithContextHandler {
|
||||
private void handleTestCaseMethod(MethodNode mn, Framework framework) {
|
||||
TestCaseMethodType type = framework.checkMethodType(mn);
|
||||
if (type.equals(TestCaseMethodType.TEST)) {
|
||||
LogUtil.verbose(String.format(" Test case \"%s\"", mn.name));
|
||||
LogUtil.verbose(" Test case \"%s\"", mn.name);
|
||||
injectMockContextInit(mn);
|
||||
testCaseCount++;
|
||||
} else if (type.equals(TestCaseMethodType.AFTER_TEST)) {
|
||||
|
@ -186,7 +186,7 @@ public class TestableClassTransformer implements ClassFileTransformer {
|
||||
ClassNode innerClassNode = ClassUtil.getClassNode(ic.name);
|
||||
if (ic.name.equals(getInnerMockClassName(cn.name)) && mockClassParser.isMockClass(innerClassNode)) {
|
||||
if ((ic.access & ACC_STATIC) == 0) {
|
||||
LogUtil.warn(String.format("Mock class in \"%s\" is not declared as static", cn.name));
|
||||
LogUtil.warn("Mock class in \"%s\" is not declared as static", cn.name);
|
||||
} else {
|
||||
ic.access = BytecodeUtil.toPublicAccess(ic.access);
|
||||
return ic.name;
|
||||
|
Loading…
Reference in New Issue
Block a user