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:
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/ .
BWUnit and it's example projects rely on the following software:
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 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 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 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
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.
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/ .
| Name | Version | Notes |
|---|---|---|
| Apache Ant | 1.7.0 or later | Required for automated test execution scripts |
We don't like complicated install processes. Simply:
C:\Program Files\Windy Road\BWUnit or
/opt/windyroad/bwunitTo get started quickly with BWUnit, firstly open in TIBCO Designer the BusinessWorks project you would like to test.
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".
Click "Apply" and then in the following dialog click "OK"
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 |
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 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.
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".
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".
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
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".
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.
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/
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.
BWUnit comes with two example projects, which demonstrate different ways BWUnit can be used to test your 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.1You can override these defaults by creating your own properties file with your own paths in either of the following locations:
${user.home}/build.properties or
BWUnit/Examples/*/config/${user.name}.propertiesThe 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:
designer.bat or the designer.sh script. These scripts execute an Apache Ant script
to launch TIBCO Designer and expect the Apache Ant executable to be in your path.
BWUnit process, the Simple/Public/Starters/Simple
service and the Simple/Stubs/SOAPStub/STUB-sendFax process (normally the stubs are loaded
automatically, however an issues in TIBCO Designer prevents this from happening in this case.
See Defect 34 for details: https://windyroad.assembla.com/spaces/bwunit/tickets/34).
license.b64 onto the drop zone. If you don't have a license, you can order one from
http://windyroad.org/software/bwunit/licensing/
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-testThe results will appear in the BWUnit/Examples/Simple/build/quick/Simple and BWUnit/Examples/Simple/build/uat/Simple
folders.
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):
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"/>
<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"/>
<import file="${bwunit.home}/util/bwunit.xml"/>
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">
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/>
<target name="run-tests" description="execute BWUnit Tests"> </target>
<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"/>
<propertyset id="myproject.aliases">
<propertyref prefix="myproject.alias." />
<mapper type="glob" from="myproject.alias.*" to="*"/>
</propertyset>
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"/>
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"/>
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"/>
<target name="designer" description="Launch Project in TIBCO Designer"> </target>
<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"/>
<propertyset id="myproject.aliases">
<propertyref prefix="myproject.alias." />
<mapper type="glob" from="myproject.alias.*" to="*"/>
</propertyset>
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" />
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.
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}"/>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"/>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.
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"/>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"/>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.
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.
Test Suites represent a collection of Test Cases. To create a Test Suite, create a folder ending with
TestSuite.
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.
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:
BWUnit/Public/Templates/Test.process into a Test Case.
Fixture is permitted.
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.
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.
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:
BWUnit/Public/Templates/Fixture.process into a Test Case
Start and the runWrappedTest
activities.
runWrappedTest and end activities.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.
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.
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:
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. |
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 |
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/
The following section details each of the Apache Ant macros provided by BWUnit
Starts a BusinessWorks engine locally, with BWUnit aliases
Parameters specified as attributes.
| Name | Description | Required | Default |
|---|---|---|---|
| project | The name of the TIBCO Designer Project. e.g., MyProject | Yes | n/a |
| dir | The directory the TIBCO Designer Project is in. e.g., src/bw | Yes | n/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 | No | empty-set |
| properties-refid | A propertyset refid for the properties to use when executing the BusinessWorks engine. For instance setting | No | empty-set |
| working-dir | The working directory. e.g., build/working/@{project} | No | build/working/@{project} |
| create-dtl-file | If true, create the
(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 | |
| taskname | No | bwunit:bw-start |
Invokes a SOAP operation on a BWUnit BW engine to stop it
Parameters specified as attributes.
| Name | Description | Required | Default |
|---|---|---|---|
| host | No | localhost | |
| port | No | ${BWUnit/HTTP-service-port} | |
| stop-max-wait | No | 60 | |
| stop-max-wait-unit | No | second | |
| stop-timeout-property | No | bwunit.stop.timeout | |
| fail-on-stop-timeout | No | true | |
| taskname | No | bwunit:bw-stop |
Parameters specified as attributes.
| Name | Description | Required | Default |
|---|---|---|---|
| file | The BWUnit Results file to convert. | Yes | n/a |
| tofile | The file to write the JUnit formated results to. | Yes | n/a |
Converts the specified BWUnit results file into JUnit format
Parameters specified as attributes.
| Name | Description | Required | Default |
|---|---|---|---|
| file | The BWUnit Results file to convert. | Yes | n/a |
| tofile | The file to write the JUnit formated results to. | Yes | n/a |
| hostname | The hostname to insert into the results. | No | localhost |
Converts the specified BWUnit results file into NUnit format
Parameters specified as attributes.
| Name | Description | Required | Default |
|---|---|---|---|
| file | The BWUnit Results file to convert. | Yes | n/a |
| tofile | The file to write the NUnit formated results to. | Yes | n/a |
| project | Name of the project that was tested | Yes | n/a |
Opens a project in TIBCO Designer, with BWUnit aliases
Parameters specified as attributes.
| Name | Description | Required | Default |
|---|---|---|---|
| project | The name of the TIBCO Designer Project. e.g., MyProject | Yes | n/a |
| dir | The directory the TIBCO Designer Project is in. e.g., src/bw | Yes | n/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 | 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 | |
| taskname | No | bwunit:designer |
Installs a BWUnit license locally
Parameters specified as attributes.
| Name | Description | Required | Default |
|---|---|---|---|
| license | Your BWUnit license | Yes | n/a |
Starts a BusinessWorks engine locally and executes the project's BWUnit tests.
Parameters specified as attributes.
| Name | Description | Required | Default |
|---|---|---|---|
| project | The name of the TIBCO Designer Project. e.g., MyProject | Yes | n/a |
| dir | The directory the TIBCO Designer Project is in. e.g., src/bw | Yes | n/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 | No | empty-set |
| properties-refid | A propertyset refid for the properties to use when executing the BusinessWorks engine. For instance setting | No | empty-set |
| working-dir | The working directory. e.g., build/working/@{project} | No | build/working/@{project} |
| create-dtl-file | If true, create the | 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., | No | TestSuite$ |
| case-pattern | The regex pattern to use when searching for test cases e.g., | No | TestCase$ |
| fixture-pattern | The regex pattern to use when searching for fixtures e.g., | No | ^Fixture$ |
| force | If | No | false |
| failonerror | If | 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 | 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 | 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 | 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 | 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 |
| taskname | No | bwunit:run-tests |
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)
Parameters specified as attributes.
| Name | Description | Required | Default |
|---|---|---|---|
| project | The name of the TIBCO Designer Project. e.g., MyProject | Yes | n/a |
| dir | The directory the TIBCO Designer Project is in. e.g., src/bw | Yes | n/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
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 | 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 | No | %EXISTING-VALUE% |
| custom-cp-ext | the value to use for | No | %EXISTING-VALUE% |
| custom-palette-path | the value to use for | No | %EXISTING-VALUE% |
| custom-lib-path | the value to use for | No | %EXISTING-VALUE% |
| application-args | Specifies the remaining command line arguments to pass into the application
| No | |
| taskname | No | tibant:validate-project |