An Introduction to Business Process Testing using JProcessUnitby Reza Shafii The automated testing of software components is widely accepted as a best practice within the software development field. BEA WebLogic Integration 8.1 Java Process Definitions (JPD) can be manually tested using the BEA WebLogic Workshop 8.1 test browser. However, this solution does not provide developers the capability of writing automated JUnit-based test cases. This article introduces the JProcessUnit API CodeShare project and demonstrates how it can be used to create well-defined, JUnit-based automated test cases for WebLogic Integration JPDs. Why Test Java Process DefinitionsAutomated testing leads to the development of higher quality software applications. Such tests allow for the repeated execution and verification of different elements and facets of an application, a practice that is sure to decrease the likelihood of undetected software errors. To increase software quality, therefore, automated tests should be written for as many software components as possible. Further, the more critical the software component in question, the more important it becomes to have automated tests verifying its functionality. Java Process Definitions abstract important business integration elements such as data transformation, trading partner integration, connectivity, and message brokering. Moreover, JPDs model and automate an organization's business processes by orchestrating the interactions of internal application components, end users, and external systems or services. This ability allows JPDs to play a key role in the development of composite applications as specified by the BEA SOA Domain Model. Given these critical functions, the automated testing of JPDs therefore plays a very important part in increasing the quality of WebLogic Integration applications. With the benefits of creating automated tests for JPDs in mind, I'll give you a closer look at how this can be achieved by using the JProcessUnit API. Please note that this article assumes existing familiarity with the JUnit framework. How To Test Business Processes Using JProcessUnitAs can be seen by the class diagram in Figure 1, JProcessUnit test cases are based on the JUnit framework. A JProcessUnit
Figure 2 shows how a set of
With the JProcessUnit testing paradigm If the integration between a JPD and an external system is achieved through more tightly coupled RPC based protocols, the creation of Also note that during the construction of a JProcessUnit test case, we don't necessarily need to worry about the number of JPDs involved. We can instead test a business process that is started through the initiation of a particular JPD whether this involves child JPDs or not. This idea is illustrated in Figure 2 by a test case for a business process involving JPDs 1 and 2. The analysis of this paradigm should lead to an important question: How does one make sure the server artifacts are properly cleaned up after tests are executed? For example, if a test case fails after the process has created a task, I would not want to leave the task around in a pending state and would want it removed. To take care of this problem, you can choose to use the undo feature of JProcessUnit. This feature allows you to build a list of JProcessUnit events as undo events. You can then execute the undo events, in the sequential order in which they were added, by calling the Now that you have a better idea of how JProcessUnit events can be used to test WebLogic Integration business processes, I will briefly explore the inner working of these events. Note that detailed descriptions of the JProcessUnit events are not provided in this article; for this information you should refer to the project's API documentation. |
Article Tools Related Products Check out the products mentioned in this article:Bookmark Article
|