SlideShare a Scribd company logo
MULE –Connector Testing Framework - CTF
-RajeshKumar
1
Connector Testing Framework - CTF
 The Connector Testing Framework eases the creation of connector functional tests,
where the developer is not necessarily involved with Mule’s internals, such as
flows, configurations and Spring beans. The objective of this framework is
twofold. On the one hand, we decouple how Mule works and how functional
tests are written. On the other hand, we enable a runtime platform to run
connector functional tests with multiple Mule versions by executing the tests in
remote Mule instances, achieving a decoupled runtime environment.
2
Overview of CTF
This framework is the default testing framework to write connector functional tests. It
has evolved from a previous testing framework, where the notion of Mule flows and
Spring beans were used. We now have a simple and well-defined interface to run
functional tests in different ways: Embedded or Remote.
The overall approach is to decouple the test itself from where it is executed, thus
enabling a developer to determine whether a test runs in different Mule execution
environments. For instance, a connector written for Mule 3.5.x can now be
automatically tested in Mule releases 3.x and determine backward-compatibility and
forward-compatibility issues, as well as class-loading problems.
3
CTF Interfaces
1. ConnectorTestContext<T>: Main class of the framework, providing an interface for
the other important class, the ConnectorDispatcher. It contains the following
methods:
a) initialize(Class<T> connectorClass): A class method to initialise the entire framework.
It requires the class of the connector under test.
b) shutDown(): A class method to shut down the entire framework.
c) getInstance(): A class method that returns the only instance of the connector
context prior to initialisation. Otherwise, it will throw and exception if the
framework has not been initialised.
d) getPlatformManager(): Returns the only instance of the platform manager in charge
of dealing with the framework life cycle.
e) getConnectorDispatcher(): Returns the only instance of the connector dispatcher,
which is in charge of executing the connector operations.
4
CTF Interfaces
2. ConnectorDispatcher<T>: An interface enabling the execution of connector
operations, including paginated, DataSense and WSDL operations. It contains the
following methods:
1. createMockup(): Returns an instance of the connector being tested, which is the
same class type as used as the only argument in the initialisation of the framework
through ConnectorTestContext.initialize(connectorClass). Tests operations are
executed through this instance, except for operations annotated with @Paged.
2. runPaginatedMethod(String methodName, Object[] args): Connector operations
annotated with @Paged are executed through this method, which requires the
operation name (camel-like) and the array of arguments for that specific
operation.
3. fetchMetaDataKeys(): Returns a Result (from org.mule.commons package) containing
a list of MetaDataKeys (from org.mule.common.metadata package) in order to test
MetaData.
4. fetchMetaData(MetaDataKey key): Returns a MetaData object
(from org.mule.common.metadata package) for a particular MetaDataKey
(from org.mule.common.metadata package).
5. invokeWSDLOperation(XMLStreamReader input, String WSDLID, String operationName):
Dispatcher operation to test WSDL operations.
5
Framework Configuration
Maven Dependencies
CTF is packed within DevKit 3.7+ and therefore no dependency is further required.
Properties
We can inject framework properties through Maven options or VM arguments (in
Eclipse, for instance). If no configurable parameters are desired, you can just add
these properties with System.setProperty(key,value) within your code. The following
CTF parameters are configurable:
6
Framework Configuration
Automations Credentials Properties File: Optional. This file includes the required
credentials to run a test suite and it is specified as -Dautomation-
credentials.properties=FILENAME. If no option is given and no file named automation-
credentials.properties exists, a default file will be created within src/test/resources and
an exception will be thrown. If a file already exists with this name, it will be used by
default and a warning will be issued. It is mandatory to specified the file as follows:
configName1.configurationAttribute1=value
configName1.configurationAttribute2=value
...
configName2.configurationAttribute1=value
configName2.configurationAttribute2=value
...
7
Installing CTF locally
The framework can be locally installed by cloning its repository and running mvn clean
install. Integration tests will not work out of the box, since they required the same
configuration as previously detailed.
You will need to include the following Maven options if integration tests are ran:
mvn clean install -Dtest=FullTestSuite -DfailIfNoTests=false -Dmuledirectory=<Mule
directory>
8
THANK YOU
9
THANK YOU
9

