Jaffa Logo
Home Contact Us FAQs Site Map
Source Forge: Homepage Bugs @ Sourceforge Mailing Lists @ Sourceforge Task Manager @ Sourceforge CVS @ Sourceforge
Jaffa Site
Jaffa Runtime
Jaffa RAD
Tools / Testingorg.jaffa.tools.loadtest


This document explains how to use the Load test module in JAFFA to perform scalability tests run against httpunit tests written for your application.


You may have a web application for which you already have httpunit tests written against it. Now wouldnít it be nice to have some tool which will run these unit tests and do some scalability tests and give an estimate as to how well does your application scale across multiple threads, which simulate the users using the system.

LoadTest module is the solution to this. With just two xml files ,which include the configuration and the build file, you can run your httpunit tests and the results are logged in a csv file.


The LoadTest module is part of the Jaffa tools and hence is packaged into jaffa-tools.jar. Hence you will require jaffa-tools.jar to run the Load Test .You should have your httpunit tests to test against.

Changes/Requirements to HttpUnit Tests

To comply with the LoadTest module you need to follow certain requirements while writing your httpunit tests.

  • All the Test Classes should extend the LoadTestCase class (org.jaffa.tools.loadtest.LoadTestCase)
  • Logon is performed via LoadTest module and hence use getWebConversation() and getWebResponse() to get the WebConversation and WebResponse object .If null , then perform your own custom logon.

How to Run LoadTest

As mentioned earlier to run the LoadTest (once the httpunittests are in place), you will need two xml files, one for the configuration and other to run the test.

Once you specify all the necessary parameters for running the test , the Test is run and the results are recorded into the csv format. The contents of the result set are discussed later in the section.

Configuration File

You can specify various parameters used to run the LoadTest using this configuration file. Below is a sample configuration file.To find out more about the tags for the xml file take a look at the xsd located at source\java\org\jaffa\tools\loadtest\domain\unitTestConfig_1_0.xsd

Example Config File
<?xml version="1.0" encoding="US-ASCII"?>
<!--You can have multiple test set -->
<!--This name will be used as the file name after to store the results of the LoadTest -->
<!--This is optional tag -->
    <description>Test the speed or various table read</description>
<!--This is the path where the result set , .csv file is stored -->
<!--This specifies the no of threads you want to run -->
<!--This specifies how many tests you want to run when it reaches the size specified the Load
    test ends.Even if there is only one unit test specified and the batc-size is 10 the same unit test
    is run 10 times and if there are 10 different unit tests and the batch-size is 10 then each unit
    test is run once -->
<!--This specifies the delay in milliseconds between each unit test .This is an optional tag-->
<-- This specifies how the tests should be run either sequentially or random -->
<-- From this point on you specify which unit tests to be run for this test-set and other parameters -->
<-- This is the class name for the unit test -->
<-- This is the method-name for the class specified above which should be run -->
<-- This log-on section allows you to specify the logon information for the above tests specified -->
<-- This is the class name which implements the Logon functionality -->
<--This specifies the url as a starting point for loggin into the application required to perform the tests  -->
<-- This specifies the title after successful logon-->
<logged-on-title>Welcome to JAFFA< /logged-on-title>
<-- This specifies the list of users who are valid users allowed to run the tests. Currently the users
    are picked randomly to run the tests -->

Run the LoadTest

Now once the parameters for configuring the LoadTest are specified run the class org.jaffa.tools.loadtest.LoadTester with the xml file specified above as an argument.

Make sure that the HttpunitTest.jar is created before running the LoadTest.

Here is a sample build file for running the LoadTest
<?xml version="1.0"?>
<project name="RunLoadTest" basedir="../../.." default="all">
  <path id="project.class.path">
    <fileset dir="lib">
    <fileset dir="dist/httpunittest">
      <include name="**/*.jar"/>
  <target name="all" depends="createHttpUnitTestJar">
    <java classname="org.jaffa.tools.loadtest.LoadTester" failonerror="true" fork="yes">
    <classpath refid="project.class.path"/>
    <arg value="${basedir}/source/httpunittest/build/sample_loadtest_config.xml"/>
  <target name="createHttpUnitTestJar">
      antfile    = "${basedir}/build/HttpUnitTestApp.xml"
      inheritall = "false"
      target     = "createHttpUnitTestJar"
      dir        = "${basedir}"

File: index.html, Last Modified: Thu Jun 26 2003 at 8:50:04am. This site has been built using PPWIZARD