SlideShare a Scribd company logo
1 of 6
Download to read offline
© 2010 Torry Harris Business Solutions. All rights reserved Page 1
TORRY HARRIS BUSINESS SOLUTIONS
Unit Testing webMethods
Integrations using JUnit
Practicing TDD for EAI projects
Ganapathi Nanjappa
4/28/2010
© 2010 Torry Harris Business Solutions. All rights reserved Page 2
Table of Contents
1. Abstract .................................................................................................................................................3
2. Introduction...........................................................................................................................................3
3. JUnit wrapper for webMethods............................................................................................................3
4. JUnit test suite for webMethods Services.............................................................................................5
5. Limitations of the JUnit wrapper...........................................................................................................6
6. Conclusion.............................................................................................................................................6
© 2010 Torry Harris Business Solutions. All rights reserved Page 3
1. Abstract
In a very short time, Test Driven Development (TDD) has branched off from Extreme Programming (XP)
and gained a significant prominence among non-XP projects. It is now seen as a practice by itself and
applied to various programming methodologies including RUP and AUP.
In addition to the quality benefits offered by practicing TDD, the unit tests provide a working
specification of the functional code, and a fully functional test suite that can be reused many times over.
This white paper presents a solution to unit test webMethods Flow/Java services using the popular JUnit
test framework, and helps put TDD into practice for Enterprise Application Integration projects.
2. Introduction
JUnit is a unit testing framework for the Java programming language and has played a significant role in
the practice of TDD in Java projects. It provides reusable components to organize and execute test cases
and verify the results.
webMethods Developer is the stand-alone graphical development tool used to build, edit and test
integration logic implemented in the webMethods flow language.
While the webMethods Developer provides various tools for testing and debugging the integration
solutions, it does not provide support for using JUnit from within the Developer. This white paper details
how JUnit can be used for testing services implemented in the webMethods flow/java language.
3. JUnit wrapper for webMethods
As part of the ongoing efforts at the EAI Centre of Excellence at Torry Harris, a JUnit wrapper for
webMethods was developed to test and verify the flow services implemented in the webMethods flow
language. The JUnit Wrapper consists of a single java class named “WMTestClient” and provides
methods to invoke any flow/java service deployed on the webMethods Integration Server (IS). The
wrapper method accepts the input filename for the service under test and converts the file into a format
that webMethods IS understands. The screen shot of a test method is shown below:
© 2010 Torry Harris Business Solutions. All rights reserved Page 4
A sample JUnit test method for testing the “getConnectionStatistics” service.
The wrapper provides all the result variables of the service in a java “Map” and any variable can be used
for asserting the test results. In the above test case, the output variable “TotalConnections” is used for
asserting the test case. The wrapper is generic enough to allow assertion of multiple output cases, as
may be required for services that return multiple values.
The generic wrapper method to test any webMethods flow/java service.
The wrapper accepts input XML file, package and service names as input apart from the optional output
file and location to save the output file. The input files and the test cases are generated by the
developer for the services developed/modified. Input files can be generated from the webMethods
Developer console by selecting the “Save Pipeline” option for the service under test. The output file can
be used for closer inspection of the results and/or for comparing the results with a previous test run.
The input and output file locations configured in the properties file.
© 2010 Torry Harris Business Solutions. All rights reserved Page 5
The properties for the service under test and the server details are stored in a configuration file to allow
changes to the inputs and server to test on without having to recompile the source. It also allows for
easy customizations, for example, the variable to assert and the assertion value can also be made
configurable for each service under test.
4. JUnit test suite for webMethods Services
A JUnit test suite was developed to test a few webMethods in-built services using the wrapper, the
results as shown below:
The result of a JUnit test suite execution that tests various webMethods built-in services.
With JUnit 4, creating a test suite is as easy as adding test methods to a source file. To create a new test
method, any existing test method (like the one shown in the previous section) can be copied and
renamed to reflect the new service under test. The input/output parameters are defined in the
configuration file and the assert variable and value are updated to match the new service.
The unit test suites created as part of different projects can be invoked using ‘ant’
(http://ant.apache.org/) scripts from the command line as and when necessary (this will be mostly done
when there are changes to dependant modules). Various JUnit ant tasks are available to generate
reports on the tests executed. These reports can be used for verification of services tested and the
coverage.
© 2010 Torry Harris Business Solutions. All rights reserved Page 6
5. Limitations of the JUnit wrapper
The JUnit Wrapper for webMethods has the following limitations that JUnit has, it cannot:
Automatically generate tests for a service under test
Automatically generate test data for a service under test
Provide coverage metrics for a webMethods flow/java service
6. Conclusion
Test-driven development is an important practice to delivering high quality code and to enable a flexible
and result-oriented way of development. Apart from verification of code, it provides an automatic
catalog of unit tests that can be regressed.
A test framework for webMethods integrations is even more crucial to simplify and automate unit tests
as integrations work on heterogeneous environment. The framework presented in this paper is simple
to setup and maintain, and enables TDD to be practiced for EAI projects. It uses the features made
available by one of the most popular open-source testing solution and eliminates the need for
developing a custom unit-testing solution for webMethods.

