SlideShare a Scribd company logo
1 of 32
Presented By
Sindhu VL
This section describes how to test your
Mule application.
Introduction to Testing Mule
Unit Testing
Functional Testing
Testing Strategies
MUnit
Typically, existing, bundled tests can fill
many of your testing requirements.
Thesrc/test/ directory in every Mule ESB
Maven project incorporates both unit and
functional tests. The included
Maven tests project contains additional
useful functional and integration tests.
 You can leverage the following bundled tests when
configuring and customizing Mule:
 Unit testing of your simple extensions and
customizations
 Functional testing of your Mule configuration and
setup
 Functional and unit testing of your custom modules
and transports
 Integration testing of multiple modules, transports,
and transformers, etc.
 System testing of transports that connect to
embedded or external services
 Stress and performance testing
After you have ensured that your setup
and configuration are correct and that your
customizations work correctly, verify that
your system is performing as intended.
RunJapex benchmark tests to test
individual packages. Additionally, the Mule
Profiler Packcan identify memory leaks in
your customizations.
 If you host your Mule project on MuleForge,
you can take advantage of continuous
integration testing. MuleForge automatically
builds hosted projects using Bamboo, a
Continuous Integration Build Server from
Atlassian. The build frequency for source
code is every 30 minutes, while the snapshot
build frequency is once per day. You can
request different frequencies for your
individual project.
 For more information on hosting your project,
visit MuleForge.
Mule ESB provides a Test Compatibility Kit
(TCK) of unit tests that you can use to test
your simple extensions as well as your
custom modules and transports. The unit
tests are located in the -tests.jar file, such
as mule-core-3.0.0-tests.jar for Mule
version 3.0.0. All unit tests inherit
from org.mule.tck.AbstractMuleTestCase
These unit tests are beneficial for the
following reasons:
 Components tested with a TCK test case ensure that the
common behavior of the component is compatible with the
Mule framework.
 Using a TCK test case allows the developer to concentrate on
writing tests for specific behavior of their component.
 Where testing of a method in the Component API cannot be
tested by the TCK test case, the test cases provides an
abstract method for the test, ensuring the developer tests all
areas of the component.
 The TCK provides a default test model that is a simple set of
test classes. The developer doesn’t need to worry about
writing new test classes for their test cases each time.
 The abstract test cases in the TCK use JUnit’s TestCase, so
they are compatible with other test cases.
TESTING COMPONENT : DESCRIPTION :
 AbstractMuleTestCase  A helper test case providing
methods for creating test
and mock object types. This
is the base class for all other
abstract TCK classes.
TESTING COMPONENT : DESCRIPTION :
 AbstractConnectorTestCase  Used to test the common
behavior of a connector.
This tests dispatching and
sending events using mock
objects.
TESTING COMPONENT : DESCRIPTION :
 AbstractMuleMessageFactor
yTestCase
 Provides tests for all the
standard methods defined in
theMuleMessageFactory int
erface. Add specific tests for
converting your transport
message to a MuleMessage
in your subclass.
TESTING COMPONENT : DESCRIPTION :
 AbstractMessageReceiverTe
stCase
 Used to test the common
behavior of
aMessageReceiver. This
tests receiving messages
using mock objects.
TESTING COMPONENT : DESCRIPTION :
 AbstractComponentTestCas
e
 This is the base class for unit
tests that test custom component
implementations. Concrete
subclasses of this base class
includeDefaultJavaComponentTe
stCase,PooledJavaComponentT
estCase,
andSimpleCallableJavaCompon
entTestCase, each of which
contains methods for testing that
component type. For example,
theDefaultJavaComponentTestC
aseincludes methods for testing
the creation, lifecycle, and
disposal of a basic Java
component.
TESTING COMPONENT : DESCRIPTION :
 AbstractTransformerTestCas
e
 Used to test transformers.
This class defines a number
of tests that ensures that the
transformer works in single
scenarios as well as in
round trip scenarios. There
are many concrete sub-
classes of this abstract class
that test specific types of
transformers, such
asStringByteArrayTransform
ersTestCase.
TESTING COMPONENT : DESCRIPTION :
 DefaultMuleContextTestCas
e
 Tests the creation and
disposal of the Mule context.
 Because Mule ESB is light-weight and
embeddable, it is easy to run a Mule Server inside
a test case. Mule provides an abstract JUnit test
case
calledorg.mule.tck.junit4.FunctionalTestCase that
runs Mule inside a test case and manages the
lifecycle of the server.
The org.mule.tck.functional package contains a
number of supporting classes for functionally
testing Mule code,
includingFunctionalTestComponent. These classes
are described in more detail in the following
sections.
 The previous example of FunctionalTestCase
covers many common (synchronous) test
scenarios, where the flow responds directly to
the caller. FunctionalTestComponent can help
support richer tests, such as:
 Simulating asynchronous communication
 Returning mock data to the caller
 Common scenarios such as forced
exceptions, storing message history,
appending text to responses, and delayed
responses.
 Building a comprehensive suite of automated tests for your
Mule project is the primary factor that will ensure its longevity:
you’ll gain the security of a safety net catching any regression
or incompatible change in your applications before they even
leave your workstation.
 We’ll look at testing under three different aspects:
 *Unit testing: these tests are designed to be fast, with a very
narrow system under test. Mule is typically not run for unit
tests.
*Functional testing: these tests usually involve running Mule,
though with a limited configuration, and should run fast
enough to be executed on each build.
*Integration testing: these tests exercise a full Mule application
with settings that are as close to production as possible. They
are usually slower to run and not part of the regular build
 In a Mule application, unit testing is limited to the code that
