开发者

junit - share a fixture between testcase

I wonder whether it is possible to have a fixture that can be shared between testcases, for instance 开发者_如何转开发a hibernate session.


You want all your tests (not testcases) to share the same hibernate session ?

Create it in your setUp() method, only if it has not been already created, and store it in a static member of your testcase class, similar to a singleton implementation.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