More Related Content

Viewers also liked

Data power Performance Tuning
Data power Performance TuningData power Performance Tuning
Data power Performance TuningKINGSHUK MAJUMDER
 
Top 9 webmethods interview questions answers
Top 9 webmethods interview questions answersTop 9 webmethods interview questions answers
Top 9 webmethods interview questions answersjonhmart036
 
Using IBM DataPower for rapid security and application integration with an op...
Using IBM DataPower for rapid security and application integration with an op...Using IBM DataPower for rapid security and application integration with an op...
Using IBM DataPower for rapid security and application integration with an op...Gennadiy Civil
 
Software AG’s webMethods Integration Cloud: Integrate Cloud Apps with ease
Software AG’s webMethods Integration Cloud: Integrate Cloud Apps with ease Software AG’s webMethods Integration Cloud: Integrate Cloud Apps with ease
Software AG’s webMethods Integration Cloud: Integrate Cloud Apps with ease Kellton Tech Solutions Ltd
 
Command Central Overview
Command Central OverviewCommand Central Overview
Command Central OverviewSoftware AG
 
OAuth 2.0 with IBM WebSphere DataPower
OAuth 2.0 with IBM WebSphere DataPowerOAuth 2.0 with IBM WebSphere DataPower
OAuth 2.0 with IBM WebSphere DataPowerShiu-Fun Poon
 
Presentación webMethods BPMS por Simbius S.A.
Presentación webMethods BPMS por Simbius S.A.Presentación webMethods BPMS por Simbius S.A.
Presentación webMethods BPMS por Simbius S.A.Simbius SGP
 
Data Power Architectural Patterns - Jagadish Vemugunta
Data Power Architectural Patterns - Jagadish VemuguntaData Power Architectural Patterns - Jagadish Vemugunta
Data Power Architectural Patterns - Jagadish Vemuguntafloridawusergroup
 

Viewers also liked (11)

Data power Performance Tuning
Data power Performance TuningData power Performance Tuning
Data power Performance Tuning
 
CAF & Portlet Development Notes
CAF & Portlet Development NotesCAF & Portlet Development Notes
CAF & Portlet Development Notes
 
Top 9 webmethods interview questions answers
Top 9 webmethods interview questions answersTop 9 webmethods interview questions answers
Top 9 webmethods interview questions answers
 
Using IBM DataPower for rapid security and application integration with an op...
Using IBM DataPower for rapid security and application integration with an op...Using IBM DataPower for rapid security and application integration with an op...
Using IBM DataPower for rapid security and application integration with an op...
 
Software AG’s webMethods Integration Cloud: Integrate Cloud Apps with ease
Software AG’s webMethods Integration Cloud: Integrate Cloud Apps with ease Software AG’s webMethods Integration Cloud: Integrate Cloud Apps with ease
Software AG’s webMethods Integration Cloud: Integrate Cloud Apps with ease
 
Command Central Overview
Command Central OverviewCommand Central Overview
Command Central Overview
 
OAuth 2.0 with IBM WebSphere DataPower
OAuth 2.0 with IBM WebSphere DataPowerOAuth 2.0 with IBM WebSphere DataPower
OAuth 2.0 with IBM WebSphere DataPower
 
Presentación webMethods BPMS por Simbius S.A.
Presentación webMethods BPMS por Simbius S.A.Presentación webMethods BPMS por Simbius S.A.
Presentación webMethods BPMS por Simbius S.A.
 
Intorduction to Datapower
Intorduction to DatapowerIntorduction to Datapower
Intorduction to Datapower
 
Data Power Architectural Patterns - Jagadish Vemugunta
Data Power Architectural Patterns - Jagadish VemuguntaData Power Architectural Patterns - Jagadish Vemugunta
Data Power Architectural Patterns - Jagadish Vemugunta
 