can be realistically exercised without the need to run it inside
Mule itself. As a rule of thumb, code that is Mule aware (for
example, code that relies on the registry), will better be
exercised with a functional test
 With this in mind, the following are good candidates for unit
testing:
 *Custom transformers
*Custom components
*Custom expression evaluators
*All the Spring beans that your Mule application will use.
Typically, these beans come as part of a dependency JAR and
are tested while being built, alleviating the need for re-
retesting them in your Mule application project
 Functional tests are those that most
extensively exercise your application
configuration. In these tests, you’ll have the
freedom and tools for simulating happy and
unhappy paths.
 The "paths" that you will be interested to
cover include:
 *Message flows
*Rule-based routing, including validation
handling within these flows
*Error handling
 Munit is Beta-version Mule testing framework that
allows you to:
 mock the output of your message processors
 write tests in XML or Java
 create tests in the Anypoint Studio drag-and-drop
interface
 insert spy functionality to track what happens before
and after a message processor is called
 view coverage reports in Studio
 run tests with your plugins
 access detailed Mule stacktraces that pinpoint
message processor failures
 integrate with Maven and Surefire for continuous
integration support
MUnit is a Mule application testing
framework that allows you to easily build
automated tests for your integrations and
APIs. It provides a full suite of integration
and unit test capabilities, and is fully
integrated with Maven and Surefire for
integration with your continuous
deployment environment.
Create your Mule test by writing Mule code
Create your Mule test by writing Java code
Disable flow inbound endpoints
Disable endpoint connectors
Mock outbound endpoints
Mock message processors
Create not only unit tests but also
integration tests in a local environment —
MUnit allows you to start a local
FTP/SFTP, DB server or mail server
Call the Mule client from Mule code
Assert flow exceptions
Spy any message processor
Verify message processor calls
Enable or disable particular tests
See assertion/error reports with Mule stack
trace
Extend the MUnit framework with plugins
Check visual coverage in Studio
Debug your tests with Studio
MUnit is divided among several sub
modules. From a user’s point of view there
are only two that are really important. Both
modules are compatible amongst
themselves.
The important sub modules are:
MUnit Version Mule MUnit Support
Version
1.0.x 3.6.x, 3.7.x
1.1.x 3.6.x, 3.7.x
The Mule MUnit Support module is meant
to follow Mule ESB releases:
Mule MUnit Support
Version
Mule ESB Version
3.6.x 3.6.0 to 3.6.x
3.7.x 3.7.0 to 3.7.x
MUnit is fully integrated with Anypoint
Studio, allowing you to create, design and
run MUnit tests just like you would Mule
applications. You can also use Anypoint
Studio’sStudio Visual Debugger to debug
your MUnit tests.
MUnit is fully integrated with Anypoint
Studio. You can use Studio’s graphical
interface to:
Create and design MUnit tests
Run your tests
View test results and coverage
Debug your tests
The base of the MUnit Framework consists
of MUnit Test Suite files. These files are
the.xml files located under
the src/test/munit folder in your Mule
application’s folder structure. Each MUnit
Test Suite file is a collection of MUnit tests.
It is meant to work on its own, and should
be able to run independently from any
other MUnit test suite files.
An MUnit test suite file should contain any
combination of the following components:
Imports
Bean Definitions
Before/After Suites
Before/After Tests
MUnit Tests
ThankYou!!!!!!!

More Related Content

What's hot

Mulesoft Calling Flow of Other Applications
Mulesoft Calling Flow of Other ApplicationsMulesoft Calling Flow of Other Applications
Mulesoft Calling Flow of Other Applicationskumar gaurav
 
MUnit run and wait scope
MUnit run and wait scopeMUnit run and wait scope
MUnit run and wait scopeShanky Gupta
 
Automatic documentation with mule
Automatic documentation with muleAutomatic documentation with mule
Automatic documentation with muleF K
 
Send email attachment using smtp in mule esb
Send email attachment using smtp in mule esbSend email attachment using smtp in mule esb
Send email attachment using smtp in mule esbPraneethchampion
 
Mule agent notifications
Mule agent notificationsMule agent notifications
Mule agent notificationsShanky Gupta
 
MUnit - Testing Mule
MUnit - Testing MuleMUnit - Testing Mule
MUnit - Testing MuleShanky Gupta
 
Deploying and Running in Mule
Deploying and Running in MuleDeploying and Running in Mule
Deploying and Running in MuleKhasim Saheb
 
Filter expression in mule
Filter expression in muleFilter expression in mule
Filter expression in muleRajkattamuri
 
Integration with Dropbox using Mule ESB
Integration with Dropbox using Mule ESBIntegration with Dropbox using Mule ESB
Integration with Dropbox using Mule ESBRupesh Sinha
 
Invoke component demo in mule
Invoke component demo in muleInvoke component demo in mule
Invoke component demo in muleRamakrishna kapa
 
Bindings of components in mule
Bindings of components in muleBindings of components in mule
Bindings of components in mulesathishmca143
 
Content based routing tutorial in mule
Content based routing tutorial in muleContent based routing tutorial in mule
Content based routing tutorial in muleSindhu VL
 

What's hot (18)

The Mule Agent
The Mule AgentThe Mule Agent
The Mule Agent
 
Mulesoft Calling Flow of Other Applications
Mulesoft Calling Flow of Other ApplicationsMulesoft Calling Flow of Other Applications
Mulesoft Calling Flow of Other Applications
 
MUnit run and wait scope
MUnit run and wait scopeMUnit run and wait scope
MUnit run and wait scope
 
