alibaba / alibaba/testable-mock

添加依赖配置后,运行单元测试报错。maven项目配置,使用0.7.2和07.4版本都一样

Open
#266 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1.8k
Forks
306
PR merge metrics
No merged PRs in 30d

Description

java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386)
at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:401)
Caused by: java.lang.NoClassDefFoundError: com/alibaba/testable/core/util/LogUtil
at com.alibaba.testable.agent.config.PropertiesParser.parseFile(PropertiesParser.java:45)
at com.alibaba.testable.agent.PreMain.premain(PreMain.java:22)
... 6 more
Caused by: java.lang.ClassNotFoundException: com.alibaba.testable.core.util.LogUtil
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 8 more
FATAL ERROR in native method: processing of -javaagent failed

已经参考了:https://github.com/alibaba/testable-mock/issues/156
https://github.com/alibaba/testable-mock/issues/148
没有得到解决。

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the Maven unit-test failure and start with the stack trace locations in PropertiesParser.java and PreMain.java, focusing on why com.alibaba.testable.core.util.LogUtil is unavailable to the agent. Review the linked issues 156 and 148 for relevant configuration context; done means the configured tests start without the NoClassDefFoundError or agent failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.