Upload
robert-van-molken
View
1.256
Download
3
Tags:
Embed Size (px)
DESCRIPTION
Presentation about the importance of testing and two solutions to test a SOA Composite.
Citation preview
Importance of testing and tool usage and responsability
Robert van Mölken, 19-03-2013
Unit testing a SOA Suite Composite
1
2
What you will come to know
• Why testing an important facet is of product development
• Options for testing your code
• Which opties are commonly used for testing SOA applications
– SOA Suite Test Suite Framework• Unit testing / simulation of a SOA composite and components
– SoapUI (optional combined with DBUnit / Groovy)• Unit testing with use of datasources and XPath matching
• How do these solution stack up to each other
• Conclusion about what we know now
3
" A good unit test will not only flush out problems before you get close to production, but it will help regression test your
system as well.”
4
Why testing an important facet is
Too many (IT) projects fail
Two reasons are budget and quality control
More expensive to fix defects in later phases
Ideal defect removal by phase
5
5 reasons why Unit Testing is Important and fun
2. Use as a template for future process and/or code changes
3. Leads to a Better design
4. Know how the code works and reacts on different scenario’s
1. Execute code right away and enjoy result
6
5 reasons why Unit Testing is Important and fun
5. Confidence in Your code and “Refactor without Fear”
7
Options for testing your code
Front-end
Java backend
Middleware
8
Unit testing with SOA Suite testsuites framework
Responsability of SOA Suite within test cycle
9
Creating a Test Suite
Right-click on testsuites folder in SOA project to create a new suite
10
Creating a Composite Test
Right-click on tests folder in SOA project to create a new test
11
Emulating a Service Call
Service operations can be emulated, via manual value or imported file
12
Emulating a Service Response
Service response can be emulated, if not service is really called
13
Asserting Input / Output
Request and response messaged can be asserted on expected data
14
Component testing (PS5+)
Since PS5 it is possible to assert data of BPEL component activities
15
Component data assertion
Asserting is possible on almost every activity. Based on primitives, xml similar, etc. It is also possible to assert the execution count.
16
Reporting (enterprise manager)
Tests can be run via the enterprise manager. Which reports the results.
Demo time: SOA Suite test framework
17
(Unit) testing with SoapUI
Responsability of SoapUI within test cycle
19
Setup tests within SoapUI (1/4)
SoapUi project based on a service WSDL Add multiple service bindings to project
20
Setup tests within SoapUI (2/4)
Execute single operations without assertions Create testsuite(s) as a empty template or based on a service binding
21
Setup tests within SoapUI (3/4)
Generating a testsuite is easy by using a wizard with a few options
22
Setup tests within SoapUI (4/4)
After generating you will have a testsuite with testcase(s) and teststep(s)
23
SoapUi Teststeps
• Test step based on a SOAP service request
• Test step based on a Groovy script
• Test step for defining testcase properties
• Test step for transfering property values
• Test step for defining a conditionele goto
• Test step for defining a delay (in miliseconds)
• Test step for defining a call to another testcase (and other testsuite)
24
• Test step based on a REST request
• Test step based on a HTTP request (GET, POST, PUT…)
• Test step based on a MOCK service response
• Test step based on a JDBC query to database
• Test step based on a AMF (action message, AS3) request
• Test step to create a manual action of human interaction
SoapUi Teststeps
25
SoapUi Pro Teststeps
• Test step to setup a datasource which retrieves a dataset which can be used in other test steps
• Test step for defining a datasource loop
• Test step for exporting property values for reporting
• Test step for dynamically defining properties (current data/time)
• Test step to assert/validate property values, request or response messages.
26
Datasource step when using SoapUI Free
Commandline with Apache Ant it’s possible to start SoapUI
Within SoapUi you can define properties which can be overwritten by Ant
A property can be a reference to a file which can be read by groovy
Alternatively is the use of a DBUnit step in the Ant script to insert datasets
Demo Time: SoapUi Hands-on
27
How do they stack up to each other
Aspect SOA Suite SoapUI (DBUnit)
Setup Environment + +-
Setup Testcases + +
Easy to adjust / clone - ++
Real unit testing ++ +-
Integration testing - ++
Continuous integration + ++
Reporting ++ +
Assertion of data -- ++
Conclusion:
Unit testing is important, cuts time & costs and gives a developer confidence!