Re: Tools for J2EE Project

Mike Clark <[email protected]> Tue, 26 Mar 2002 19:56:29 -0700
Newsgroups gmane.comp.java.ejb.general
Organization Clarkware Consulting, Inc.
Message-ID <[email protected]>
Hi Francis,


> BTW, anyone know of any *free* test tools that will allow you to define
> your tests via JavaDoc tags ala XDoclet?  (I know of one tool whose name
> escapes me , but said tool has a license fee & proprietary execution
> environment attached).  What about performance measuring tools for server
> side components?

If you're already into JUnit and Cactus, you can use JUnitPerf to decorate existing JUnit tests for performance and scalability testing.

The following example runs the "testSomething" test case method with a 10 concurrent user load.  Each user runs the test case method 5 times.  The load
test is in turn decorated as a timed test that fails if the total elapsed time of the load test exceeds 10 seconds.

    public static Test suite() {

        int maxUsers = 10;
        int iterations = 5;
        long maxElapsedTime = 10000;

        Test testCase = new YourTestCase("testSomething");
        Test loadTest = new LoadTest(testCase, maxUsers, iterations);
        Test timedTest = new TimedTest(loadTest, maxElapsedTime);

        TestSuite suite = new TestSuite();
        suite.addTest(timedTest);

        return suite;
    }

JUnitPerf is open source and available at:

    http://www.clarkware.com/software/JUnitPerf.html


Mike

--
Mike Clark
Clarkware Consulting, Inc.
http://www.clarkware.com
720.851.2014