Running Junit Cases with Jmeter(Basic)
This post attempts to explain the basic design, functionality and usage of Junit Sampler for Jmeter. The sampler was introduced in 2.1.2 release of Jmeter. Earlier releases do not have the sampler. Design The current implementation supports standard Junit convention and extensions, like oneTimeSetUp and oneTimeTearDown. Other features can be added on request. The sampler works like the JavaSampler with some differences. 1. rather than use Jmeter's test interface, it scans the jar files for classes extending junit's TestCase class. This means any class or subclass. 2. Junit test jar files are copied to jmeter/lib/junit instead of jmeter/lib 3. Junit sampler does not use name/value pairs for configuration. The sampler assumes setUp and tearDown will configure the test correctly. Note: setUp and tearDown methods must be declared public, so that Jmeter can use it. 4. The sampler measures the elapsed time only for the test method and does not include setUp and tearDown