Play 2.0 doesn't run all tests

2019-07-23 07:21发布

问题:

I'm porting an application over to Play 2.0 and for some reason it's not running all the tests. It finds all the test classes. But just doesn't run any tests in most of them. I tried moving the classes to the base of tests directory, but that didn't make a difference.

The tests it doesn't run contain tests for the persistence using hibernate JPA. The classes have a common base class for managing the database state across tests.

I'm expecting the persistence tests to blow up spectacularly but right I just get a green light because it doesn't run any of the tests in them.

回答1:

I'll answer my own in case someone else trips in to this.

If you have a failing setup step, say @BeforeClass annotated method throws an exception, then Play will report the test case as 0 out of 0 tests run.