BWUnitUser GuideVersion 6

Contents

Introduction

BWUnit™ brings the power of unit testing to your TIBCO ActiveMatrix BusinessWorks™ development.

BWUnit™ follows in the footsteps of other code-driven testing frameworks such as JUnit, borrowing key concepts, including assertions and test fixtures and introduces them to the BusinessWorks™ development world. Effective unit testing with BWUnit™ allows your developers to isolate individual processes within your TIBCO BusinessWorks™ projects to show they function correctly and continue to function correctly.

This document will guide you through:

Resources

The BWUnit homepage can be found at http://windyroad.org/software/bwunit/ . Community discussion forums for BWUnit can be found at http://windyroad.org/discussion/ and the Windy Road team is looking forward answer your support questions at http://windyroad.org/support/ .

Related Software

BWUnit and it's example projects rely on the following software:

TIBant

TIBant provides a set of Apache Ant macros for building and deploying TIBCO BusinessWorks projects.

More information about TIBant can be found at http://windyroad.org/software/opensource/tibant/ and documentation for TIBant can be found at http://windyroad.org/static/TIBant-User-Guide.html

Apache Ant

Apache Ant is a software tool for automating software build processes. Ant uses XML to describe the build process and its dependencies. More information about Apache Ant can be found at http://en.wikipedia.org/wiki/Apache_Ant and documentation for Apache Ant can be found at http://ant.apache.org/manual/index.html

Apache Ant is a recommended requirement when using BWUnit, though the core functionality of BWUnit can be used without Apache Ant. In order to use the provided Apache Ant macros (including those for Unit Test Report generation) and to use the Apache Ant build scripts of the provided examples, Apache Ant 1.7.0 or later is required.

H2

H2 is a fast, light-weight Java SQL database. It's ability to run as an in-memory database make it ideal for unit testing.

More information about H2 can be found at http://www.h2database.com/html/main.html and the documentation for H2 can be found at http://www.h2database.com/html/quickstart.html

Apache ActiveMQ

Apache ActiveMQ is an open source implementation of the supporting JMS 1.1 standard. It's support for running as an in-memory (A.K.A. embedded) JMS Server make it ideal for unit testing.

More information about Apache ActiveMQ can be found at http://activemq.apache.org/ and the documentation for Apache ActiveMQ can be found at http://activemq.apache.org/getting-started.html

Conventions

The following conventions are used within this user guide:

Formatting Description
code Code fragments and command line examples are represented using this formatting.
${bwunit.home} Is used to represent the install location of BWUnit. e.g., C:\Program Files\Windy Road\BWUnit
${tibco.home} Is used to represent the base TIBCO installation path. e.g., C:\tibco
${user.home} Is used to represent your home directory. e.g., C:\Users\John Doe
${user.name} Is used to represent the login name of the current user. e.g., John Doe

© Windy Road Technology Pty. Limited 2009-2012. All Rights Reserved.

Installation

System Requirements

To use BWUnit, the following software and it's dependencies are required:

Name Version
TIBCO BusinessWorks 5.3 or later

The BWUnit Test Execution User Interface requires one of the following browsers:

Name Version
Firefox 9 or later
Chrome 16 or later
Safari 5.1 or later

If you need support for another browser, please let us know at http://windyroad.org/support/ .

Optional Requirements

Name Version Notes
Apache Ant 1.7.0 or later Required for automated test execution scripts

Installation Steps

We don't like complicated install processes. Simply:

Quick Start

To get started quickly with BWUnit, firstly open in TIBCO Designer the BusinessWorks project you would like to test.

Add the BWUnit DTL