Automatic documentation with mule
Automatic documentation with muleAutomatic documentation with mule
Automatic documentation with mule
 
Munit
MunitMunit
Munit
 
Mule esb soap_service
Mule esb soap_serviceMule esb soap_service
Mule esb soap_service
 
Mule soa
Mule soaMule soa
Mule soa
 
Send email attachment using smtp in mule esb
Send email attachment using smtp in mule esbSend email attachment using smtp in mule esb
Send email attachment using smtp in mule esb
 
Mule agent notifications
Mule agent notificationsMule agent notifications
Mule agent notifications
 
MUnit - Testing Mule
MUnit - Testing MuleMUnit - Testing Mule
MUnit - Testing Mule
 
Deploying and Running in Mule
Deploying and Running in MuleDeploying and Running in Mule
Deploying and Running in Mule
 
Filter expression in mule
Filter expression in muleFilter expression in mule
Filter expression in mule
 
Integration with Dropbox using Mule ESB
Integration with Dropbox using Mule ESBIntegration with Dropbox using Mule ESB
Integration with Dropbox using Mule ESB
 
Invoke component demo in mule
Invoke component demo in muleInvoke component demo in mule
Invoke component demo in mule
 
Mule security - saml
Mule  security - samlMule  security - saml
Mule security - saml
 
Bindings of components in mule
Bindings of components in muleBindings of components in mule
Bindings of components in mule
 
Content based routing tutorial in mule
Content based routing tutorial in muleContent based routing tutorial in mule
Content based routing tutorial in mule
 
Mule velocity
Mule velocityMule velocity
Mule velocity
 

Viewers also liked

Xslt attributes
Xslt attributesXslt attributes
Xslt attributesSindhu VL
 
Mule debugging
Mule   debuggingMule   debugging
Mule debuggingSindhu VL
 
Using maven with mule
Using maven with muleUsing maven with mule
Using maven with muleSindhu VL
 
Xslt elements
Xslt elementsXslt elements
Xslt elementsSindhu VL
 
Concepts in mule
Concepts in muleConcepts in mule
Concepts in muleSindhu VL
 
Mule requester
Mule requesterMule requester
Mule requesterSindhu VL
 
Mule for beginners
Mule for beginnersMule for beginners
Mule for beginnersSindhu VL
 
Mule requestor component
Mule requestor componentMule requestor component
Mule requestor componentSindhu VL
 
Flows and subflows in mule
Flows and subflows in muleFlows and subflows in mule
Flows and subflows in muleSindhu VL
 
Working of mule
Working of muleWorking of mule
Working of muleSindhu VL
 
Mule concepts
Mule conceptsMule concepts
Mule conceptsSindhu VL
 
Mule esb enterprise
Mule esb enterpriseMule esb enterprise
Mule esb enterpriseSindhu VL
 
Error handling with respect to mule
Error handling with respect to muleError handling with respect to mule
Error handling with respect to muleSindhu VL
 
Mule core concepts
Mule core conceptsMule core concepts
Mule core conceptsSindhu VL
 
Mule fundamentals
Mule fundamentalsMule fundamentals
Mule fundamentalsSindhu VL
 
Groovy component
Groovy componentGroovy component
Groovy componentSindhu VL
 
Component bindings in mule
Component bindings in muleComponent bindings in mule
Component bindings in muleSindhu VL
 

Viewers also liked (20)

Xslt attributes
Xslt attributesXslt attributes
Xslt attributes
 
Mule esb
Mule esbMule esb
Mule esb
 
Mule debugging
Mule   debuggingMule   debugging
Mule debugging
 
Using maven with mule
Using maven with muleUsing maven with mule
Using maven with mule
 
Xslt elements
Xslt elementsXslt elements
Xslt elements
 
Mule errors
Mule errorsMule errors
Mule errors
 
Concepts in mule
Concepts in muleConcepts in mule
Concepts in mule
 
Mule requester
Mule requesterMule requester
Mule requester
 
Mule for beginners
Mule for beginnersMule for beginners
Mule for beginners
 
Mule requestor component
Mule requestor componentMule requestor component
Mule requestor component
 
Flows and subflows in mule
Flows and subflows in muleFlows and subflows in mule
Flows and subflows in mule
 
Working of mule
Working of muleWorking of mule
Working of mule
 
Mule concepts
Mule conceptsMule concepts
Mule concepts
 
Mule esb enterprise
Mule esb enterpriseMule esb enterprise
Mule esb enterprise
 
Error handling with respect to mule
Error handling with respect to muleError handling with respect to mule
Error handling with respect to mule
 
Mule core concepts
Mule core conceptsMule core concepts
Mule core concepts
 
Mule fundamentals
Mule fundamentalsMule fundamentals
Mule fundamentals
 
Groovy component
Groovy componentGroovy component
Groovy component
 
Component bindings in mule
Component bindings in muleComponent bindings in mule
Component bindings in mule
 
Xslt mule
Xslt   muleXslt   mule
Xslt mule
 

Similar to Mule testing

Introduction to testing mule
Introduction to testing muleIntroduction to testing mule
Introduction to testing muleRamakrishna kapa
 
Introduction testingmule
Introduction testingmuleIntroduction testingmule
Introduction testingmuleSrikrishna k
 
Unit testing using Munit Part 1
Unit testing using Munit Part 1Unit testing using Munit Part 1
Unit testing using Munit Part 1Anand kalla
 
Test driven development and unit testing with examples in C++
Test driven development and unit testing with examples in C++Test driven development and unit testing with examples in C++
Test driven development and unit testing with examples in C++Hong Le Van
 
