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:

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

        public void testNothing(){
                assertTrue(true);
        }

    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;
      }
}
===code===

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.
-D

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to