jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Darren Hartford" <dhartf...@ghsinc.com>
Subject Junitperf on Cactus/Maven
Date Wed, 07 Apr 2004 14:44:25 GMT
Hey all,
Sharing my experience and looking for some feedback.

I have successfully used JunitPerf on top of the cactus-maven-plugin.  Unfortunately, the
results give me some doubt (the timed measures seem too sporadic) and I am hoping some of
you more active testers could test and give your feedback to share with the rest of us less
experienced testers on how to do performance/stress in-container testing.  =-)

Here is some sample code to get people rolling:

public class SimplePerfTestCase extends ServletTestCase {
	public SimplePerfTestCase(String name) {
	public static Test suite() {
	      TestSuite suite = new TestSuite();
	      suite.addTest(simpleLoadTest(5, 10, "testNothing"));
	      return suite;

	public void testNothing(){

    public void setUp(){}
    public void tearDown(){}

    private static Test simpleLoadTest(int users, int iterations, String testMethod) {
    	//if average is more than 2 seconds (per user/iteration), fail
            long maxElapsedTime = (2000 * users * iterations);
	        Test testCase = new SimplePerfTestCase(testMethod);
	        Test loadTest = new LoadTest(testCase, users, iterations);
              Test timedTest = new TimedTest(loadTest, maxElapsedTime);
	        return timedTest;

Unfortunately, I'm not sure how to extend the results to a report plugin in Maven for the
site generation task, but that's step two if this would accurately measure performance.

View raw message