Introduction to Unit Testing for Mule Flows using Munit(Java) - Part 1
Introduction to Unit Testing for Mule Flows using Munit(Java) - Part 1Introduction to Unit Testing for Mule Flows using Munit(Java) - Part 1
Introduction to Unit Testing for Mule Flows using Munit(Java) - Part 1Alex Fernandez
 
Unit Testing in Flutter - From Workflow Essentials to Complex Scenarios
Unit Testing in Flutter - From Workflow Essentials to Complex ScenariosUnit Testing in Flutter - From Workflow Essentials to Complex Scenarios
Unit Testing in Flutter - From Workflow Essentials to Complex ScenariosFlutter Agency
 
Unit Testing Fundamentals
Unit Testing FundamentalsUnit Testing Fundamentals
Unit Testing FundamentalsRichard Paul
 
12 Rational Solo Pruebas 2009
12 Rational Solo Pruebas 200912 Rational Solo Pruebas 2009
12 Rational Solo Pruebas 2009Pepe
 
Automation Testing of Web based Application with Selenium and HP UFT (QTP)
Automation Testing of Web based Application with Selenium and HP UFT (QTP)Automation Testing of Web based Application with Selenium and HP UFT (QTP)
Automation Testing of Web based Application with Selenium and HP UFT (QTP)IRJET Journal
 
Scale and Load Testing of Micro-Service
Scale and Load Testing of Micro-ServiceScale and Load Testing of Micro-Service
Scale and Load Testing of Micro-ServiceIRJET Journal
 
Keyword-driven Test Automation Framework
Keyword-driven Test Automation FrameworkKeyword-driven Test Automation Framework
Keyword-driven Test Automation FrameworkMikhail Subach
 

Similar to Mule testing (20)

Introduction to testing mule
Introduction to testing muleIntroduction to testing mule
Introduction to testing mule
 
Introduction testingmule
Introduction testingmuleIntroduction testingmule
Introduction testingmule
 
Mule testing
Mule testingMule testing
Mule testing
 
Unit testing using Munit Part 1
Unit testing using Munit Part 1Unit testing using Munit Part 1
Unit testing using Munit Part 1
 
Mule ctf
Mule  ctfMule  ctf
Mule ctf
 
Test driven development and unit testing with examples in C++
Test driven development and unit testing with examples in C++Test driven development and unit testing with examples in C++
Test driven development and unit testing with examples in C++
 
Munit_in_mule_naveen
Munit_in_mule_naveenMunit_in_mule_naveen
Munit_in_mule_naveen
 
Introduction to Unit Testing for Mule Flows using Munit(Java) - Part 1
Introduction to Unit Testing for Mule Flows using Munit(Java) - Part 1Introduction to Unit Testing for Mule Flows using Munit(Java) - Part 1
Introduction to Unit Testing for Mule Flows using Munit(Java) - Part 1
 
Testing in mule
Testing in muleTesting in mule
Testing in mule
 
Presentation Of Mbt Tools
Presentation Of Mbt ToolsPresentation Of Mbt Tools
Presentation Of Mbt Tools
 
Unit Testing in Flutter - From Workflow Essentials to Complex Scenarios
Unit Testing in Flutter - From Workflow Essentials to Complex ScenariosUnit Testing in Flutter - From Workflow Essentials to Complex Scenarios
Unit Testing in Flutter - From Workflow Essentials to Complex Scenarios
 
CH-3.pdf
CH-3.pdfCH-3.pdf
CH-3.pdf
 
Mule esb munit
Mule esb munitMule esb munit
Mule esb munit
 
Test Management in TeamForge
Test Management in TeamForgeTest Management in TeamForge
Test Management in TeamForge
 
Unit Testing Fundamentals
Unit Testing FundamentalsUnit Testing Fundamentals
Unit Testing Fundamentals
 
12 Rational Solo Pruebas 2009
12 Rational Solo Pruebas 200912 Rational Solo Pruebas 2009
12 Rational Solo Pruebas 2009
 
Automation Testing of Web based Application with Selenium and HP UFT (QTP)
Automation Testing of Web based Application with Selenium and HP UFT (QTP)Automation Testing of Web based Application with Selenium and HP UFT (QTP)
Automation Testing of Web based Application with Selenium and HP UFT (QTP)
 
Scale and Load Testing of Micro-Service
Scale and Load Testing of Micro-ServiceScale and Load Testing of Micro-Service
Scale and Load Testing of Micro-Service
 
Keyword-driven Test Automation Framework
Keyword-driven Test Automation FrameworkKeyword-driven Test Automation Framework
Keyword-driven Test Automation Framework
 
Combined Project
Combined ProjectCombined Project
Combined Project
 

More from Sindhu VL

Mule - error handling
Mule - error handling Mule - error handling
Mule - error handling Sindhu VL
 
Mule - beginners guide
Mule - beginners guideMule - beginners guide
Mule - beginners guideSindhu VL
 
Core concepts - mule
Core concepts - muleCore concepts - mule
Core concepts - muleSindhu VL
 
Core concepts in mule
Core concepts in muleCore concepts in mule
Core concepts in muleSindhu VL
 
Basics of mule for beginners
Basics of mule for beginnersBasics of mule for beginners
Basics of mule for beginnersSindhu VL
 
Mule securing
Mule   securingMule   securing
Mule securingSindhu VL
 
Service orchestration by using flows
Service orchestration by using flowsService orchestration by using flows
Service orchestration by using flowsSindhu VL
 
