BPELUnit Example

BPELUnit comes with an example BPEL process and test suite. The process was written from scratch as an example of a technical workflow: It implements a Meta Search ranging over the Search Engines Google and MSN. The Meta Search BPEL processes directly uses the MSN Web Service, and uses a Bridge (also provided as a BPEL process) to talk to the Google Web Service (due to the fact that Google uses rpc/encoded, while BPELUnit uses rpc/literal).

This section contains instructions for setting up an environment for editing and running the BPEL process and the BPELUnit test suite. This section assumes that the Oracle JDeveloper and BPEL PM Server and the BPELUnit Eclipse Client and Tool Support are used.

Contents

Setup

Before starting up, the Oracle BPEL PM Server and the BPELUnit Eclipse distribution must be installed. This is covered in the installation section. To enable editing and testing from within a single environment, it is advisable to point both the Oracle workspace and the Eclipse workspace to the same directory. This can be achieved by creating the projects in Eclipse first and importing them in JDeveloper, or vice versa. Here, we adopt the Eclipse-first approach.

The BPELUnit example is already available in a combined Eclipse/JDeveloper project format. The ZIP file should be extracted into the workspace directory of the Eclipse installation.

The BPELUnit example can be found at SourceForge: Download Meta Search Example

To open the projects in Eclipse, select File > Import > Existing projects into workspace and select the workspace directory itself as the root directory. The following two directories will be listed and imported:

To open the projects in JDeveloper, simply double-click the BPELUnit_Workspace.jws file in the Eclipse workspace directory. A new workspace named BPELUnit_workspace will be added to the JDeveloper IDE.

You can now simultaneously work on the projects in JDeveloper and Eclipse.

Editing and deploying the process

You'll be using the JDeveloper IDE to edit the BPEL processes, as it contains a graphical BPEL editor. To edit the Meta Search BPEL process in JDeveloper, choose the Integration Content subfolder inside a project, and double-click on the .bpel file inside this subfolder. You may also browse the WSDL files under Application Sources.

To deploy a process, you have two options:

The initial setting in the example test suites is fixed deployment (i.e. deployment from JDeveloper, not from BPELUnit), as this allows for a much quicker change of the BPEL process between tests, thus enabling a fast mode switch between testing and coding.

Running the tests

As mentioned above, the BPEL process Meta Search as discussed in the thesis has been imported into Eclipse together with its test suite. You can thus select the .bpts file from the project root to view the test suite specification.

As you can see, the test suite has the fixed deployer selected. As soon as you have deployed the processes in JDeveloper, you may select the .bpts file, right-click, and choose Run As > BPELUnit TestSuite. The tests will now be run.

To switch to the Oracle Deployer, you must first configure the deployer in the preferences dialog (Window > Preferences > BPELUnit > Deployment), as discussed here. Afterwards, select the Oracle Deployer in the test suite editor, and add the configuration option BPELJARFile, pointing to a JAR file containing the BPEL process (for example, the .jar files provided with the installations in the output folders of the projects, or a JAR file you have created in the JDeveloper IDE). BPELUnit will then deploy and undeploy the processes automatically.