android学习笔记转--------------junit.framework.AssertionFailedError: No tests found in错误解决办法
2011-10-13 09:51
676 查看
package cn.hxyh.cal.test;
import junit.framework.TestCase;
import cn.hxyh.cal.dao.CaculatorDAO;
import cn.hxyh.cal.factory.CaculatorFactory;
public class TestCaculator extends TestCase {
public void TestAdd() {
CaculatorDAO ca = CaculatorFactory.getCaculatorDAO();
double result = ca.Add(3.5, 6.5);
assertEquals(10, result, 0);
}
}
---------------------------------------------------------------------------------------------------------------
junit.framework.AssertionFailedError: No tests found in cn.hxyh.cal.test.TestCaculator
at junit.framework.Assert.fail(Assert.java:47)
at junit.framework.TestSuite$1.runTest(TestSuite.java:97)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
-----------------------------------------------------------------------------------------------------------------
解决办法:
将大写的 TestAdd() 修改成 testAdd()即可,若是方法名仅为Add,请在方法名前加上test。
相关文章推荐
- android学习笔记转--------------junit.framework.AssertionFailedError: No tests found in错误解决办法
- junit.framework.AssertionFailedError: No tests found in错误解决办法
- junit.framework.AssertionFailedError: No tests found in错误解决办法
- junit.framework.AssertionFailedError: No tests found in错误解决办法
- junit.framework.AssertionFailedError: No tests found in错误解决办法
- [已解决]junit.framework.AssertionFailedError: No tests found in com.wbm.app.business.NeedLoginTestCase
- [已解决]junit.framework.AssertionFailedError: No tests found in
- junit.framework.AssertionFailedError: No tests found in
- junit.framework.AssertionFailedError: No tests found in com.hyh.test.MainTest
- eclipse下,使用junit4,报“no Junit tests found”错误的解决办法
- 安装mysql,在./configure时出现错误:error: No curses/termcap library found的解决办法
- 安装mysql,在./configure时出现错误:error: No curses/termcap library found的解决办法
- 安装mysql,在./configure时出现错误:error: No curses/termcap library found的解决办法
- git 出现The current branch is not configured for pull No value for key branch.master.merge found in configuration错误的解决办法
- 安装mysql,在./configure时出现错误:error: No curses/termcap library found的解决办法
- 安装mysql,在./configure时出现错误:error: No curses/termcap library found的解决办法(1)
- Keil编译S3C2440工程时出错:error: A1355U: A Label was found which was in no AREA 终级解决办法
- error: A1355U: A Label was found which was in no AREA 终级解决办法
- 安装mysql,在./configure时出现错误:error: No curses/termcap library found的解决办法
- 安装mysql,在./configure时出现错误:error: No curses/termcap library found的解决办法