Configuration patterns in mule
Configuration patterns in muleConfiguration patterns in mule
Configuration patterns in muleSindhu VL
 
Bindings of components in mule
Bindings of components in muleBindings of components in mule
Bindings of components in muleSindhu VL
 
Using mule configuration patterns
Using mule configuration patternsUsing mule configuration patterns
Using mule configuration patternsSindhu VL
 
Using flows for service orchestration
Using flows for service orchestrationUsing flows for service orchestration
Using flows for service orchestrationSindhu VL
 
Encrption in mule
Encrption in muleEncrption in mule
Encrption in muleSindhu VL
 
Enterprise service bus mule
Enterprise service bus  muleEnterprise service bus  mule
Enterprise service bus muleSindhu VL
 
Mule esb for beginners
Mule esb for beginnersMule esb for beginners
Mule esb for beginnersSindhu VL
 
Design flows in mule
Design flows in muleDesign flows in mule
Design flows in muleSindhu VL
 
Flows in mule
Flows in muleFlows in mule
Flows in muleSindhu VL
 
Connectors in mule
Connectors in muleConnectors in mule
Connectors in muleSindhu VL
 
Choice router mule
Choice router   muleChoice router   mule
Choice router muleSindhu VL
 

More from Sindhu VL (18)

Mule - error handling
Mule - error handling Mule - error handling
Mule - error handling
 
Mule - beginners guide
Mule - beginners guideMule - beginners guide
Mule - beginners guide
 
Core concepts - mule
Core concepts - muleCore concepts - mule
Core concepts - mule
 
Core concepts in mule
Core concepts in muleCore concepts in mule
Core concepts in mule
 
Basics of mule for beginners
Basics of mule for beginnersBasics of mule for beginners
Basics of mule for beginners
 
Mule securing
Mule   securingMule   securing
Mule securing
 
Service orchestration by using flows
Service orchestration by using flowsService orchestration by using flows
Service orchestration by using flows
 
Configuration patterns in mule
Configuration patterns in muleConfiguration patterns in mule
Configuration patterns in mule
 
Bindings of components in mule
Bindings of components in muleBindings of components in mule
Bindings of components in mule
 
Using mule configuration patterns
Using mule configuration patternsUsing mule configuration patterns
Using mule configuration patterns
 
Using flows for service orchestration
Using flows for service orchestrationUsing flows for service orchestration
Using flows for service orchestration
 
Encrption in mule
Encrption in muleEncrption in mule
Encrption in mule
 
Enterprise service bus mule
Enterprise service bus  muleEnterprise service bus  mule
Enterprise service bus mule
 
Mule esb for beginners
Mule esb for beginnersMule esb for beginners
Mule esb for beginners
 
Design flows in mule
Design flows in muleDesign flows in mule
Design flows in mule
 
Flows in mule
Flows in muleFlows in mule
Flows in mule
 
Connectors in mule
Connectors in muleConnectors in mule
Connectors in mule
 
Choice router mule
Choice router   muleChoice router   mule
Choice router mule
 

Recently uploaded

VIP Call Girls Service Kukatpally Hyderabad Call +91-8250192130
VIP Call Girls Service Kukatpally Hyderabad Call +91-8250192130VIP Call Girls Service Kukatpally Hyderabad Call +91-8250192130
VIP Call Girls Service Kukatpally Hyderabad Call +91-8250192130Suhani Kapoor
 
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130Suhani Kapoor
 
Design Portfolio - 2024 - William Vickery
Design Portfolio - 2024 - William VickeryDesign Portfolio - 2024 - William Vickery
Design Portfolio - 2024 - William VickeryWilliamVickery6
 
VIP Kolkata Call Girl Gariahat 👉 8250192130 Available With Room
VIP Kolkata Call Girl Gariahat 👉 8250192130  Available With RoomVIP Kolkata Call Girl Gariahat 👉 8250192130  Available With Room
VIP Kolkata Call Girl Gariahat 👉 8250192130 Available With Roomdivyansh0kumar0
 
定制(RMIT毕业证书)澳洲墨尔本皇家理工大学毕业证成绩单原版一比一
定制(RMIT毕业证书)澳洲墨尔本皇家理工大学毕业证成绩单原版一比一定制(RMIT毕业证书)澳洲墨尔本皇家理工大学毕业证成绩单原版一比一
定制(RMIT毕业证书)澳洲墨尔本皇家理工大学毕业证成绩单原版一比一lvtagr7
 
PORTAFOLIO 2024_ ANASTASIYA KUDINOVA
PORTAFOLIO   2024_  ANASTASIYA  KUDINOVAPORTAFOLIO   2024_  ANASTASIYA  KUDINOVA
PORTAFOLIO 2024_ ANASTASIYA KUDINOVAAnastasiya Kudinova
 
办理学位证(SFU证书)西蒙菲莎大学毕业证成绩单原版一比一
办理学位证(SFU证书)西蒙菲莎大学毕业证成绩单原版一比一办理学位证(SFU证书)西蒙菲莎大学毕业证成绩单原版一比一
办理学位证(SFU证书)西蒙菲莎大学毕业证成绩单原版一比一F dds
 
ARt app | UX Case Study
ARt app | UX Case StudyARt app | UX Case Study
ARt app | UX Case StudySophia Viganò
 
306MTAMount UCLA University Bachelor's Diploma in Social Media
306MTAMount UCLA University Bachelor's Diploma in Social Media306MTAMount UCLA University Bachelor's Diploma in Social Media
306MTAMount UCLA University Bachelor's Diploma in Social MediaD SSS
 
