运行CalculatorTest出错
我用jUnit 运行CalculatorTest, 有这些错误
java.lang.NoClassDefFoundError: org/junit/runner/manipulation/Filter
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadTestLoaderClass(RemoteTestRunner.java:377)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.createRawTestLoader(RemoteTestRunner.java:367)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.createLoader(RemoteTestRunner.java:362)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.defaultInit(RemoteTestRunner.java:306)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.init(RemoteTestRunner.java:221)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:205)
Caused by: java.lang.ClassNotFoundException: org.junit.runner.manipulation.Filter
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 8 more
为什么?
正在回答 回答被采纳积分+1
package com.junit.test;
import static org.junit.Assert.*;
import org.junit.Test;
public class CalculatorTest1 {
@Test
public void testAdd() {
fail("Not yet implemented");
}
@Test
public void testSubstract() {
fail("Not yet implemented");
}
@Test
public void testMultiply() {
fail("Not yet implemented");
}
@Test
public void testDivide() {
fail("Not yet implemented");
}
@Test
public void testSquareRoot() {
fail("Not yet implemented");
}
}
- 参与学习 人
- 提交作业 277 份
- 解答问题 4297 个
Java数据库开发的必备技能,从流行的MySQL数据库开始,到Java原生的数据库管理接口JDBC的使用,再到常用的数据持久化框架MyBatis,让你向Java工程师的目标又迈进了一步!
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星