Mobicents Summit 2012 - George Vagenas - Testing SIP Applications with Arquillian and SipUnit
1. Testing SIP Applications with
Arquillian and SipUnit
Annual Mobicents Community Summit
Rio de Janeiro, October 3-8, 2012
George Vagenas
CDI Telco Framework & SIP Testing project lead
2. Agenda
● Introduction
○ SipServlets applications testing
○ Arquillian extension for SipServlets
○ SipUnit
● Arquillian Extension for SipServlets
○ Features
○ MSS Tomcat 6 & Tomcat 7 containers
● SipUnit
○ Features
3. Past year achievements
● Arquillian Extension for SipServlets 1.0.0.ALPHA1
● Telestax took over leadership of SipUnit
● SipUnit 2.0.0
4. SipServlets applications testing
Requirements:
● Manage SipServlets enabled container
● Manage test archive
● Integration with a testing framework (JUnit
or TestNG)
● SIP Client (UAC/UAS) to interact with the
SipServlet application
5. Arquillian Extension for
SipServlets
Arquillian testing framework, seeks to minimize the burden
on the developer to author integration tests by handling all
aspects of test execution, including:
● managing the lifecycle of the container (start/stop),
● bundling the test class with dependent classes and
resources into a deployable archive,
● enhancing the test class (e.g., resolving @Inject, @EJB
and @Resource injections),
● deploying the archive to test (deploy/undeploy) and
capturing results and failures.
7. Arquillian Extension for
SipServlets
Extras
● Annotations
○ @ContextParam
○ @ContextParamMap
○ @ConcurrencyControlMode
● Helper classes
○ ContextParamTool
○ SipStackTool
● Lifecycle extension to provide finer grained
control over container's and test's lifecycle
8. Arquillian Extension for
SipServlets
● Finer grained control over the test's lifecycle
and the container's lifecycle
● Override container configuration as needed
● The integration is completely transparent,
which means you can launch the tests and
get the test results using existing IDE, Ant
and Maven test plugins without any add-ons.
9. Arquillian Extension for
SipServlets
● CTF can be optionally enabled in order to
enrich the test or the test archive.
● On the same test we can have
○ Multiple test archives
○ Multiple container configuration
14. SipUnit
SipUnit provides a test environment geared
toward unit testing SIP applications.
The primary goal of SipUnit is to abstract the
details of SIP messaging/call handling and
facilitate free-flowing, sequential test code so
that a test target can be exercised quickly and
painlessly
15. SipUnit features
● Maven artifacts
● Junit 4 support
● TLS support
● SIP UAC & UAS
● uses the JAIN-SIP reference implementation as its
underlying SIP stack/engine
● JUnit-like test development and execution environment
with SIP-specific assertions added
● Different levels of SIP handling abstraction depending
on test case needs. If you don't care how a setup call
gets established, use the highest level - SipPhone.
makeCall().
16. SipUnit features
● Support for registration and call handling with or without
authentication
● Support for presence subscription handling
(SUBSCRIBE/NOTIFY)
● CANCEL handling
● Support for MESSAGE
● REFER and associated subscription handling
● Support for NAT traversal (STUN)
● Support for testcase-specified timeouts
● A test can act as more than one network element - ie, it
can act as both the caller and callee endpoints to test a
network element between the two.