Beanshell Launcher (beanshell.jar)The Beanshell launcher allows interfacing with beanshell test scripts.
It is provided with an additional module that first download and install the product but you can easily remove this part and recompile the launcher).
It has been tested with Beanshell 2.0b4
ConfigurationThe beanshell.xml file allows pre-configuring the launcher with some default values:
|General > Test root path||This must indicate where are located all the Beanshell scripts. This is a root path. Each test in XStudio has a canonical path that will be appended to this path.
This path MUST not include an ending slash.
Default value is: C:/beanshell/client
|Beanshell > Beanshell install path||This must indicate where is the Beanshell jar file
Default value is: C:/tools/beanshell-2.0b4/bsh-2.0b4.jar
|Installers > Folder containing the installers||Default value is: C:/products|
|Installers > Download server URL||Default value is: //NAS/Builds/trunk|
|Installers > Installer template name||Default value is: product-setup-%version%.exe|
These values can be changed while creating the campaign session from XStudio.
RequirementsThe launcher starts by downloading a setup program and install the product. The product
<installerTemplateName>(using the SUTVersion) is downloaded from
<downloadServerURL>and copied in
<folderContainingtheInstallers>. Then the product is installed by running the executable with the option /S (This is supposed that the installer is a NSIS installer).
1) Each test in XStudio must have his dedicated .bsh script. The name of the script MUST be equal to the name of the test.
2) The .bsh script must be able to parse the testcaseIndex argument passed during interpretation. This allows the script to execute different routines depending on the testcase index.
The interpreter is executed by the launcher using this syntax:
The tests are executed by the launcher using this syntax:
java -cp <beanshellInstallPath> bsh.Interpreter <testRootPath>/<testPath>/<testName>.bsh <testcaseIndex> <sutVersion>
And this is executed from the working directory
3) When the .bsh has executed all its actions, it MUST create an empty test_completed.txt file. Indeed, the executions of the TCL scripts are asynchronous. This mechanism allows the launcher to know when the test is completed.
4) the .bsh script must generate a log.txt during its execution. This file MUST describe all the actions performed by the test as well as the result of each action. This file will be parsed by the launcher and all the information will be passed/stored automatically in the XStudio database. The log.txt MUST respect a specific format: Each line MUST include the strings “[Success]", "[Failure]" or "[Log]" or the line will not be treated. Based on this information, the testcase will be flagged as passed or failed.