JMeter + JUnit : Class/Method level Load Test

JUnit is one of the de-facto standard unit testing framework, while JMeter is a popular open source load test tool. Both of them have make developers life easier.

However, both JUnit and JMeter have its own limitation.

Unit test with JUnit is often single threaded unless you use write your test case with library such as GroboUtils.

JMeter is good to load test application that expose an interface to receive request (i.e. HTTP, JMS, LDAP, etc), but it is not easy to load test internal component of the system.

And it is good that since version 2.1.2, JMeter have introduce a new sampler for load test: JUnit sampler.

With the same set of JUnit test case, you may create multiple combination of test plan in JMeter easily via drag and drop. Then configure the size of the Thread Group to increase the load of the test. Run the test, and you are done.

Besides load test the code in Class and Method level. You may use JUnit sampler as an compliment to build your own sampler that not provided in current JMeter distribution. For example, load test a SMSC via SMPP

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

AddThis Social Bookmark Button

Leave a Reply