开发者

Testing performance by catching the numbers of queries generated

开发者 https://www.devze.com 2023-03-23 01:20 出处:网络
We are using Hibernate. And Hibernate like any tools can be use badly and generate too much queries if it is used by a novice developer.

We are using Hibernate. And Hibernate like any tools can be use badly and generate too much queries if it is used by a novice developer.

In order to prevent this, i would like to test some dao againt real production database and assert that this test generate only N queries, no matter what tools is used (Hibernate, Ibatis) as long it is using jdbc underneath.

...
@MaxSqlQueries(5)
pu开发者_如何转开发blic void testPerformanceDao(){
}

We are using Spring test framework. I'm wondering if anyone has implemented such thing or any framework with Junit allows that.

Thanks in advance !


Update ! I have proposed this feature to the spring team test and it seems it will be implemented as it was already assigned to someone.
See SPR-8569

0

精彩评论

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