android学习笔记转--------------junit.framework.AssertionFailedError: No tests found in错误解决办法
来源:互联网 发布:党规党纪面前知敬畏 编辑:程序博客网 时间:2024/06/01 07:23
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错误解决办法
- junit4 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.test at junit junit.framework.Asserti
- junit.framework.AssertionFailedError: No tests found in com.hyh.test.MainTest
- [已解决]junit.framework.AssertionFailedError: No tests found in com.wbm.app.business.NeedLoginTestCase
- junit.framework.AssertionFailedError: No...
- no junit tests found
- eclipse下,使用junit4,报“no Junit tests found”错误的解决办法
- Junit单元测试问题 junit.framework.AssertionFailedError: Method "test" not found at android.test.AndroidTes
- 解决No tests found in JUnit 4测试类
- Junit 报错:No tests Found in xx
- 使用junit4报“no Junit tests found”的错误
- android单元测试报错:junit.framework.AssertionFailedError: Method "xxx" not found解决方案:
- Java程序员的成长过程
- 关于消息提示框中换行的问题
- PHP模拟POST提交的2种方法 curl,fsockopen,HttpClient
- 字符串操作(一)
- Linux下PHP开发环境搭建-php,mysql,apache
- android学习笔记转--------------junit.framework.AssertionFailedError: No tests found in错误解决办法
- 马拦过河卒(NOIP2002)
- vc 下编写的 Windows窗口小程序 计算机
- Unix/Linux C++应用开发-make工具的使用
- 字符串操作(二)
- JS字符串处理函数
- java解惑1-表达式谜题
- <input type="text"> and <html:text> 禁止复制
- 关系型数据库管理系统比较