Go to junit. framework. AssertionFailedError: No tests

Source: Internet
Author: User

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 );
}

}
Bytes ---------------------------------------------------------------------------------------------------------------

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)

 

Bytes -----------------------------------------------------------------------------------------------------------------

Solution: www.2cto.com

Modify the capitalized TestAdd () to testAdd (). If the method name is only Add, Add test before the method name.

 

From running snails

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.