Connector Testing Framework
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.|
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.
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
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
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
mvn clean test -Ddeploymentprofile=cloudhub -Dcloudhubuser=<your_username> -Dcloudhubpassword=<your_password>
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:
Configure the Mule runtime to be used on CloudHub
Gives the capability of change the CloudHub instance, by default the CTF deploys to http://anypoint.mulesoft.com/cloudhub/
Allows you to configure the desired amount of vCores for the Mule application to be generated. The available options are:
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
For more information on using the Runtime Manager see Deploying to CloudHub, Deploying to Your Own Servers, and Managing Applications and Servers in the Cloud and On Premises