What is it?

JUnitScenario is tool to simulate real life usage of applications. It allows you to describe scenarios that are composed of unit tests calls and simulate several users following those scenarios.


Unit testing with tools like JUnit is now common in the software industry; most applications that goes in a production environment had their business methods validated thanks to JUnit but very few had their scability being tested.

The code written in your unit tests is the code that users will call when the application will be in production. For example, in a banking account you would have JUnit methods like testCreateAccount() or testDepositMoney().

With JUnitScenario, you can write scripts that defines, for a scenario, the list of JunitMethods to call. This is an example:

<scenario name="cashier" users="20" loops="500">
  <task JUnitClass="org.mybank.MyFirstTest" JUnitMethod="testCreateAccount" wait="10"/>
  <task JUnitClass="org.mybank.MyFirstTest" JUnitMethod="testDipositMoney" wait="10"/>
  <task JUnitClass="org.mybank.MyFirstTest" JUnitMethod="testWithdrawMoney" wait="50"/>

This script defines the common work of a cashier. That is to say create an account, disposit and withdraw money on it. When launched, JUnitScenario will create 20 users executing the defined tasks and will stop when every user will have done it 500 times.

Like for ant, you just have to write a "scenarios.xml" file with all the scenarios definition and run the junitscenario command in that directory.

Thanks to this tool, before moving your application to a production environment, you have the warranty that your application can run with a certain number of users during a certain time.


JUnitScenario is a free software, you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation.

SourceForge.net Logo Scub Logo