开发者

junit - share a fixture between testcase

开发者 https://www.devze.com 2022-12-13 09:48 出处:网络
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 hibe

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

精彩评论

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