Appendix A: Usage without Anypoint Studio
Annotations Processor
When the profile is invoked, a custom annotations parser is hooked into the compilation. This processor goes through the connector and its processor code and annotations, retrieving information about the connectors properties, the return types of each processor, etc.
For example, this is the output for the NetSuite connector’s properties:
<properties>
<connectivity-support>true</connectivity-support>
<OAuth-authentication>false</OAuth-authentication>
<transformer>false</transformer>
<datasense-enabled>true</datasense-enabled>
<metadata>dynamic</metadata>
</properties>
This data is found in the root directory of the connector’s project, with the name_ annotations-output.xml. _
TestData Maven Plugin
This plugin takes the output files from the annotations processor, the DevKit’s generated schema and editors file, and a credentials file.
The only file that should be fed to the plugin via the command line is the credentials file, needed to identify the required connection fields. Also through the command line, the output file name can be defined.
Usage
To generate the testdata files, build the connector with these arguments:
mvn clean package -P testdata-generator -Dtype=interop <params>…
Valid options: -DcredentialsFile=”path/to/credentials” -DoutputFile=”nameOfOutputFile.xml” -DlogLevel=debug -DreplaceAll=true
The results of this command are the following files (see Files section for details):
-
_- nameOfOutputFile.xml _ Basic data retrieved from the connector. Provides a complete view of every processor and all its attributes.
-
- nameOfOutputFile-override.xml Presents a subset of the data found in the previous file, with only the required fields, but adds information about the connector and processor features and properties
Both create in _src/test/resources/generated. _
If the replaceAll* flag is set, *existing files in the path with the same name are completely overwritten.
The format of the credentials file should be: connectorName.fieldName=fieldValue
For example, for salesforce we have:
salesforce.username=user salesforce.password=psswrd salesforce.securityToken=token salesforce.url=https://login.salesforce.com/services/Soap/u/28.0
The convention to follow is src/test/resouces/salesforce-credentials.properties.
Tests Run From Console
In the connector root folder, run:
mvn org.mule.connectors.interop:interop-ce-runtime-generation:create
Followed by:
mvn org.mule.connectors.interop:interop-ce-runtime-generation:run -D[options]
Valid options: -DtestConnect -DtestDMapper -DtestXml -DtestDataPath=... -DtestDataOverridePath=...