'No JUnit tests found' in Eclipse

后端 未结 22 2745
闹比i
闹比i 2020-12-13 08:35

So I\'m new to JUnit, and we have to use it for a homework assignment. Our professor gave us a project that has one test class, BallTest.java. When I right clic

相关标签:
22条回答
  • 2020-12-13 09:05

    right click -> build path -> remove from build path and then again add it -> Right click on the folder named 'Test' > Build Path > Use as Source Folder.

    0 讨论(0)
  • 2020-12-13 09:06

    Click 'Run'->choose your JUnit->in 'Test Runner' select the JUnit version you want to run with.

    0 讨论(0)
  • 2020-12-13 09:07

    junit4 require that test classname should be use Test as suffix.

    0 讨论(0)
  • 2020-12-13 09:07

    In Eclipse Photon you may need to add JUnit 4 or 5 to the build path. Right click @Test and select 'Add JUnit 4 to build path'.

    0 讨论(0)
  • 2020-12-13 09:08

    Some time if lots if Test files are there then Eclipse failed to pass -classpath options for all libs and path due to classpath param lenght limitations. To Solve it go to Run

    Configerations -> JUnit -> Your Project Config -> ClassPath -> Check "Use Temporary Jar Options"
    

    At least it solved my problem.

    0 讨论(0)
  • 2020-12-13 09:10

    Any solution didn't work for me until I change the name of the my test method. When name of test method starts with "test" is OK. I am new in android programing and it was for me big surprise.

    0 讨论(0)
提交回复
热议问题