Revision: 32d94668c79f
Author: jean.deruelle <[email protected]>
Date: Tue Jun 26 11:33:57 2012
Log: Edited wiki page SipUnit through web user interface.
http://code.google.com/p/commtesting/source/detail?r=32d94668c79f&repo=wiki
Modified:
/SipUnit.wiki
=======================================
--- /SipUnit.wiki Tue Jun 26 11:25:54 2012
+++ /SipUnit.wiki Tue Jun 26 11:33:57 2012
@@ -1,13 +1,23 @@
-#summary One-sentence summary of this page.
-
-= Introduction =
-
-Add your content here.
-
-
-= Details =
-
-Add your content here. Format your content with:
- * Text in *bold* or _italic_
- * Headings, paragraphs, and lists
- * Automatic links to other wiki pages
+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 Java class using SipUnit API:
+
+ # Either extends SipTestCase (Junit 3 style) or statically imports
assert methods from the equivalent class SipAssert (for JUnit 4 and beyond)
+ # Creates SipUnit API objects - SipStack, SipPhone, SipCall, etc.
+ # Calls methods on the object(s) to set up and initiate action toward a
SIP test target. For example: SipPhone.makeCall("sip:[email protected]",
SipResponse.OK, ....) makes a vanilla call to sip:[email protected] and blocks
until an OK is received or a timeout occurs. SipPhone.addBuddy(...) and
SipPhone.refer(...) send out SUBSCRIBE and REFER messages and start a
subscription, etc. The test target could be any node up to and including
the final destination of the outgoing request message.
+ # 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:[email protected]"),
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 subscription handling (SUBSCRIBE/NOTIFY)
+ * CANCEL handling
+ * Support for MESSAGE
+ * REFER and associated subscription handling
+ * Support for NAT traversal (STUN)
+ * Support for testcase-specified timeouts
+ * Can work with or without a SIP proxy server (works with servers that
support standard SIP signaling such as 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 to test a network element between the
two.