NATA 2024 SYLLABUS, full syllabus explained in detail
NATA 2024 SYLLABUS, full syllabus explained in detailNATA 2024 SYLLABUS, full syllabus explained in detail
NATA 2024 SYLLABUS, full syllabus explained in detailDesigntroIntroducing
 
Cosumer Willingness to Pay for Sustainable Bricks
Cosumer Willingness to Pay for Sustainable BricksCosumer Willingness to Pay for Sustainable Bricks
Cosumer Willingness to Pay for Sustainable Bricksabhishekparmar618
 
VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130
VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130
VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130Suhani Kapoor
 
Call Girls in Okhla Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Okhla Delhi 💯Call Us 🔝8264348440🔝Call Girls in Okhla Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Okhla Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
办理学位证(TheAuckland证书)新西兰奥克兰大学毕业证成绩单原版一比一
办理学位证(TheAuckland证书)新西兰奥克兰大学毕业证成绩单原版一比一办理学位证(TheAuckland证书)新西兰奥克兰大学毕业证成绩单原版一比一
办理学位证(TheAuckland证书)新西兰奥克兰大学毕业证成绩单原版一比一Fi L
 
Call Girls Bapu Nagar 7397865700 Ridhima Hire Me Full Night
Call Girls Bapu Nagar 7397865700 Ridhima Hire Me Full NightCall Girls Bapu Nagar 7397865700 Ridhima Hire Me Full Night
Call Girls Bapu Nagar 7397865700 Ridhima Hire Me Full Nightssuser7cb4ff
 
办理(宾州州立毕业证书)美国宾夕法尼亚州立大学毕业证成绩单原版一比一
办理(宾州州立毕业证书)美国宾夕法尼亚州立大学毕业证成绩单原版一比一办理(宾州州立毕业证书)美国宾夕法尼亚州立大学毕业证成绩单原版一比一
办理(宾州州立毕业证书)美国宾夕法尼亚州立大学毕业证成绩单原版一比一F La
 
Top 10 Modern Web Design Trends for 2025
Top 10 Modern Web Design Trends for 2025Top 10 Modern Web Design Trends for 2025
Top 10 Modern Web Design Trends for 2025Rndexperts
 
WAEC Carpentry and Joinery Past Questions
WAEC Carpentry and Joinery Past QuestionsWAEC Carpentry and Joinery Past Questions
WAEC Carpentry and Joinery Past QuestionsCharles Obaleagbon
 
Abu Dhabi Call Girls O58993O4O2 Call Girls in Abu Dhabi`
Abu Dhabi Call Girls O58993O4O2 Call Girls in Abu Dhabi`Abu Dhabi Call Girls O58993O4O2 Call Girls in Abu Dhabi`
Abu Dhabi Call Girls O58993O4O2 Call Girls in Abu Dhabi`dajasot375
 

Recently uploaded (20)

VIP Call Girls Service Kukatpally Hyderabad Call +91-8250192130
VIP Call Girls Service Kukatpally Hyderabad Call +91-8250192130VIP Call Girls Service Kukatpally Hyderabad Call +91-8250192130
VIP Call Girls Service Kukatpally Hyderabad Call +91-8250192130
 
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
 
Design Portfolio - 2024 - William Vickery
Design Portfolio - 2024 - William VickeryDesign Portfolio - 2024 - William Vickery
Design Portfolio - 2024 - William Vickery
 
VIP Kolkata Call Girl Gariahat 👉 8250192130 Available With Room
VIP Kolkata Call Girl Gariahat 👉 8250192130  Available With RoomVIP Kolkata Call Girl Gariahat 👉 8250192130  Available With Room
VIP Kolkata Call Girl Gariahat 👉 8250192130 Available With Room
 
定制(RMIT毕业证书)澳洲墨尔本皇家理工大学毕业证成绩单原版一比一
定制(RMIT毕业证书)澳洲墨尔本皇家理工大学毕业证成绩单原版一比一定制(RMIT毕业证书)澳洲墨尔本皇家理工大学毕业证成绩单原版一比一
定制(RMIT毕业证书)澳洲墨尔本皇家理工大学毕业证成绩单原版一比一
 
PORTAFOLIO 2024_ ANASTASIYA KUDINOVA
PORTAFOLIO   2024_  ANASTASIYA  KUDINOVAPORTAFOLIO   2024_  ANASTASIYA  KUDINOVA
PORTAFOLIO 2024_ ANASTASIYA KUDINOVA
 
办理学位证(SFU证书)西蒙菲莎大学毕业证成绩单原版一比一
办理学位证(SFU证书)西蒙菲莎大学毕业证成绩单原版一比一办理学位证(SFU证书)西蒙菲莎大学毕业证成绩单原版一比一
办理学位证(SFU证书)西蒙菲莎大学毕业证成绩单原版一比一
 
ARt app | UX Case Study
ARt app | UX Case StudyARt app | UX Case Study
ARt app | UX Case Study
 
306MTAMount UCLA University Bachelor's Diploma in Social Media
306MTAMount UCLA University Bachelor's Diploma in Social Media306MTAMount UCLA University Bachelor's Diploma in Social Media
306MTAMount UCLA University Bachelor's Diploma in Social Media
 
NATA 2024 SYLLABUS, full syllabus explained in detail
NATA 2024 SYLLABUS, full syllabus explained in detailNATA 2024 SYLLABUS, full syllabus explained in detail
NATA 2024 SYLLABUS, full syllabus explained in detail
 
Cosumer Willingness to Pay for Sustainable Bricks
Cosumer Willingness to Pay for Sustainable BricksCosumer Willingness to Pay for Sustainable Bricks
Cosumer Willingness to Pay for Sustainable Bricks
 
VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130
VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130
VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130
 
Call Girls in Okhla Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Okhla Delhi 💯Call Us 🔝8264348440🔝Call Girls in Okhla Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Okhla Delhi 💯Call Us 🔝8264348440🔝
 
办理学位证(TheAuckland证书)新西兰奥克兰大学毕业证成绩单原版一比一
办理学位证(TheAuckland证书)新西兰奥克兰大学毕业证成绩单原版一比一办理学位证(TheAuckland证书)新西兰奥克兰大学毕业证成绩单原版一比一
办理学位证(TheAuckland证书)新西兰奥克兰大学毕业证成绩单原版一比一
 
Call Girls Bapu Nagar 7397865700 Ridhima Hire Me Full Night
Call Girls Bapu Nagar 7397865700 Ridhima Hire Me Full NightCall Girls Bapu Nagar 7397865700 Ridhima Hire Me Full Night
Call Girls Bapu Nagar 7397865700 Ridhima Hire Me Full Night
 
办理(宾州州立毕业证书)美国宾夕法尼亚州立大学毕业证成绩单原版一比一
办理(宾州州立毕业证书)美国宾夕法尼亚州立大学毕业证成绩单原版一比一办理(宾州州立毕业证书)美国宾夕法尼亚州立大学毕业证成绩单原版一比一
办理(宾州州立毕业证书)美国宾夕法尼亚州立大学毕业证成绩单原版一比一
 
young call girls in Pandav nagar 🔝 9953056974 🔝 Delhi escort Service
young call girls in Pandav nagar 🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Pandav nagar 🔝 9953056974 🔝 Delhi escort Service
young call girls in Pandav nagar 🔝 9953056974 🔝 Delhi escort Service
 
Top 10 Modern Web Design Trends for 2025
Top 10 Modern Web Design Trends for 2025Top 10 Modern Web Design Trends for 2025
Top 10 Modern Web Design Trends for 2025
 
WAEC Carpentry and Joinery Past Questions
WAEC Carpentry and Joinery Past QuestionsWAEC Carpentry and Joinery Past Questions
WAEC Carpentry and Joinery Past Questions
 
Abu Dhabi Call Girls O58993O4O2 Call Girls in Abu Dhabi`
Abu Dhabi Call Girls O58993O4O2 Call Girls in Abu Dhabi`Abu Dhabi Call Girls O58993O4O2 Call Girls in Abu Dhabi`
Abu Dhabi Call Girls O58993O4O2 Call Girls in Abu Dhabi`
 