Datapower Steven Cawn
Datapower Steven CawnDatapower Steven Cawn
Datapower Steven Cawn
 

Similar to EAI Test Driven Development WebMethods | Torry Harris Whitepaper

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
 
New features in qtp11
New features in qtp11New features in qtp11
New features in qtp11G.C Reddy
 
Performance Test Plan - Sample 2
Performance Test Plan - Sample 2Performance Test Plan - Sample 2
Performance Test Plan - Sample 2Atul Pant
 
New features in qtp11
New features in qtp11New features in qtp11
New features in qtp11Ramu Palanki
 
Qtp 11 new enhacements in
Qtp 11 new enhacements inQtp 11 new enhacements in
Qtp 11 new enhacements inRamu Palanki
 
DevOps CI Automation Continuous Integration
DevOps CI Automation Continuous IntegrationDevOps CI Automation Continuous Integration
DevOps CI Automation Continuous IntegrationIRJET Journal
 
Qtp questions and answers
Qtp questions and answersQtp questions and answers
Qtp questions and answersRamu Palanki
 
A Technique for Testing Composed Web Services Including Footprint
A Technique for Testing Composed Web Services Including FootprintA Technique for Testing Composed Web Services Including Footprint
A Technique for Testing Composed Web Services Including FootprintIRJET Journal
 
STC 2014_ADAPTING TEST AUTOMATION TECHNIQUES TO IMPROVE ORACLE ERP CONFIGURAT...
STC 2014_ADAPTING TEST AUTOMATION TECHNIQUES TO IMPROVE ORACLE ERP CONFIGURAT...STC 2014_ADAPTING TEST AUTOMATION TECHNIQUES TO IMPROVE ORACLE ERP CONFIGURAT...
STC 2014_ADAPTING TEST AUTOMATION TECHNIQUES TO IMPROVE ORACLE ERP CONFIGURAT...Shivika Khare
 
Open Source Software Testing Tools
Open Source Software Testing ToolsOpen Source Software Testing Tools
Open Source Software Testing ToolsVaruna Harshana
 
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
 
Rit 8.5.0 training release notes
Rit 8.5.0 training release notesRit 8.5.0 training release notes
Rit 8.5.0 training release notesDarrel Rader
 
Marathon Testing Tool
Marathon Testing ToolMarathon Testing Tool
Marathon Testing Toolnarayan dudhe
 
Hybrid framework for test automation
Hybrid framework for test automationHybrid framework for test automation
Hybrid framework for test automationsrivinayak
 

Similar to EAI Test Driven Development WebMethods | Torry Harris Whitepaper (20)

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)
 
New features in qtp11
New features in qtp11New features in qtp11
New features in qtp11
 
Front Cover:
Front Cover:Front Cover:
Front Cover:
 
Front Cover:
Front Cover:Front Cover:
Front Cover:
 
Front Cover:
Front Cover:Front Cover:
Front Cover:
 
Performance Test Plan - Sample 2
Performance Test Plan - Sample 2Performance Test Plan - Sample 2
Performance Test Plan - Sample 2
 
Qtp (2)
Qtp (2)Qtp (2)
Qtp (2)
 
New features in qtp11
New features in qtp11New features in qtp11
New features in qtp11
 
Qtp 11 new enhacements in
Qtp 11 new enhacements inQtp 11 new enhacements in
Qtp 11 new enhacements in
 
DevOps CI Automation Continuous Integration
DevOps CI Automation Continuous IntegrationDevOps CI Automation Continuous Integration
DevOps CI Automation Continuous Integration
 
Qtp tutorial
Qtp tutorialQtp tutorial
Qtp tutorial
 
Qtp questions and answers
Qtp questions and answersQtp questions and answers
Qtp questions and answers
 
A Technique for Testing Composed Web Services Including Footprint
A Technique for Testing Composed Web Services Including FootprintA Technique for Testing Composed Web Services Including Footprint
A Technique for Testing Composed Web Services Including Footprint
 
White paper ready api
White paper  ready apiWhite paper  ready api
White paper ready api
 
STC 2014_ADAPTING TEST AUTOMATION TECHNIQUES TO IMPROVE ORACLE ERP CONFIGURAT...
STC 2014_ADAPTING TEST AUTOMATION TECHNIQUES TO IMPROVE ORACLE ERP CONFIGURAT...STC 2014_ADAPTING TEST AUTOMATION TECHNIQUES TO IMPROVE ORACLE ERP CONFIGURAT...
STC 2014_ADAPTING TEST AUTOMATION TECHNIQUES TO IMPROVE ORACLE ERP CONFIGURAT...
 
