Table of Contents

Search

  1. Preface
  2. Part 1: Using Process Developer
  3. Part 2: Creating and Modifying Processes
  4. Part 3: Functions, Events, Errors, and Correlation
  5. Part 4: Testing and Deployment
  6. Part 5: Process Central and Process Server (On-Premises)

Process Developer

Process Developer

Tips on Using Parameterized XSL for Input and Assert Data

Tips on Using Parameterized XSL for Input and Assert Data

You can build efficiency into your B-unit tests in cases where you want to assert a small difference in the same data across multiple tests. The efficiency comes in the form of parameterized XSL.
Consider the following example.
In an XML data file, there is the following element:
<ns:status>CREATED</ns:status>
Instead of creating different XML files, each with a different status value, you can write an XSL file such as:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns="http://schemas.active-endpoints.com/b4p /wshumantask/2007/10/aeb4p-task-rt.xsd"> <xsl:import href="common.xsl"/> <xsl:param name="state"/> <xsl:template match="ns:status/text()" priority="2"> <xsl:value-of select="$state" /> </xsl:template> </xsl:stylesheet>
In the Source view of your B-unit file, you can then add a parameter, such as:
<abu:part href="../data/getTaskInstanceResponse-minimal.xml" name="taskInstance" xsl="../xsl/change-task-instance-state.xsl"> <abu:params> <abu:param name="state" value="COMPLETED"/> </abu:params>
For each B-unit test, you use the same imported data and the same XSL file. You need only change the parameter value to get a different result.

0 COMMENTS

We’d like to hear from you!