More Related Content

What's hot (20)

PPTX
Flows in mule
Sindhu VL
 
PPT
Mule mule agent
D.Rajesh Kumar
 
PPT
Mule api
D.Rajesh Kumar
 
PPTX
Mule esb
charan teja R
 
PPT
Mule security
charan teja R
 
PPTX
Telling the world why we love mule soft!
Sudha Ch
 
PPT
Mule security
D.Rajesh Kumar
 
PPTX
Create Account in Salesforce using Mule ESB
Sanjeet Pandey
 
PPT
Mule mule management console
D.Rajesh Kumar
 
PPT
Mule reference
himajareddys
 
PPT
Mule cloud hub
D.Rajesh Kumar
 
PDF
Mulesoft ppt
kishore ippili
 
PPTX
Applying UX principles and methods to APIs
MuleSoft
 
PPTX
Mule for beginners
Sindhu VL
 
PPTX
Integration with Sercice-Now using Mule ESB
Sanjeet Pandey
 
PPTX
MUnit - Testing Mule
Shanky Gupta
 
PPT
Anypoint data gateway
Mohammed246
 
PPTX
Mule Microsoft Share Point 2013 Connector
Ankush Sharma
 
PPT
Mule any pointstudio
D.Rajesh Kumar
 
PPTX
Mule esb
Sindhu VL
 
Flows in mule
Sindhu VL
 
Mule mule agent
D.Rajesh Kumar
 
Mule api
D.Rajesh Kumar
 
Mule esb
charan teja R
 
Mule security
charan teja R
 
Telling the world why we love mule soft!
Sudha Ch
 
Mule security
D.Rajesh Kumar
 
Create Account in Salesforce using Mule ESB
Sanjeet Pandey
 
Mule mule management console
D.Rajesh Kumar
 
Mule reference
himajareddys
 
Mule cloud hub
D.Rajesh Kumar
 
Mulesoft ppt
kishore ippili
 
Applying UX principles and methods to APIs
MuleSoft
 
Mule for beginners
Sindhu VL
 
Integration with Sercice-Now using Mule ESB
Sanjeet Pandey
 
MUnit - Testing Mule
Shanky Gupta
 
Anypoint data gateway
Mohammed246
 
Mule Microsoft Share Point 2013 Connector
Ankush Sharma
 
Mule any pointstudio
D.Rajesh Kumar
 
Mule esb
Sindhu VL
 

Similar to Mule ctf (20)

PPTX
Mule testing
Sindhu VL
 
PPTX
Testing mule
Sindhu VL
 
PPTX
ASP.Net MVC 4 [Part - 2]
Mohamed Abdeen
 
PPT
Automating Software Communications Architecture (SCA) Testing with Spectra CX
ADLINK Technology IoT
 
PPT
Mxunit
VIkas Patel
 
PDF
System verilog important
elumalai7
 
PPT
JMockit Framework Overview
Mario Peshev
 
PPSX
Automation Framework 042009 V2
Devukjs
 
PDF
An Introduction To Unit Testing and TDD
Ahmed Ehab AbdulAziz
 
PPTX
Testing mule
Sindhu VL
 
PDF
.NET TECHNOLOGIES
Prof Ansari
 
PPTX
Introduction to testing mule
Ramakrishna kapa
 
DOCX
systemverilog-interview-questions.docx
ssuser1c8ca21
 
PPTX
Terraform modules restructured
Ami Mahloof
 
PPTX
Terraform Modules Restructured
DoiT International
 
PDF
Apache commons chain in Spring Framework
Nivedita Mondal
 
PPT
Hybrid framework
Sudhakar Mangi
 
DOCX
Diversified AT Framework - Initial Version
Yu Tao Zhang
 
PPTX
Snow Leopard
Rohan Kachewar
 
DOCX
What is the difference between struts 1 vs struts 2
Santosh Singh Paliwal
 
Mule testing
Sindhu VL
 
Testing mule
Sindhu VL
 
ASP.Net MVC 4 [Part - 2]
Mohamed Abdeen
 
Automating Software Communications Architecture (SCA) Testing with Spectra CX
ADLINK Technology IoT
 