Next add the BWUnit design time library to your project. This can be done by selecting the root folder for your project (it's the one just above AESchemas) and then selecting the "Design Time Libraries" tab. Click on the "+" button to add a new design time library. In the file dialog that appears, navigate to ${bwunit.home}, select BWUnit.projlib and click "Open".

Adding the BWUnit DTL
Adding the BWUnit DTL

Click "Apply" and then in the following dialog click "OK"

Set the File Aliases

Still in TIBCO Designer with your project open, click the "Edit" menu and select "Preferences". In TIBCO Designer Preferences dialog, select the "File Aliases" tab. Click the "New" button and in the "Alias" field enter "bwunit.jar". Double click the "File Path" field and a file dialog will appear. Navigate to ${bwunit.home}, select BWUnit.jar and click "Open". Repeat for commons-codec-1.3.jar and activation.jar, which are both in ${tibco.home}/tpcl/<VERSION>/lib/.

When you are done, your file aliases should look like:

Alias File Path
bwunit.jar ${bwunit.home}/BWUnit.jar
commons-codec-1.3.jar${tibco.home}/tpcl/<VERSION>/lib/commons-codec-1.3.jar
activation.jar ${tibco.home}/tpcl/<VERSION>/lib/activation.jar
BWUnit File Aliases
BWUnit File Aliases

Create a Test Suite

A Test Suite in BWUnit is used to logically group Test Cases and nested Test Suites. Create a Test Suite by creating a folder called "MyTestSuite" in your project in TIBCO Designer.

A Test Suite
A Test Suite

Create a Test Case

A Test Case in BWUnit is used to logically group Tests and to share a fixture between tests. Create a Test Case by creating a folder called "MyTestCase" in the "MyTestSuite" folder in your project in TIBCO Designer.

A Test Case
A Test Case

Create a Test

The easiest way to create is to copy the Test template in the BWUnit DTL. In TIBCO Desinger, find BWUnit/Public/Templates/Test, right click and select "Copy". Go back to MyTestSuite/MyTestCase, right click and select "Paste".

A Test
A Test

Run a Test

Load the test you created in the TIBCO Designer Tester, by selecting the "Tester" tab, pressing the green right arrow button, selecting the "Test" process you created and clicking "Load Selected".

Selecting a Test To Run
Selecting a Test To Run

Select Test.process in the Tester tab and click the "Create a job" button with the green process icon.

The Test.process will run and generate an error telling you test test has not been implemented

Selecting a Test To Run
Selecting a Test To Run

Implement Your Own Test Logic

Stop the tester and delete the "AssertFail" activity in your test. Add a "Call Process" activity to your test and set the Process Name (in the Call Process "Configuration" tab) to a process you want to test; it's easiest to start with a process that produces an output that is determined by its' input. In the "Input" tab input some suitable test data.

Add an "AssertEqual" to your test by dragging it from "BWUnit/Public/Asserts/AssertEqual". Add transitions from "Start" to your "Call Process", from "Call Process" to "AssertEqual" and from "AssertEqual" to "End".

Implementing A Test
Implementing A Test

In the "Input" for "AssertEqual" map the output of "Call Process" to under "equal-input/actual". Build the output you expect from "Call Process" under "equal-input/expected".

Run the test like you did before and if your process produces the output you expected then the test will finish succefully. If not, the error will contain both the expected and actual values, which can be used to adjust the expected input.

Run Your Test from The UI

Start the "BWUnit.process" in the Designer Tester and load http://localhost:5454 in your browser. When the BWUnit UI has finished loading you will be asked for your license. If you don't have a license, you can order one from http://windyroad.org/software/bwunit/licensing/

Installing your License
Installing your License

When you have installed your license, you'll see the test suite and test case you created listed under "TEST CASES" on the left. Select "MyTestCase" and click the "Run" button (or hit enter) to run your test. The UI will tell you if the test passed or failed.

Running a Test From The UI
Running a Test From The UI

Using the Example Projects

BWUnit comes with two example projects, which demonstrate different ways BWUnit can be used to test your projects.

Configuring the Example Projects

The example projects use a set of default paths to various TIBCO components. These defaults can be found in the beginning of ${bwunit.home}/lib/tibant/tibant.xml and are currently set to

tibco.home=c:/tibco
tibco.home.jre=${tibco.home}/jre/1.5.0
tibco.home.bw=${tibco.home}/bw/5.8
tibco.home.designer=${tibco.home}/designer/5.6
tibco.home.tra=${tibco.home}/tra/5.6
tibco.home.tpcl=${tibco.home}/tpcl/5.6
tibco.home.hawk=${tibco.home}/hawk
tibco.home.rv=${tibco.home}/tibrv/8.1

You can override these defaults by creating your own properties file with your own paths in either of the following locations:

Executing the Simple Example Tests from the UI

The Simple BWUnit example used a H2 in-memory database to replace the need for a production like database and to ensure the tests are repeatable. Similarly, Apache ActiveMQ is used to provide an in memory (A.K.A. embedded) JMS implementation, rather than requiring a JMS server for unit testing purposes.

To run the tests:

Executing the Example Tests from Ant

To run the Simple example's tests from Ant, run the Simple example's run-tests Ant target. e.g.,

cd ${bwunit.home}/Examples/Simple
ant run-test

The results will appear in the BWUnit/Examples/Simple/build/quick/Simple and BWUnit/Examples/Simple/build/uat/Simple folders.

Unit Testing with BWUnit

Integrating BWUnit with Your Project

Apache Ant is the preferred mechanism for integrating BWUnit with your project. However, as mentioned in the requirements section above, Apache Ant is not required for you to use the core BWUnit functionality.

The Apace Ant macros provided allow you to configure the class path and files aliases for you project within your build script, which can then be used to both when launching TIBCO Designer or runing your TIBCO BusinessWorks project (in order to execute its BWUnit tests). However, the main benefit of configuring your project's class path and files aliases from within an Apache Ant build script, is that the configuration can then be easily shared between developers and stored in version control.

Configuring your project to use Apache Ant is out of the scope of this document and the steps below assume your project already has a Apache Ant build script. If your project does not currently use Apache Ant, you might find the build.xml provided within the Simple example project to be a good starting point for your project.

Within your Apache Ant build.xml(You can place your build.xml anywhere within your project, however we recommend placement in the root directory as per recommendation #2 at http://onjava.com/pub/a/onjava/2003/12/17/ant_bestpractices.html):

  1. Set the bwunit.home property to the location your BWUnit installation. e.g.,:
    <property name="bwunit.home" value="C:/Program Files/Windy Road/BWUnit-1.3.0"/>
    
  2. The provided Apache Ant scripts expect specific versions of the TIBCO products to be installed in their default locations. You can override these defaults by setting the following properties(Supporting different development environment configurations can be difficult for any project. We support and use the recommendations made at http://www.javaranch.com/ant/properties.jsp. You can see this in action in the provided Simple example project.):
    <property name="tibco.home" value="c:/tibco"/>
    <property name="tibco.home.jre" value="${tibco.home}/jre/1.5.0"/>
    <property name="tibco.home.bw" value="${tibco.home}/bw/5.8"/>
    <property name="tibco.home.designer" value="${tibco.home}/designer/5.6"/>
    <property name="tibco.home.tra" value="${tibco.home}/tra/5.6"/>
    <property name="tibco.home.tpcl" value="${tibco.home}/tpcl/5.6"/>
    <property name="tibco.home.hawk" value="=${tibco.home}/hawk"/>
    <property name="tibco.home.rv" value="=${tibco.home}/tibrv/8.1"/>
    
  3. Add the following import directive:
    <import file="${bwunit.home}/util/bwunit.xml"/>
    
  4. Specify a namespace prefix for the BWUnit and TIBant macros, by adding xmlns:tibant="org.windyroad.tibant" and xmlns:bwunit="org.windyroad.bwunit" to the root project element in your build file. For example
    <project default="build" 
             name="MyProject" 
             xmlns:tibant="org.windyroad.tibant" 
             xmlns:bwunit="org.windyroad.bwunit">
    
  5. BWUnit and TIBant uses a number of Ant tasks provided by the ant-contrib library. If you do not already load ant-contrib in your build file, then you also need to add the following line after your BWUnit import call. This can be added either at the top level or within a target, so long as it get's called before any of the BWUnit or other TIBant macros.
    <tibant:load-ant-contrib/>
    
  6. Create a target to execute your BWUnit tests. e.g.,:
    <target name="run-tests" description="execute BWUnit Tests">
    </target>
    
  7. Within the target:
    • Create properties for the file aliases required by your project e.g.,:
      <property name="myproject.alias.some-lib.jar" file="some-path/some-lib.jar"/>
      <property name="myproject.alias.some-dtl.projlib" file="some-path/some-dtl.projlib"/>
      
    • Add those properties to a propertyset. e.g.,:
      <propertyset id="myproject.aliases">
          <propertyref prefix="myproject.alias." />
          <mapper type="glob" from="myproject.alias.*" to="*"/>
      </propertyset>
      
    • Add the bwunit:run-tests macro, with the dir attribute set to the directory containing your BusinessWorks project, the project name of the BusinessWorks project within that directory, the result-dest-dir attribute to the directory where you want the test reports saved and aliases-refid set to the id of your aliases propertyset. e.g.,:
      <bwunit:run-tests dir="src/bw" 
                        project="MyProject"
                        result-dest-dir="build/test-reports" 
                        aliases-refid="myproject.aliases"/>
      
      • The bwunit:run-tests macro can automatically configure your project's desing time libraries based on the the file aliases provided. To use this feature set the create-dtl-file attribute to true. e.g.,:
        <bwunit:run-tests dir="src/bw" 
                          project="MyProject"
                          result-dest-dir="build/test-reports"
                          aliases-refid="myproject.aliases"
                          create-dtl-file="true"/>
        
      • The bwunit:run-tests macro is designed to track dependencies and only re-execute the tests if one of those dependencies has changed. If desired, you can force it to run the tests every time, by setting the force attribute to true. e.g.,:
        <bwunit:run-tests dir="src/bw" 
                          project="MyProject"
                          result-dest-dir="build/test-reports"
                          aliases-refid="myproject.aliases"
                          force="true"/>
        
  8. Create a target to launch designer. e.g.,:
    <target name="designer" description="Launch Project in TIBCO Designer">
    </target>
    
  9. Within the target:
    • Create properties for the file aliases required by your project e.g.,:
      <property name="myproject.alias.some-lib.jar" file="some-path/some-lib.jar"/>
      <property name="myproject.alias.some-dtl.projlib" file="some-path/some-dtl.projlib"/>
      
    • Add those properties to a propertyset. e.g.,:
      <propertyset id="myproject.aliases">
          <propertyref prefix="myproject.alias." />
          <mapper type="glob" from="myproject.alias.*" to="*"/>
      </propertyset>
      
    • Add the tibant:designer macro, with the dir attribute set to the directory containing your BusinessWorks project, the project name of the BusinessWorks project within that directory, the aliases-refid set to the id of your aliases propertyset and create-dtl-file set to true. e.g.,:
      <tibant:designer dir="src/bw"
                       project="MyProject"
                       aliases-refid="myproject.aliases"
                       create-dtl-file="true" />
      
  10. Optionally, you can also create a script to launch your project in designer from your windowing environment. This allows you to maintain the advantages of using Ant to manage your file aliases and class paths, while still being able to launch designer with a double click. To do this, simply create a Windows BAT file or Unix shell script in your project's root directory, which calls the designer target you have created. For instance for Windows:
    ant designer

or for Unix

#!/bin/sh
cd `dirname $0`
ant designer

Your project is now configured to use BWUnit. Please see the 'Executing the Simple Example Tests from the UI' and the 'Executing the Example Tests from Ant' sections for how to execute the BWUnit you create tests within your project.

License Installation

When BWUnit is run via Apache Ant, the test run will fail if a license is not installed or if the license has expired. To allow license installation in situations where it is not possible or convenient to run the BWUnit UI, the bwunit:run-tests macro accepts a license attribute, which can be used the specify the license to use during the test run.

To install your license via Ant: 1. Follow the steps above 2. Prior to the bwunit:run-tests call, load your license file into a property. e.g.,

<loadfile srcFile="path/to/license.b64" property="my.bwunit.license">
 3.  Add a license attribute to your `bwunit:run-tests` call, set to the value of the property the license
was loaded into. e.g.,
<bwunit:run-tests dir="src/bw"
    project="Simple"
    result-dest-dir="build/test-reports"
    license="${my.bwunit.license}"/>

Setting Engine Properties from Ant

BW engine properties to be used when the bwunit:run-tests macro is run can be set from within Ant by creating a propertyset and passing the refid into the bwunit:run-tests macro via the properties-refid attribute. For instance to enable job statistics, use:

<property name="myproject.property.bw.engine.jobstats.enable" value="true"/>
<propertyset id="myproject.properties">
    <propertyref prefix="myproject.property." />
    <mapper type="glob" from="myproject.property.*" to="*"/>
</propertyset>

and then

<bwunit:run-tests dir="src/bw" 
                  project="MyProject"
                  result-dest-dir="build/test-reports"
                  properties-refid="myproject.properties"/>

Preventing Process Starters from Running

Often it is neccesary to disable certain processes starters during a test run. This can be done using the Config.Primary.Partitions engine property to limit the processes that are loaded. However when using this approach you must include BWUnit.process and all of your tests. This approach is demonstrated in the Simple example.

Setting Global Variables from Ant

Global Variables to be used when the bwunit:run-tests macro is run, can be set from within Ant by creating a propertyset and passing the refid into the bwunit:run-tests macro via the global-variables-refid attribute. For instance to change the port the BWUnit service uses to 6767, use:

<property name="myproject.globalvars.BWUnit/HTTP-service-port"
          value="6767"/>
<propertyset id="myproject.globalvars">
    <propertyref prefix="myproject.globalvars." />
    <mapper type="glob" from="myproject.globalvars.*" to="*"/>
</propertyset>

and then

<bwunit:run-tests dir="src/bw"
                  project="MyProject"
                  result-dest-dir="build/test-reports"
                  global-variables-refid="myproject.globalvars"/>

Setting File Aliases from Ant

File Aliases to be used when the bwunit:run-tests macro is run, can be set from within Ant by creating a propertyset and passing the refid into the bwunit:run-tests macro via the aliases-refid attribute. For instance to add myproject.jar as a file alias, use:

<property name="myproject.aliases.myproject.jar" value="some-path/myproject.jar"/>
<propertyset id="myproject.aliases">
    <propertyref prefix="myproject.aliases." />
    <mapper type="glob" from="myproject.aliases.*" to="*"/>
</propertyset>

and then

<bwunit:run-tests dir="src/bw"
                  project="MyProject"
                  result-dest-dir="build/test-reports"
                  aliases-refid="myproject.aliases"/>

Controlling the Class Path from Ant

If your project requires additional jar files or directories in the class path, you can manually set the class path using the custom-cp-ext-prepend and custom-cp-ext-append attributes. e.g.,

<bwunit:run-tests dir="src/bw"
                  project="MyProject"
                  result-dest-dir="build/test-reports" 
                  custom-cp-ext-prepend="%EXISTING-VALUE%;g:/a1/b1;d:/a2/b2/c.jar"/>

The %EXISTING-VALUE% token is replaced with the value of CUSTOM_EXT_PREPEND_CP or CUSTOM_EXT_APPEND_CP from your tra file repectivly.

Creating Tests and A Testing Hierarchy

BWUnit Tests are arranged in a hierarchy, comprised of folders. Test Suites can contain Test Cases and other Test Suites. Test Cases can contain Tests and optionally a Fixture.

Example Testing Hierarchy
Example Testing Hierarchy

Creating Test Suites

Test Suites represent a collection of Test Cases. To create a Test Suite, create a folder ending with TestSuite.

Creating Test Cases

Test Cases represent a collection of Tests that shared a common Fixture. To create a Test Case, create a folder within a Test Suite ending with TestCase.

Creating Tests

Tests contain the logic that verifies if your processes behave in the manner they are expected to. They provide a mechanism for encoding the requirements for the processes they test.

To create a Test:

  1. Copy the BWUnit/Public/Templates/Test.process into a Test Case.
  2. Rename the copy. Any name except Fixture is permitted.
  3. Modify it to call a process (or processes) you want to test.
  4. Enter specific input to the process (or processes).
  5. Add Asserts to check the output generated is what it is expected.

Example Tests

Example of a Simple Test
Example of a Simple Test

In the example above, a Call Process activity is used to link a specific customer to an account. Another Call Process activity is then used to retrieve the accounts linked to that customer. An Assert Equals is then used to check the the customer is linked to the correct number of accounts.

Example of a More Complex Test
Example of a More Complex Test

The example above is a unit test for AssertDoesNotEqual. Each instance of AssertDoesNotEqual is provided with a different input, to test different boundary conditions. When an error is expected, there is a success transition to an AssertFail and an error transition to an AssertEquals, which checks that the error generated matches the error we expect.

Creating Fixtures

Fixtures provide a mechanism for preparing (and cleaning up) the necessary state to run a particular test and expect a particular outcome. For instance, a fixture may create some records in an in-memory database, which the process being tested will query against.

To create a Fixture:

  1. copy BWUnit/Public/Templates/Fixture.process into a Test Case
  2. Add Activities to setup the required state in between the Start and the runWrappedTest activities.
  3. Add Activities to perform any required clean up after the test is run, in between the runWrappedTest and end activities.
Fixture Examples
Example of a Simple Fixture
Example of a Simple Fixture

In the example fixture above, a Call Process activity is used to spawn a stub, which will wait for a message, which will be sent by the test.

Example of a More Complex Fixture
Example of a More Complex Fixture

In the example fixture above, a transaction group is used with a generate error activity to rollback the database changes made by the Prep Data activity any changes that are made by the test. This ensures that each test within the test case this fixture belongs to, has the exact same data within the database for every single test run.

Adding Asserts to Tests

Asserts are used to confirm that the output of a call to a particular process is what is expected.

To add an assert to your test:

  1. Drag the desired assert from the Project pane to your process
  2. Create a transition to the assert from the desired activity
  3. Set the desired input on the Assert
  4. Create a transition from the Assert to the next desired Activity.

Generating Unit Test Reports

BWUnit generates Unit Test reports via the supplied bwunit:run-tests Apache Ant macro. As described in the Configuring Your Project to Use BWUnit section, the result-dest-dir attribute is used to specify the directory you want BWUnit to create the reports in. e.g., to generate the reports in build/test-reports, set the result-dest-dir attribute as follows:

<bwunit:run-tests dir="src/bw" project="MyProject"
                  result-dest-dir="build/test-reports"/>

The bwunit:run-tests Apache Ant macro creates the following files in the specified directory:

Name Description Purpose
results.status Contains the HTTP status code from calling the BWUnit runAllTestSuites Web Service operation. This file is used primarily for debugging purposes.
results.soap Contains the SOAP message returned from calling the BWUnit runAllTestSuites Web Service operation.This file is used for debugging purposes and to generate results.xml
results.xml Contains the BWUnit test report in a BWUnit specific XML format. This file is used as a record of the test results and as a basis for transformation into other formats.
Example HTML BWUnit Test Report
Example HTML BWUnit Test Report

Continuous Integration

BWUnit is designed to work with your Continuous Integration server, such as Hudson/Jenkins, CruiseControl or ThoughtWorks Go. The provided bwunit:run-tests Apache Ant macro produces XML output that can be converted to JUnit format using the bwunit:convert-to-junit-results Apache Ant macro, allowing your Continuous Integration server to clearly indicate which test(s) failed and why.

Simply configure your Continuous Integration server to call your test target and specify that the path to the JUnit formated test results.

For example, to have Jenins run the tests in the Simple Example that comes with BWUnit, the relevant settings are:

Section Field Value
Build Targets report-quick-tests report-uat-tests
Post-build Actions Publish JUnit test result report checked
Post-build Actions Test report XMLs build/quick/Simple.xml,build/uat/Simple.xml
Hudson Dashboard for the BWUnit Project Showing a Test Result Trend from BWUnit Tests
Hudson Dashboard for the BWUnit Project Showing a Test Result Trend from BWUnit Tests

Further Reading

xUnit Test Patterns

The xUnit Test Patterns book and website provide many unit testing patterns and approaches, along with anti-patterns or "smells". We highly recommend this book to anyone who is serious about unit testing. The website can be found at http://xunitpatterns.com/

Apache Ant Macros

The following section details each of the Apache Ant macros provided by BWUnit

bw-start

Starts a BusinessWorks engine locally, with BWUnit aliases

Attributes

Parameters specified as attributes.

NameDescriptionRequiredDefault
project

The name of the TIBCO Designer Project. e.g., MyProject

Yesn/a
dir

The directory the TIBCO Designer Project is in. e.g., src/bw

Yesn/a
aliases-refid

A propertyset refid for the file aliases needed by the project

No

empty-set

global-variables-refid

A propertyset refid for the Global variables to use when running the project. See the configure-ear macro for details of the default Global Variables.

No

empty-set

properties-refid

A propertyset refid for the properties to use when executing the BusinessWorks engine. For instance setting bw.engine.jobstats.enable to true will turn on Job Stats for the engine. See the configure-ear macro for details of the available engine properties.

No

empty-set

working-dir

The working directory. e.g., build/working/@{project}

No

build/working/@{project}

create-dtl-file

If true, create the /.designtimelibs file in the project root directory, based on the aliases referenced by aliases-refid.

(Available since version 1.4.1)

No

false

spawn

Whether or not you want the engine to be spawned. If you spawn the engine, its output will not be logged by ant.

No

false

heap-size

Specifies the initial Java heap size to allocate

No

${tibco.designer.heap.size}

custom-cp-ext-prepend

Customizable Classpath information. All classes and jars in these directories will be automatically picked up. You can also specify individual files. Use forward slashes only. e.g., g:/a1/b1;d:/a2/b2/c.jar

No

%EXISTING-VALUE%

custom-cp-ext-append

Customizable Classpath information. All classes and jars in these directories will be automatically picked up. You can also specify individual files. Use forward slashes only. e.g., g:/a1/b1;d:/a2/b2/c.jar

No

%EXISTING-VALUE%

application-args

Other arguments to application, JVM etc.

No
tasknameNo

bwunit:bw-start

bw-stop

Invokes a SOAP operation on a BWUnit BW engine to stop it

Attributes

Parameters specified as attributes.

NameDescriptionRequiredDefault
hostNo

localhost

portNo

${BWUnit/HTTP-service-port}

stop-max-waitNo

60

stop-max-wait-unitNo

second

stop-timeout-propertyNo

bwunit.stop.timeout

fail-on-stop-timeoutNo

true

tasknameNo

bwunit:bw-stop

convert-to-html-results

Attributes

Parameters specified as attributes.

NameDescriptionRequiredDefault
file

The BWUnit Results file to convert.

Yesn/a
tofile

The file to write the JUnit formated results to.

Yesn/a

convert-to-junit-results

Converts the specified BWUnit results file into JUnit format

Attributes

Parameters specified as attributes.

NameDescriptionRequiredDefault
file

The BWUnit Results file to convert.

Yesn/a
tofile

The file to write the JUnit formated results to.

Yesn/a
hostname

The hostname to insert into the results.

No

localhost

convert-to-nunit-results

Converts the specified BWUnit results file into NUnit format

Attributes

Parameters specified as attributes.

NameDescriptionRequiredDefault
file

The BWUnit Results file to convert.

Yesn/a
tofile

The file to write the NUnit formated results to.

Yesn/a
project

Name of the project that was tested

Yesn/a

designer

Opens a project in TIBCO Designer, with BWUnit aliases

Attributes

Parameters specified as attributes.

NameDescriptionRequiredDefault
project

The name of the TIBCO Designer Project. e.g., MyProject

Yesn/a
dir

The directory the TIBCO Designer Project is in. e.g., src/bw

Yesn/a
aliases-refid

A propertyset refid for the file aliases needed by the project

No

empty-set

global-variables-refid

A propertyset refid for the Global Variables to set prior to launching designer. The specified Global Variables will have their values replaced within the projects defaultVars.substvar files and the original values will be lost. USE WITH CAUTION!

No

empty-set

working-dir

The working directory to launch TIBCO Designer from. e.g., build/working/@{project}

No

build/working/@{project}

create-dtl-file

If true, create the /.designtimelibs file in the project root directory, based on the aliases referenced by alaises-refid

No

true

heap-size

Specifies the initial Java heap size to allocate

No

256M

custom-path

this will be prepended to tibco.env.PATH

No

%EXISTING-VALUE%

custom-cp-ext

this will be prepended to tibco.class.path.extended

No

%EXISTING-VALUE%

custom-palette-path

this will be prepended to java.property.palettePath

No

%EXISTING-VALUE%

custom-lib-path

this will be prepended to tibco.env.LD_LIBRARY_PATH, tibco.env.SHLIB_PATH, tibco.env.LIBPATH

No

%EXISTING-VALUE%

application-args

Specifies the remaining command line arguments to pass into the application -d : to activate the debug info dump -help : to print a list of acceptable command line arguments

No
tasknameNo

bwunit:designer

install-license-local

Installs a BWUnit license locally

Attributes

Parameters specified as attributes.

NameDescriptionRequiredDefault
license

Your BWUnit license

Yesn/a

run-tests

Starts a BusinessWorks engine locally and executes the project's BWUnit tests.

Attributes

Parameters specified as attributes.

NameDescriptionRequiredDefault
project

The name of the TIBCO Designer Project. e.g., MyProject

Yesn/a
dir

The directory the TIBCO Designer Project is in. e.g., src/bw

Yesn/a
aliases-refid

A propertyset refid for the file aliases needed by the project

No

empty-set

global-variables-refid

A propertyset refid for the Global variables to use when running the project. See the configure-ear macro for details of the default Global Variables.

No

empty-set

properties-refid

A propertyset refid for the properties to use when executing the BusinessWorks engine. For instance setting bw.engine.jobstats.enable to true will turn on Job Stats for the engine. See the configure-ear macro for details of the available engine properties.

No

empty-set

working-dir

The working directory. e.g., build/working/@{project}

No

build/working/@{project}

create-dtl-file

If true, create the /.designtimelibs file in the project root directory, based on the aliases referenced by aliases-refid

No

true

heap-size

Specifies the initial Java heap size to allocate

No

256M

custom-cp-ext-prepend

Customizable Classpath information. All classes and jars in these directories will be automatically picked up. You can also specify individual files. Use forward slashes only. e.g., g:/a1/b1;d:/a2/b2/c.jar

No

%EXISTING-VALUE%

custom-cp-ext-append

Customizable Classpath information. All classes and jars in these directories will be automatically picked up. You can also specify individual files. Use forward slashes only. e.g., g:/a1/b1;d:/a2/b2/c.jar

No

%EXISTING-VALUE%

application-args

Other arguments to application, JVM etc.

No
result-dest-dir

The directory to store the results. e.g., build/bwunit-results

No

build/bwunit-results

scope

The path within your BW Project to start looking for Test Suites.

No

/

suite-pattern

The regex pattern to use when searching for test suites. e.g., TestSuite$

No

TestSuite$

case-pattern

The regex pattern to use when searching for test cases e.g., TestCase$

No

TestCase$

fixture-pattern

The regex pattern to use when searching for fixtures e.g., ^Fixture$

No

^Fixture$

force

If true the tests will be re-executed. Otherwise the tests will only be re-executed if any of the dependancies are older than the previous results

No

false

failonerror

If true, fail the build if a test fails

No

false

license

If set, the provide license is installed prior to test execution. Otherwise the previoulsy install license will be used.

No
start-max-wait

The number of time units to wait for the BWEngine to start before executing the tests. If the BWUnit service port is not available after the specified number of time units, the test run will abort and the start-timeout-property will be set.

No

2

start-max-wait-unit

The unit of time to wait for the BWEngine to start before executing the tests. If the BWUnit service port is not available after the start-max-wait number of time units, the test run will abort and the start-timeout-property will be set.

No

minute

start-timeout-property

The property to set if the BWUnit port is not available after the specied wait period.

No

bwunit.start.timeout

stop-max-wait

The number of time units to wait for the BWEngine to stop after executing the tests. If the BWUnit service port in still available after the specified number of time units, the stop-timeout-property will be set.

No

60

stop-max-wait-unit

The unit of time to wait for the BWEngine to stop after executing the tests. If the BWUnit service port is still available after the stop-max-wait number of time units, the stop-timeout-property will be set.

No

second

stop-timeout-property

The property to set if the BWUnit port is still available after the specied wait period.

No

bwunit.stop.timeout

tasknameNo

bwunit:run-tests

validate-project

Allows you to validate resources within a TIBCO BusinessWorks Project, with BWUnit aliases.

NOTE: On Linux based systems an X-server is required to run the validate executable that this macro uses. On headless systems Xvfb can be used to meet this requirement: http://www.x.org/releases/X11R7.6/doc/man/man1/Xvfb.1.xhtml

(Available since version 1.6)

Attributes

Parameters specified as attributes.

NameDescriptionRequiredDefault
project

The name of the TIBCO Designer Project. e.g., MyProject

Yesn/a
dir

The directory the TIBCO Designer Project is in. e.g., src/bw

Yesn/a
expected-errors

The number of errors expected during validation. If the number of validation errors does not equal this value then the macro will fail.

Normally you whould not change this from 0, however there are times when a project produce validation errors (e.g. when using the preceding-sibling XPath axis), but you have confirmed that it does operate correclty. In these situations, you can still use this macro to validate your project, by specifying the number of expected errors.

NOTE: The macro will fail if there are less errors than expected. This is to prevent situations where you have a number of expected validation errors, and then someone makes a change which results in one of them being removed. At this point, unless this macro fails, it would be possible for new unexpected validation errors (that have not been confirmed to operate correctly) to be introduced.

No

0

max-warnings

The maximum number of warnings permitted during validation. If the number of validation warnings exceeds this value then the macro will fail.

No

unlimited

aliases-refid

A propertyset refid for the file aliases needed by the project

No

empty-set

working-dir

The working directory. e.g., build/working/@{project}

No

build/working/@{project}

create-dtl-file

If true, create the /.designtimelibs file in the project root directory, based on the aliases referenced by aliases-refid

No

false

out

The output file for the validation results, build/working/@{project}/validation.log

No

build/working/@{project}/validation.log

force

Force the re-validation of the project, even if it has not changed.

No

false

heap-size

Specifies the initial Java heap size to allocate

No

${tibco.designer.heap.size}

custom-path

the value to use for tibco.env.PATH

No

%EXISTING-VALUE%

custom-cp-ext

the value to use for tibco.class.path.extended

No

%EXISTING-VALUE%

custom-palette-path

the value to use for java.property.palettePath

No

%EXISTING-VALUE%

custom-lib-path

the value to use for tibco.env.LD_LIBRARY_PATH, tibco.env.SHLIB_PATH and tibco.env.LIBPATH

No

%EXISTING-VALUE%

application-args

Specifies the remaining command line arguments to pass into the application

  • -d: to activate the debug info dump
  • -help: to print a list of acceptable command line arguments
No
tasknameNo

tibant:validate-project