Mule testing

  • 2. This section describes how to test your Mule application. Introduction to Testing Mule Unit Testing Functional Testing Testing Strategies MUnit
  • 3. Typically, existing, bundled tests can fill many of your testing requirements. Thesrc/test/ directory in every Mule ESB Maven project incorporates both unit and functional tests. The included Maven tests project contains additional useful functional and integration tests.
  • 4.  You can leverage the following bundled tests when configuring and customizing Mule:  Unit testing of your simple extensions and customizations  Functional testing of your Mule configuration and setup  Functional and unit testing of your custom modules and transports  Integration testing of multiple modules, transports, and transformers, etc.  System testing of transports that connect to embedded or external services  Stress and performance testing
  • 5. After you have ensured that your setup and configuration are correct and that your customizations work correctly, verify that your system is performing as intended. RunJapex benchmark tests to test individual packages. Additionally, the Mule Profiler Packcan identify memory leaks in your customizations.
  • 6.  If you host your Mule project on MuleForge, you can take advantage of continuous integration testing. MuleForge automatically builds hosted projects using Bamboo, a Continuous Integration Build Server from Atlassian. The build frequency for source code is every 30 minutes, while the snapshot build frequency is once per day. You can request different frequencies for your individual project.  For more information on hosting your project, visit MuleForge.
  • 7. Mule ESB provides a Test Compatibility Kit (TCK) of unit tests that you can use to test your simple extensions as well as your custom modules and transports. The unit tests are located in the -tests.jar file, such as mule-core-3.0.0-tests.jar for Mule version 3.0.0. All unit tests inherit from org.mule.tck.AbstractMuleTestCase These unit tests are beneficial for the following reasons:
  • 8.  Components tested with a TCK test case ensure that the common behavior of the component is compatible with the Mule framework.  Using a TCK test case allows the developer to concentrate on writing tests for specific behavior of their component.  Where testing of a method in the Component API cannot be tested by the TCK test case, the test cases provides an abstract method for the test, ensuring the developer tests all areas of the component.  The TCK provides a default test model that is a simple set of test classes. The developer doesn’t need to worry about writing new test classes for their test cases each time.  The abstract test cases in the TCK use JUnit’s TestCase, so they are compatible with other test cases.
  • 9. TESTING COMPONENT : DESCRIPTION :  AbstractMuleTestCase  A helper test case providing methods for creating test and mock object types. This is the base class for all other abstract TCK classes.
  • 10. TESTING COMPONENT : DESCRIPTION :  AbstractConnectorTestCase  Used to test the common behavior of a connector. This tests dispatching and sending events using mock objects.
  • 11. TESTING COMPONENT : DESCRIPTION :  AbstractMuleMessageFactor yTestCase  Provides tests for all the standard methods defined in theMuleMessageFactory int erface. Add specific tests for converting your transport message to a MuleMessage in your subclass.
  • 12. TESTING COMPONENT : DESCRIPTION :  AbstractMessageReceiverTe stCase  Used to test the common behavior of aMessageReceiver. This tests receiving messages using mock objects.
  • 13. TESTING COMPONENT : DESCRIPTION :  AbstractComponentTestCas e  This is the base class for unit tests that test custom component implementations. Concrete subclasses of this base class includeDefaultJavaComponentTe stCase,PooledJavaComponentT estCase, andSimpleCallableJavaCompon entTestCase, each of which contains methods for testing that component type. For example, theDefaultJavaComponentTestC aseincludes methods for testing the creation, lifecycle, and disposal of a basic Java component.
  • 14. TESTING COMPONENT : DESCRIPTION :  AbstractTransformerTestCas e  Used to test transformers. This class defines a number of tests that ensures that the transformer works in single scenarios as well as in round trip scenarios. There are many concrete sub- classes of this abstract class that test specific types of transformers, such asStringByteArrayTransform ersTestCase.
  • 15. TESTING COMPONENT : DESCRIPTION :  DefaultMuleContextTestCas e  Tests the creation and disposal of the Mule context.
  • 16.  Because Mule ESB is light-weight and embeddable, it is easy to run a Mule Server inside a test case. Mule provides an abstract JUnit test case calledorg.mule.tck.junit4.FunctionalTestCase that runs Mule inside a test case and manages the lifecycle of the server. The org.mule.tck.functional package contains a number of supporting classes for functionally testing Mule code, includingFunctionalTestComponent. These classes are described in more detail in the following sections.
  • 17.  The previous example of FunctionalTestCase covers many common (synchronous) test scenarios, where the flow responds directly to the caller. FunctionalTestComponent can help support richer tests, such as:  Simulating asynchronous communication  Returning mock data to the caller  Common scenarios such as forced exceptions, storing message history, appending text to responses, and delayed responses.
  • 18.  Building a comprehensive suite of automated tests for your Mule project is the primary factor that will ensure its longevity: you’ll gain the security of a safety net catching any regression or incompatible change in your applications before they even leave your workstation.  We’ll look at testing under three different aspects:  *Unit testing: these tests are designed to be fast, with a very narrow system under test. Mule is typically not run for unit tests. *Functional testing: these tests usually involve running Mule, though with a limited configuration, and should run fast enough to be executed on each build. *Integration testing: these tests exercise a full Mule application with settings that are as close to production as possible. They are usually slower to run and not part of the regular build
  • 19.  In a Mule application, unit testing is limited to the code that can be realistically exercised without the need to run it inside Mule itself. As a rule of thumb, code that is Mule aware (for example, code that relies on the registry), will better be exercised with a functional test  With this in mind, the following are good candidates for unit testing:  *Custom transformers *Custom components *Custom expression evaluators *All the Spring beans that your Mule application will use. Typically, these beans come as part of a dependency JAR and are tested while being built, alleviating the need for re- retesting them in your Mule application project
  • 20.  Functional tests are those that most extensively exercise your application configuration. In these tests, you’ll have the freedom and tools for simulating happy and unhappy paths.  The "paths" that you will be interested to cover include:  *Message flows *Rule-based routing, including validation handling within these flows *Error handling
  • 21.  Munit is Beta-version Mule testing framework that allows you to:  mock the output of your message processors  write tests in XML or Java  create tests in the Anypoint Studio drag-and-drop interface  insert spy functionality to track what happens before and after a message processor is called  view coverage reports in Studio  run tests with your plugins  access detailed Mule stacktraces that pinpoint message processor failures  integrate with Maven and Surefire for continuous integration support
  • 22. MUnit is a Mule application testing framework that allows you to easily build automated tests for your integrations and APIs. It provides a full suite of integration and unit test capabilities, and is fully integrated with Maven and Surefire for integration with your continuous deployment environment.
  • 23. Create your Mule test by writing Mule code Create your Mule test by writing Java code Disable flow inbound endpoints Disable endpoint connectors Mock outbound endpoints Mock message processors
  • 24. Create not only unit tests but also integration tests in a local environment — MUnit allows you to start a local FTP/SFTP, DB server or mail server Call the Mule client from Mule code Assert flow exceptions Spy any message processor Verify message processor calls
  • 25. Enable or disable particular tests See assertion/error reports with Mule stack trace Extend the MUnit framework with plugins Check visual coverage in Studio Debug your tests with Studio
  • 26. MUnit is divided among several sub modules. From a user’s point of view there are only two that are really important. Both modules are compatible amongst themselves. The important sub modules are: MUnit Version Mule MUnit Support Version 1.0.x 3.6.x, 3.7.x 1.1.x 3.6.x, 3.7.x
  • 27. The Mule MUnit Support module is meant to follow Mule ESB releases: Mule MUnit Support Version Mule ESB Version 3.6.x 3.6.0 to 3.6.x 3.7.x 3.7.0 to 3.7.x
  • 28. MUnit is fully integrated with Anypoint Studio, allowing you to create, design and run MUnit tests just like you would Mule applications. You can also use Anypoint Studio’sStudio Visual Debugger to debug your MUnit tests.
  • 29. MUnit is fully integrated with Anypoint Studio. You can use Studio’s graphical interface to: Create and design MUnit tests Run your tests View test results and coverage Debug your tests
  • 30. The base of the MUnit Framework consists of MUnit Test Suite files. These files are the.xml files located under the src/test/munit folder in your Mule application’s folder structure. Each MUnit Test Suite file is a collection of MUnit tests. It is meant to work on its own, and should be able to run independently from any other MUnit test suite files.
  • 31. An MUnit test suite file should contain any combination of the following components: Imports Bean Definitions Before/After Suites Before/After Tests MUnit Tests