Testing SIP Applications with         Arquillian and SipUnit      Annual Mobicents Community Summit          Rio de Janeir...
Agenda●   Introduction    ○   SipServlets applications testing    ○   Arquillian extension for SipServlets    ○   SipUnit●...
Past year achievements● Arquillian Extension for SipServlets 1.0.0.ALPHA1● Telestax took over leadership of SipUnit● SipUn...
SipServlets applications testingRequirements:● Manage SipServlets enabled container● Manage test archive● Integration with...
Arquillian Extension forSipServletsArquillian testing framework, seeks to minimize the burdenon the developer to author in...
Arquillian Extension forSipServletsMobicents brings the Sip Servlets Arquilliancontainer for testing converged application...
Arquillian Extension forSipServletsExtras● Annotations   ○ @ContextParam   ○ @ContextParamMap   ○ @ConcurrencyControlMode●...
Arquillian Extension forSipServlets● Finer grained control over the tests lifecycle  and the containers lifecycle● Overrid...
Arquillian Extension forSipServlets● CTF can be optionally enabled in order to  enrich the test or the test archive.● On t...
Arquillian Extension for   SipServlets<container qualifier="mss-tomcat-embedded-6" default="true" mode="manual">        <c...
Arquillian Extension forSipServlets@RunWith(Arquillian.class)public class ShootistSipServletTest extends SipTestCase{@Depl...
Arquillian Extension forSipServlets    @Test @ContextParam(name="cancel", value="true")    public void testShootist() thro...
Arquillian Extension forSipServletsWhat comes next:● Mobicents Sip Servlets AS7 container
SipUnitSipUnit provides a test environment gearedtoward unit testing SIP applications.The primary goal of SipUnit is to ab...
SipUnit features● Maven artifacts● Junit 4 support● TLS support● SIP UAC & UAS● uses the JAIN-SIP reference implementation...
SipUnit features● Support for registration and call handling with or without  authentication● Support for presence subscri...
SipUnit exampleb.listenForIncomingCall();a.initiateOutgoingCall("sip:becky@nist.gov",                 null);b.waitForIncom...
SipUnit download●   Binary: http://code.google.com/p/commtesting/downloads/list●   Maven artifact        <dependency>     ...
SipServletes Commtesting links●   Project site: http://code.google.com/p/commtesting/●   SipServlets Arquillian Extension ...
ContactGeorge Vagenasgvagenas@gmail.comThank you
Upcoming SlideShare
Loading in …5
×

Mobicents Summit 2012 - George Vagenas - Testing SIP Applications with Arquillian and SipUnit

2,214 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
2,214
On SlideShare
0
From Embeds
0
Number of Embeds
95
Actions
Shares
0
Downloads
8
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

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, 2012George VagenasCDI 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 testingRequirements:● 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 forSipServletsArquillian testing framework, seeks to minimize the burdenon the developer to author integration tests by handling allaspects 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.
  6. Arquillian Extension forSipServletsMobicents brings the Sip Servlets Arquilliancontainer for testing converged applications.Container is based on:● Tomcat 6.x● Tomcat 7.x
  7. Arquillian Extension forSipServletsExtras● Annotations ○ @ContextParam ○ @ContextParamMap ○ @ConcurrencyControlMode● Helper classes ○ ContextParamTool ○ SipStackTool● Lifecycle extension to provide finer grained control over containers and tests lifecycle
  8. Arquillian Extension forSipServlets● Finer grained control over the tests lifecycle and the containers 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 forSipServlets● 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
  10. Arquillian Extension for SipServlets<container qualifier="mss-tomcat-embedded-6" default="true" mode="manual"> <configuration> <property name="tomcatHome">target/mss-tomcat-embedded-6</property> <property name="workDir">work</property> <property name="bindHttpPort">8888</property> <property name="unpackArchive">true</property> <property name="sipConnectors">:5070,:5070/TCP</property> <property name="bindAddress">127.0.0.1</property> <property name="sipApplicationRouterProviderClassName">org.mobicents.servlet.sip.router.DefaultApplicationRouterProvider</property> </configuration> </container>
  11. Arquillian Extension forSipServlets@RunWith(Arquillian.class)public class ShootistSipServletTest extends SipTestCase{@Deployment(name="simpleArchive", managed=false) public static WebArchive createTestArchive(){ WebArchive webArchive = ShrinkWrap.create(WebArchive.class," shootistsipservlet.war"); webArchive.addClasses(ShootistSipServlet.class); webArchive.addAsWebInfResource("in-container-sip.xml", "sip.xml"); return webArchive; }
  12. Arquillian Extension forSipServlets @Test @ContextParam(name="cancel", value="true") public void testShootist() throws Exception { SipStackTool sipStackTool = new SipStackTool(); receiver = sipStackTool.initializeSipStack(SipStack.PROTOCOL_UDP,"127.0.0.1", "5080", "127.0.0.1:5070"); sipPhone = receiver.createSipPhone("127.0.0.1", SipStack.PROTOCOL_UDP, 5070, "sip:LittleGuy@there.com"); sipCall = sipPhone.createSipCall(); sipCall.listenForIncomingCall(); deployer.deploy("simpleArchive"); assertTrue(sipCall.waitForIncomingCall(timeout)); assertTrue(sipCall.sendIncomingCallResponse(Response.TRYING," Trying", timeout));
  13. Arquillian Extension forSipServletsWhat comes next:● Mobicents Sip Servlets AS7 container
  14. SipUnitSipUnit provides a test environment gearedtoward unit testing SIP applications.The primary goal of SipUnit is to abstract thedetails of SIP messaging/call handling andfacilitate free-flowing, sequential test code sothat a test target can be exercised quickly andpainlessly
  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 dont 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.
  17. SipUnit exampleb.listenForIncomingCall();a.initiateOutgoingCall("sip:becky@nist.gov", null);b.waitForIncomingCall(5000);b.sendIncomingCallResponse(Response.RINGING, "Ringing", 0);a.waitOutgoingCallResponse(10000);b.sendIncomingCallResponse(Response.OK, "Answer - Hello world",0);a.waitOutgoingCallResponse(10000);a.sendInviteOkAck();
  18. SipUnit download● Binary: http://code.google.com/p/commtesting/downloads/list● Maven artifact <dependency> <groupId>org.cafesip.sipunit</groupId> <artifactId>sipunit</artifactId> <version>2.0.0</version> </dependency> <repository> <id>mobicents-public-repository-group</id> <name>Mobicens Public Maven Repository Group</name> <url>https://oss.sonatype.org/content/groups/public</url> <layout>default</layout> <releases> <enabled>true</enabled> <updatePolicy>never</updatePolicy> </releases> <snapshots> <enabled>true</enabled> <updatePolicy>never</updatePolicy> </snapshots> </repository>
  19. SipServletes Commtesting links● Project site: http://code.google.com/p/commtesting/● SipServlets Arquillian Extension Documentation: https://mobicents.ci.cloudbees. com/view/SIP%20Testing/job/sipservlets. arquillian/lastSuccessfulBuild/artifact/documentation/html_single/index.html● SipUnit Documentation: https://mobicents.ci.cloudbees. com/job/SipUnit/lastSuccessfulBuild/artifact/sipunit/docs/jdocbook- mobicents/target/docbook/publish/en-US/html_single/index.html
  20. ContactGeorge Vagenasgvagenas@gmail.comThank you

×