IBM BPM, V8.0.1, All platforms > Authoring services in Integration Designer > Testing modules > Component testing > Automating tests using Ant scripts
Use Ant scripts for testing in headless IBM Process Server
In the headless (command line) batch processing environment of IBM BPM, you can use Ant scripts to automate the testing of component test projects, test suites, and test cases created in IBM Integration Designer. Ant scripts enable you to automatically perform numerous tasks, such as building and deploying your projects. Although IBM Integration Designer provides a headless batch processing environment that you can use to test component test projects, it is generally recommended that you use the headless environment of IBM BPM to use standard tools like serviceDeploy and wsadmin.
Another reason for using the headless environment of IBM BPM is to reduce the possibility of encountering performance problems when testing a large number of component test projects, test suites, or test cases. When the IBM BPM headless environment is used, only IBM BPM needs to be running. By comparison, when the IBM Integration Designer headless environment is used, both IBM BPM and IBM Integration Designer need to be running. Obviously, running IBM Process Server by itself is less taxing on system resources than running both IBM BPM and IBM Integration Designer at the same time, which means that you are less likely to encounter performance problems during your testing.
Although headless IBM Process Server is the recommended test environment, there are several kinds of artifacts that cannot be successfully tested in this environment and you should use headless IBM Integration Designer instead. These artifacts are described in the "Limitations" topic.
The following topics describe how to use Ant scripts for testing in the headless environment of IBM BPM:
- Overview of testing with Ant scripts in headless IBM BPM
If you have created component test projects, test suites, and test cases in IBM Integration Designer, you can use Ant scripts in conjunction with the serviceDeploy and wsadmin tools to automatically build, deploy, and test your projects in the headless (command line) batch processing environment of IBM BPM.
- Populating CVS with the required artifacts
If you are using CVS as your team repository, you need to ensure that the repository contains the required artifacts to support batch processing of component test projects before you can build, deploy, and test the projects in a headless batch processing environment.
- Configure an Ant script
An Ant script is used to initiate several tasks in the batch processing of component test projects, such as the building, deploying, and testing of the projects. You can create your own Ant script or modify the one that is displayed in this topic. By convention, the Ant script is named build.xml.- Running the Ant script
When you have finished configuring the Ant script, you are ready to run it.- Viewing the XML output file
When you finish your component testing, an XML output file is generated. You can view the XML output file to determine the results of your testing and see what tests cases passed or failed. The output file lists the tests that passed and failed and provides the start and stop times, which helps you spot performance problems. The start time and stop time of the entire test suite and each test case is listed in microseconds. These start and stop times are helpful in diagnosing applications with performance problems, such as a lengthy time period linked to a specific function that is a possible source of a bottleneck.- Additional servlet tasks
The servlet interface enables you to query test suites and test cases and run whole tests, partial tests, and specific test cases. The servlet is generated into the web project of the component test project. The servlet APIs can be incorporated in the script or used on a stand-alone basis. If used on a stand-alone basis, the application must be already deployed and the server running.- Examples of files used in batch component testing
Several different types of files are typically used to perform batch processing of component test projects in a command-line environment, such as Ant scripts and XSD files.- Limitations of batch testing in headless IBM BPM
From time to time, you may encounter some limitations in performing batch component testing in the headless environment of IBM BPM. In many situations, you can successfully work around these limitations.