Open Source Software Testing Tools
Open Source Software Testing ToolsOpen Source Software Testing Tools
Open Source Software Testing Tools
 
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
 
Rit 8.5.0 training release notes
Rit 8.5.0 training release notesRit 8.5.0 training release notes
Rit 8.5.0 training release notes
 
Marathon Testing Tool
Marathon Testing ToolMarathon Testing Tool
Marathon Testing Tool
 
Hybrid framework for test automation
Hybrid framework for test automationHybrid framework for test automation
Hybrid framework for test automation
 

More from Torry Harris Business Solutions

Application Oriented Networks: An SOA Perspective | Torry Harris Whitepaper
Application Oriented Networks: An SOA Perspective | Torry Harris WhitepaperApplication Oriented Networks: An SOA Perspective | Torry Harris Whitepaper
Application Oriented Networks: An SOA Perspective | Torry Harris WhitepaperTorry Harris Business Solutions
 
Outsourcing SOA Implementation | Torry Harris Whitepaper
Outsourcing SOA Implementation | Torry Harris WhitepaperOutsourcing SOA Implementation | Torry Harris Whitepaper
Outsourcing SOA Implementation | Torry Harris WhitepaperTorry Harris Business Solutions
 
SOA Offshore Onsite Delivery Model | Torry Harris Whitepaper
SOA Offshore Onsite Delivery Model | Torry Harris WhitepaperSOA Offshore Onsite Delivery Model | Torry Harris Whitepaper
SOA Offshore Onsite Delivery Model | Torry Harris WhitepaperTorry Harris Business Solutions
 
SOA Open Source Implementation | Torry Harris Whitepaper
SOA Open Source Implementation | Torry Harris WhitepaperSOA Open Source Implementation | Torry Harris Whitepaper
SOA Open Source Implementation | Torry Harris WhitepaperTorry Harris Business Solutions
 
Comparison of Cloud Computing Services | Torry Harris Whitepaper
Comparison of Cloud Computing Services | Torry Harris WhitepaperComparison of Cloud Computing Services | Torry Harris Whitepaper
Comparison of Cloud Computing Services | Torry Harris WhitepaperTorry Harris Business Solutions
 
Eucalyptus on Xen - Build Enterprise Private Cloud | Torry Harris Whitepaper
Eucalyptus on Xen - Build Enterprise Private Cloud | Torry Harris WhitepaperEucalyptus on Xen - Build Enterprise Private Cloud | Torry Harris Whitepaper
Eucalyptus on Xen - Build Enterprise Private Cloud | Torry Harris WhitepaperTorry Harris Business Solutions
 
BPM - The Soft Science of Change | Torry Harris Whitepaper
BPM - The Soft Science of Change | Torry Harris WhitepaperBPM - The Soft Science of Change | Torry Harris Whitepaper
BPM - The Soft Science of Change | Torry Harris WhitepaperTorry Harris Business Solutions
 

More from Torry Harris Business Solutions (20)

Application Rationalization | Torry Harris Whitepaper
Application Rationalization | Torry Harris WhitepaperApplication Rationalization | Torry Harris Whitepaper
Application Rationalization | Torry Harris Whitepaper
 
Application Oriented Networks: An SOA Perspective | Torry Harris Whitepaper
Application Oriented Networks: An SOA Perspective | Torry Harris WhitepaperApplication Oriented Networks: An SOA Perspective | Torry Harris Whitepaper
Application Oriented Networks: An SOA Perspective | Torry Harris Whitepaper
 
Outsourcing SOA Implementation | Torry Harris Whitepaper
Outsourcing SOA Implementation | Torry Harris WhitepaperOutsourcing SOA Implementation | Torry Harris Whitepaper
Outsourcing SOA Implementation | Torry Harris Whitepaper
 
SOA Migration Services | Torry Harris
SOA Migration Services | Torry HarrisSOA Migration Services | Torry Harris
SOA Migration Services | Torry Harris
 
SOA Roadmap and Education | Torry Harris
SOA Roadmap and Education | Torry HarrisSOA Roadmap and Education | Torry Harris
SOA Roadmap and Education | Torry Harris
 
