Junit安装运行自带的测试程序报错!

发布时间:2024-05-16 00:19 发布:上海旅游网

问题描述:

解压缩Junit包后,在ClassPath中加入junit.jar,运行文档中测试程序如下:
java junit.textui.TestRunner junit.samples.AllTests
报There was 1 error:
1) testJarClassLoading(junit.tests.runner.TestCaseClassLoaderTest)java.lang.ClassNotFoundException: junit.tests.runner.LoadedFromJar
at junit.runner.TestCaseClassLoader.lookupClassData(TestCaseClassLoader.java:124)
at junit.runner.TestCaseClassLoader.loadClassTestCaseClassLoader.java:1
01)
at junit.tests.runner.TestCaseClassLoaderTest.testJarClassLoading(TestCaseClassLoaderTest.java:33)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

FAILURES!!!
Tests run: 119, Failures: 0, Errors: 1

问题解答:

Junit安装运行自带的测试程序报错!这个旅游问答期待您的解答,请登录账号或关注微信公众号回答这个问题。

热点新闻