Mxunit
VIkas Patel
 
System verilog important
elumalai7
 
JMockit Framework Overview
Mario Peshev
 
Automation Framework 042009 V2
Devukjs
 
An Introduction To Unit Testing and TDD
Ahmed Ehab AbdulAziz
 
Testing mule
Sindhu VL
 
.NET TECHNOLOGIES
Prof Ansari
 
Introduction to testing mule
Ramakrishna kapa
 
systemverilog-interview-questions.docx
ssuser1c8ca21
 
Terraform modules restructured
Ami Mahloof
 
Terraform Modules Restructured
DoiT International
 
Apache commons chain in Spring Framework
Nivedita Mondal
 
Hybrid framework
Sudhakar Mangi
 
Diversified AT Framework - Initial Version
Yu Tao Zhang
 
Snow Leopard
Rohan Kachewar
 
What is the difference between struts 1 vs struts 2
Santosh Singh Paliwal
 
Ad

More from D.Rajesh Kumar (20)

PPTX
Mule soft meetup_-_finland_september_25th__2020 v2.0
D.Rajesh Kumar
 
PPTX
Meetup bangalore-sept5th 2020 (1)
D.Rajesh Kumar
 
PPTX
Mule soft meetup_-_finland_july_11th__2020
D.Rajesh Kumar
 
PPTX
Bangalore mulesoft meetup#10
D.Rajesh Kumar
 
PPTX
Meetup bangalore 9_novupdated
D.Rajesh Kumar
 
PPTX
Meetup bangalore aug31st2019
D.Rajesh Kumar
 
PPTX
Meetup bangalore june29th2019
D.Rajesh Kumar
 
PPTX
mulesoft meetup @ bangalore
D.Rajesh Kumar
 
PPTX
Meetup_Bangalore_Rajesh
D.Rajesh Kumar
 
PPT
Calico and container
D.Rajesh Kumar
 
PPT
Calico docker+ipam
D.Rajesh Kumar
 
PPT
Calico architecture
D.Rajesh Kumar
 
PPT
Calico to secure host interfaces
D.Rajesh Kumar
 
PPT
Calico and how interprets neutron api
D.Rajesh Kumar
 
PPT
Calico with open stack and chef
D.Rajesh Kumar
 
PPT
Calico with open stack
D.Rajesh Kumar
 
PPT
Calico with docker
D.Rajesh Kumar
 
PPT
Object Store in Mule
D.Rajesh Kumar
 
PPT
MuleSoft Offers a Data Migration Solution
D.Rajesh Kumar
 
ODP
Mule version-crowd highlights
D.Rajesh Kumar
 
Mule soft meetup_-_finland_september_25th__2020 v2.0
D.Rajesh Kumar
 
Meetup bangalore-sept5th 2020 (1)
D.Rajesh Kumar
 
Mule soft meetup_-_finland_july_11th__2020
D.Rajesh Kumar
 
Bangalore mulesoft meetup#10
D.Rajesh Kumar
 
Meetup bangalore 9_novupdated
D.Rajesh Kumar
 
Meetup bangalore aug31st2019
D.Rajesh Kumar
 
Meetup bangalore june29th2019
D.Rajesh Kumar
 
mulesoft meetup @ bangalore
D.Rajesh Kumar
 
Meetup_Bangalore_Rajesh
D.Rajesh Kumar
 
Calico and container
D.Rajesh Kumar
 
Calico docker+ipam
D.Rajesh Kumar
 
Calico architecture
D.Rajesh Kumar
 
Calico to secure host interfaces
D.Rajesh Kumar
 
Calico and how interprets neutron api
D.Rajesh Kumar
 
Calico with open stack and chef
D.Rajesh Kumar
 
Calico with open stack
D.Rajesh Kumar
 
Calico with docker
D.Rajesh Kumar
 
Object Store in Mule
D.Rajesh Kumar
 
MuleSoft Offers a Data Migration Solution
D.Rajesh Kumar
 
Mule version-crowd highlights
D.Rajesh Kumar
 
Ad

Recently uploaded (20)

PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
July Patch Tuesday
Ivanti
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
Python basic programing language for automation
DanialHabibi2
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
July Patch Tuesday
Ivanti
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Python basic programing language for automation
DanialHabibi2
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 