SOA Offshore Onsite Delivery Model | Torry Harris Whitepaper
SOA Offshore Onsite Delivery Model | Torry Harris WhitepaperSOA Offshore Onsite Delivery Model | Torry Harris Whitepaper
SOA Offshore Onsite Delivery Model | Torry Harris Whitepaper
 
SOA Test Methodology | Torry Harris Whitepaper
SOA Test Methodology | Torry Harris WhitepaperSOA Test Methodology | Torry Harris Whitepaper
SOA Test Methodology | Torry Harris Whitepaper
 
SOA for Retail | Torry Harris Whitepaper
SOA for Retail | Torry Harris WhitepaperSOA for Retail | Torry Harris Whitepaper
SOA for Retail | Torry Harris Whitepaper
 
SOA for Telecom | Torry Harris Whitepaper
SOA for Telecom | Torry Harris WhitepaperSOA for Telecom | Torry Harris Whitepaper
SOA for Telecom | Torry Harris Whitepaper
 
A Guide to SOA Governance | Torry Harris Whitepaper
A Guide to SOA Governance | Torry Harris WhitepaperA Guide to SOA Governance | Torry Harris Whitepaper
A Guide to SOA Governance | Torry Harris Whitepaper
 
SOA Maturity Model | Torry Harris Whitepaper
SOA Maturity Model | Torry Harris WhitepaperSOA Maturity Model | Torry Harris Whitepaper
SOA Maturity Model | Torry Harris Whitepaper
 
SOA Open Source Implementation | Torry Harris Whitepaper
SOA Open Source Implementation | Torry Harris WhitepaperSOA Open Source Implementation | Torry Harris Whitepaper
SOA Open Source Implementation | Torry Harris Whitepaper
 
Migration and Security in SOA | Torry Harris Whitepaper
Migration and Security in SOA | Torry Harris WhitepaperMigration and Security in SOA | Torry Harris Whitepaper
Migration and Security in SOA | Torry Harris Whitepaper
 
Web Services in SOA | Torry Harris
Web Services in SOA | Torry HarrisWeb Services in SOA | Torry Harris
Web Services in SOA | Torry Harris
 
Cloud Catalyst Programme | Torry Harris Whitepaper
Cloud Catalyst Programme | Torry Harris WhitepaperCloud Catalyst Programme | Torry Harris Whitepaper
Cloud Catalyst Programme | Torry Harris Whitepaper
 
Cloud Computing Overview | Torry Harris Whitepaper
Cloud Computing Overview | Torry Harris WhitepaperCloud Computing Overview | Torry Harris Whitepaper
Cloud Computing Overview | Torry Harris Whitepaper
 
Comparison of Cloud Computing Services | Torry Harris Whitepaper
Comparison of Cloud Computing Services | Torry Harris WhitepaperComparison of Cloud Computing Services | Torry Harris Whitepaper
Comparison of Cloud Computing Services | Torry Harris Whitepaper
 
Eucalyptus on Xen - Build Enterprise Private Cloud | Torry Harris Whitepaper
Eucalyptus on Xen - Build Enterprise Private Cloud | Torry Harris WhitepaperEucalyptus on Xen - Build Enterprise Private Cloud | Torry Harris Whitepaper
Eucalyptus on Xen - Build Enterprise Private Cloud | Torry Harris Whitepaper
 
BPM - The Soft Science of Change | Torry Harris Whitepaper
BPM - The Soft Science of Change | Torry Harris WhitepaperBPM - The Soft Science of Change | Torry Harris Whitepaper
BPM - The Soft Science of Change | Torry Harris Whitepaper
 
Web Service Extensions | Torry Harris Whitepaper
Web Service Extensions | Torry Harris WhitepaperWeb Service Extensions | Torry Harris Whitepaper
Web Service Extensions | Torry Harris Whitepaper
 

Recently uploaded

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 

