SlideShare una empresa de Scribd logo
1 de 6
Descargar para leer sin conexión
© 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.

Más contenido relacionado

Destacado

Data power Performance Tuning
Data power Performance TuningData power Performance Tuning
Data power Performance Tuning
KINGSHUK MAJUMDER
 
Top 9 webmethods interview questions answers
Top 9 webmethods interview questions answersTop 9 webmethods interview questions answers
Top 9 webmethods interview questions answers
jonhmart036
 
Data Power Architectural Patterns - Jagadish Vemugunta
Data Power Architectural Patterns - Jagadish VemuguntaData Power Architectural Patterns - Jagadish Vemugunta
Data Power Architectural Patterns - Jagadish Vemugunta
floridawusergroup
 

Destacado (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 a EAI Test Driven Development WebMethods | Torry Harris Whitepaper

Performance Test Plan - Sample 2
Performance Test Plan - Sample 2Performance Test Plan - Sample 2
Performance Test Plan - Sample 2
Atul Pant
 
New features in qtp11
New features in qtp11New features in qtp11
New features in qtp11
Ramu Palanki
 
Qtp 11 new enhacements in
Qtp 11 new enhacements inQtp 11 new enhacements in
Qtp 11 new enhacements in
Ramu Palanki
 
Qtp questions and answers
Qtp questions and answersQtp questions and answers
Qtp questions and answers
Ramu Palanki
 
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
 
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
Darrel Rader
 
Hybrid framework for test automation
Hybrid framework for test automationHybrid framework for test automation
Hybrid framework for test automation
srivinayak
 

Similar a 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
 

Más de Torry Harris Business Solutions

Más de 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
 

Último

Último (20)

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
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
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
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
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
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...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 

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.