Look what Java and SIP can do
 (SIP)Java =
Home     News     Projects     Downloads     Support     Contact

Acknowledgements

Documentation
Downloads Support SipUnit Contributors

SipUnit

SipUnit provides a test environment geared toward unit testing SIP applications. It extends the JUnit test framework to incorporate SIP-specific assertions, and it provides a high-level API for performing the SIP operations needed to interact with or invoke a test target. A test program using the SipUnit API is written in Java and acts as a network element that sends/receives SIP requests and responses. The SipUnit API includes SIP User Agent Client (UAC), User Agent Server (UAS), and basic UAC/UAS Core functionality - the set of processing functions that resides above the SIP transaction and transport layers - for the purpose of interacting with the test target. SipUnit uses the JAIN-SIP reference implementation as its underlying SIP stack/engine. 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.
 
A test program using SipUnit API:
  1. Extends SipTestCase
  2. Creates SipUnit API objects - SipStack, SipPhone, SipCall, etc.
  3. Calls methods on the object(s) to set up and initiate action toward a SIP test target. For example: SipPhone.makeCall("sip:roger@nist.gov", SipResponse.OK, ....) makes a vanilla call to sip:roger@nist.gov and blocks until an OK is received or a timeout occurs. The test target could be any node up to and including the final destination of the INVITE request message.
  4. Verifies the results of the action involving the test target using both the SIP-specific assert methods provided by SipUnit and the standard JUnit assert methods. For example:  assertHeaderContains(sipCall.getLastReceivedResponse(), "From", "sip:amit@nist.gov"), assertEquals("Unexpected response received", SipResponse.OK, sipCall.getReturnCode()).
SipUnit API highlights:
  • JUnit-like test development and execution environment with SIP-specific assertions added - assertHeaderPresent(), assertHeaderContains(), assertBodyPresent(), etc.
  • 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(). But if you need to create specific INVITE header(s) with certain values, use a lower level that allows this kind of message manipulation.
  • Provides blocking method calls so that the test program is a simple, sequential set of logical steps and assertions (easy to read, easy to write)
  • Support for registration and call handling with or without authentication
  • Support for presence (SUBSCRIBE/NOTIFY)
  • Support for NAT traversal (STUN)
  • Support for testcase-specified timeouts.
  • Can work with or without a SIP proxy server (tested with JAIN-SIP-PRESENCE-PROXY and CafeSip's SipExchange Server)
  • A test can act as more than one network element - ie, it can act as both the caller and callee endpoints
Want to know more? Check out the documentation links to the left. Download the source and take a look.


Search this website 


Send questions or comments about this web site to webmaster@cafesip.org.
Copyright © 2005, CafeSip.org.
Licensed under the CafeSip License.
The CafeSip.org projects, web site and web facilities have been sponsored by QUIK Computing

Top of page