Recently uploaded (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 

EAI Test Driven Development WebMethods | Torry Harris Whitepaper

  • 1. © 2010 Torry Harris Business Solutions. All rights reserved Page 1 TORRY HARRIS BUSINESS SOLUTIONS Unit Testing webMethods Integrations using JUnit Practicing TDD for EAI projects Ganapathi Nanjappa 4/28/2010
  • 2. © 2010 Torry Harris Business Solutions. All rights reserved Page 2 Table of Contents 1. Abstract .................................................................................................................................................3 2. Introduction...........................................................................................................................................3 3. JUnit wrapper for webMethods............................................................................................................3 4. JUnit test suite for webMethods Services.............................................................................................5 5. Limitations of the JUnit wrapper...........................................................................................................6 6. Conclusion.............................................................................................................................................6
  • 3. © 2010 Torry Harris Business Solutions. All rights reserved Page 3 1. Abstract In a very short time, Test Driven Development (TDD) has branched off from Extreme Programming (XP) and gained a significant prominence among non-XP projects. It is now seen as a practice by itself and applied to various programming methodologies including RUP and AUP. In addition to the quality benefits offered by practicing TDD, the unit tests provide a working specification of the functional code, and a fully functional test suite that can be reused many times over. This white paper presents a solution to unit test webMethods Flow/Java services using the popular JUnit test framework, and helps put TDD into practice for Enterprise Application Integration projects. 2. Introduction JUnit is a unit testing framework for the Java programming language and has played a significant role in the practice of TDD in Java projects. It provides reusable components to organize and execute test cases and verify the results. webMethods Developer is the stand-alone graphical development tool used to build, edit and test integration logic implemented in the webMethods flow language. While the webMethods Developer provides various tools for testing and debugging the integration solutions, it does not provide support for using JUnit from within the Developer. This white paper details how JUnit can be used for testing services implemented in the webMethods flow/java language. 3. JUnit wrapper for webMethods As part of the ongoing efforts at the EAI Centre of Excellence at Torry Harris, a JUnit wrapper for webMethods was developed to test and verify the flow services implemented in the webMethods flow language. The JUnit Wrapper consists of a single java class named “WMTestClient” and provides methods to invoke any flow/java service deployed on the webMethods Integration Server (IS). The wrapper method accepts the input filename for the service under test and converts the file into a format that webMethods IS understands. The screen shot of a test method is shown below:
  • 4. © 2010 Torry Harris Business Solutions. All rights reserved Page 4 A sample JUnit test method for testing the “getConnectionStatistics” service. The wrapper provides all the result variables of the service in a java “Map” and any variable can be used for asserting the test results. In the above test case, the output variable “TotalConnections” is used for asserting the test case. The wrapper is generic enough to allow assertion of multiple output cases, as may be required for services that return multiple values. The generic wrapper method to test any webMethods flow/java service. The wrapper accepts input XML file, package and service names as input apart from the optional output file and location to save the output file. The input files and the test cases are generated by the developer for the services developed/modified. Input files can be generated from the webMethods Developer console by selecting the “Save Pipeline” option for the service under test. The output file can be used for closer inspection of the results and/or for comparing the results with a previous test run. The input and output file locations configured in the properties file.
  • 5. © 2010 Torry Harris Business Solutions. All rights reserved Page 5 The properties for the service under test and the server details are stored in a configuration file to allow changes to the inputs and server to test on without having to recompile the source. It also allows for easy customizations, for example, the variable to assert and the assertion value can also be made configurable for each service under test. 4. JUnit test suite for webMethods Services A JUnit test suite was developed to test a few webMethods in-built services using the wrapper, the results as shown below: The result of a JUnit test suite execution that tests various webMethods built-in services. With JUnit 4, creating a test suite is as easy as adding test methods to a source file. To create a new test method, any existing test method (like the one shown in the previous section) can be copied and renamed to reflect the new service under test. The input/output parameters are defined in the configuration file and the assert variable and value are updated to match the new service. The unit test suites created as part of different projects can be invoked using ‘ant’ (http://ant.apache.org/) scripts from the command line as and when necessary (this will be mostly done when there are changes to dependant modules). Various JUnit ant tasks are available to generate reports on the tests executed. These reports can be used for verification of services tested and the coverage.
  • 6. © 2010 Torry Harris Business Solutions. All rights reserved Page 6 5. Limitations of the JUnit wrapper The JUnit Wrapper for webMethods has the following limitations that JUnit has, it cannot: Automatically generate tests for a service under test Automatically generate test data for a service under test Provide coverage metrics for a webMethods flow/java service 6. Conclusion Test-driven development is an important practice to delivering high quality code and to enable a flexible and result-oriented way of development. Apart from verification of code, it provides an automatic catalog of unit tests that can be regressed. A test framework for webMethods integrations is even more crucial to simplify and automate unit tests as integrations work on heterogeneous environment. The framework presented in this paper is simple to setup and maintain, and enables TDD to be practiced for EAI projects. It uses the features made available by one of the most popular open-source testing solution and eliminates the need for developing a custom unit-testing solution for webMethods.