tags:

views:

117

answers:

2

I would like to run all junit 4 tests within my Eclipse project. The project is setup with /source and /test. Under /test are various packages, such as:

com.yaddayadda.test.core.entity
com.yaddayadda.test.core.framework

If I right-click at the /test level in Package Explorer and choose Run As; Junit Test I receive the error:

No tests found with test runner 'JUnit 4'.

If I right-click on com.yaddayadda.test.core.entity, then it finds and runs all the tests within that package. So the @Test annotations are correct (they are also picked up by Ant correctly on the build server). However, if I try and run all tests within com.yaddayadda.test.core then it finds none.

Basically, it only seems to look within the package rather the recusively at all children. Is there a way to fix this?

+1  A: 

First: Select your project in Project Explorer and press Alt+Shift+X T. It will run all the JUint tests under the project. The same can be done by right-clicking the project and selecting "Run as"->JUnit test.

If this does not work (which is likely), go to "Run/Run configurations", create a new JUnit configuration and tell it to run all the tests in your project. If this does not work, I'll need to have a look at your project before I can help.

Andrey Breslav
Both of these options result in: No tests found with test runner 'JUnit 4'.
WW
I would try to create a new project from scratch and copy the code there. It seems like a broken configuration.
Andrey Breslav
A: 

Did you add /test to Build Path -> Source Folders?

ShiDoiSi