Mule ctf

  • 1. MULE –Connector Testing Framework - CTF -RajeshKumar 1
  • 2. Connector Testing Framework - CTF  The Connector Testing Framework eases the creation of connector functional tests, where the developer is not necessarily involved with Mule’s internals, such as flows, configurations and Spring beans. The objective of this framework is twofold. On the one hand, we decouple how Mule works and how functional tests are written. On the other hand, we enable a runtime platform to run connector functional tests with multiple Mule versions by executing the tests in remote Mule instances, achieving a decoupled runtime environment. 2
  • 3. Overview of CTF This framework is the default testing framework to write connector functional tests. It has evolved from a previous testing framework, where the notion of Mule flows and Spring beans were used. We now have a simple and well-defined interface to run functional tests in different ways: Embedded or Remote. The overall approach is to decouple the test itself from where it is executed, thus enabling a developer to determine whether a test runs in different Mule execution environments. For instance, a connector written for Mule 3.5.x can now be automatically tested in Mule releases 3.x and determine backward-compatibility and forward-compatibility issues, as well as class-loading problems. 3
  • 4. CTF Interfaces 1. ConnectorTestContext<T>: Main class of the framework, providing an interface for the other important class, the ConnectorDispatcher. It contains the following methods: a) initialize(Class<T> connectorClass): A class method to initialise the entire framework. It requires the class of the connector under test. b) shutDown(): A class method to shut down the entire framework. c) getInstance(): A class method that returns the only instance of the connector context prior to initialisation. Otherwise, it will throw and exception if the framework has not been initialised. d) getPlatformManager(): Returns the only instance of the platform manager in charge of dealing with the framework life cycle. e) getConnectorDispatcher(): Returns the only instance of the connector dispatcher, which is in charge of executing the connector operations. 4
  • 5. CTF Interfaces 2. ConnectorDispatcher<T>: An interface enabling the execution of connector operations, including paginated, DataSense and WSDL operations. It contains the following methods: 1. createMockup(): Returns an instance of the connector being tested, which is the same class type as used as the only argument in the initialisation of the framework through ConnectorTestContext.initialize(connectorClass). Tests operations are executed through this instance, except for operations annotated with @Paged. 2. runPaginatedMethod(String methodName, Object[] args): Connector operations annotated with @Paged are executed through this method, which requires the operation name (camel-like) and the array of arguments for that specific operation. 3. fetchMetaDataKeys(): Returns a Result (from org.mule.commons package) containing a list of MetaDataKeys (from org.mule.common.metadata package) in order to test MetaData. 4. fetchMetaData(MetaDataKey key): Returns a MetaData object (from org.mule.common.metadata package) for a particular MetaDataKey (from org.mule.common.metadata package). 5. invokeWSDLOperation(XMLStreamReader input, String WSDLID, String operationName): Dispatcher operation to test WSDL operations. 5
  • 6. Framework Configuration Maven Dependencies CTF is packed within DevKit 3.7+ and therefore no dependency is further required. Properties We can inject framework properties through Maven options or VM arguments (in Eclipse, for instance). If no configurable parameters are desired, you can just add these properties with System.setProperty(key,value) within your code. The following CTF parameters are configurable: 6
  • 7. Framework Configuration Automations Credentials Properties File: Optional. This file includes the required credentials to run a test suite and it is specified as -Dautomation- credentials.properties=FILENAME. If no option is given and no file named automation- credentials.properties exists, a default file will be created within src/test/resources and an exception will be thrown. If a file already exists with this name, it will be used by default and a warning will be issued. It is mandatory to specified the file as follows: configName1.configurationAttribute1=value configName1.configurationAttribute2=value ... configName2.configurationAttribute1=value configName2.configurationAttribute2=value ... 7
  • 8. Installing CTF locally The framework can be locally installed by cloning its repository and running mvn clean install. Integration tests will not work out of the box, since they required the same configuration as previously detailed. You will need to include the following Maven options if integration tests are ran: mvn clean install -Dtest=FullTestSuite -DfailIfNoTests=false -Dmuledirectory=<Mule directory> 8