Contact Us 1-800-596-4880

Connector Testing Framework

DevKit is compatible only with Studio 6 and Mule 3. To build Mule 4 connectors, see the Mule SDK documentation.

Overview

The purpose of the connector testing framework (CTF) is to perform functional testing in as many deployment scenarios as possible. The framework runs a Mule app "externally", unbound to the versions of DevKit and the Mule runtime the connector was developed on.

Using a simple Maven command from the connector’s root folder, you can perform tests on the connector in the runtime specified in your local profile, embedded runtime or an available CloudHub runtime version.

The fact that libraries change on CloudHub increases the potential for incompatibility between the Mule runtime version and your DevKit-based connector.

Deployment Profile Configuration

Pass the desired connector application deployment details as arguments to a single Maven command, specifying the environments you want to test your connector in. All arguments should be in lowercase.

If you do not specify -Ddeploymentprofile, the CTF runs by default in embedded mode.

Embedded Mode

Specifying only mvn clean test would run the functional tests in embedded mode, depending on the DevKit version. You are not required to have a Mule server to run the application in this mode.

Running `mvn clean test `is the same as running:

mvn clean test -Ddeploymentprofile=embedded

Local Mode

Running CTF in Local mode means loading the Mule application deployment specification from your user profile and running the test remotely. To test a connector using your local profile’s runtime, the argument -Ddeploymentprofile must be set in the /local folder. For example, the command would be structured like:

mvn clean test -Ddeploymentprofile= -Dmuledirectory=/local/usr/mule_3.6.3

CloudHub Mode

As of DevKit 3.9.0, CTF support for a CloudHub deployment profile is available, allowing you to test your connector in a more dynamic environment, a clear advantage to deploying a Mule application in a classic standalone environment. The two required parameters, besides specifying -Ddeploymentprofile=cloudhub, are your CloudHub username -Dcloudhubuser= and -Dcloudhubpassword=.

mvn clean test -Ddeploymentprofile=cloudhub -Dcloudhubuser=<your_username> -Dcloudhubpassword=<your_password>

Optional Parameters

When testing on CloudHub, you may specify the Mule version to run connector tests on, as well as the CloudHub URL and the CloudHub worker type for your instance. See the example below that includes all the required and optional parameters:

Optional Parameters Description

muleversion

Configure the Mule runtime to be used on CloudHub

cloudhuburl

Gives the capability of change the CloudHub instance, by default the CTF deploys to http://anypoint.mulesoft.com/cloudhub/

cloudhubworkertype

Allows you to configure the desired amount of vCores for the Mule application to be generated. The available options are: micro (0.1vCores), small (0.2vCores), medium (1vCore), large (2vCores), xlarge (4vCores)

cloudhubtimeout

Allows you to configure the timeout of the CloudHub instance where the Mule application is deployed

Example CTF test command:

mvn clean test -Ddeploymentprofile=cloudhub -Dcloudhubuser=<your_username> -Dcloudhubpassword=<your_password>
-Dmuleversion=3.7.2
-DcloudhubURL=http://qa.anypointplatform.mulesoft.com/cloudhub
-Dcloudhubworkertype=small