org.cafesip.sipunit
Class SipTestCase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.cafesip.sipunit.SipTestCase
All Implemented Interfaces:
junit.framework.Test

public class SipTestCase
extends junit.framework.TestCase

The SipTestCase class provides a test environment and set of assert methods geared toward unit testing Java SIP applications. It uses the JUnit test framework and API (http://junit.sourceforge.net) and extends junit.framework.TestCase. A SIP application test program (a) uses the SipUnit API to invoke SIP operations against a test target and (b) uses the assert methods of this class in addition to any of the JUnit Assert methods to verify the results of the test.

To write a SIP application test class, or program:

  • 1) implement a subclass of SipTestCase
  • 2) define instance attributes that store information needed by each test in the class
  • 3) initialize the setup for each test by overriding method setUp()
  • 4) clean-up after each test by overriding tearDown()
  • 5) write one or more tests, each of which is a method beginning with the letters "test"

    The code in the SIP application test class creates SipUnit API objects, calls their methods to set up and initiate action toward a SIP test target, and verifies the results involving the test target using the assert methods of this class and the standard JUnit assert methods. Messages are only displayed when an assert fails. See below for an example test class.

    To execute the test program and run the tests, use the standard JUnit test runners which can run a test suite and collect/output the results. This is commonly done using IDE Junit facilities or via the Ant junit target.

    EXAMPLE SIP APPLICATION TEST CLASS: (see the SipUnit User Guide for more information on how to use the API effectively)

    
     
      
       
        
         
          
           
            
                 import org.cafesip.sipunit.*;
                 
                 public class TestNoProxy extends SipTestCase 
                 {
                  private SipStack sipStack;
                  private SipPhone ua;
                  private String thisHostAddr = "127.0.0.1";
                  
                  public TestNoProxy(String arg0)
                  {
                      super(arg0);
                  }
                           
                  public void setUp() throws Exception
                  {
                      sipStack = new SipStack(null, -1);
                      ua = sipStack.createSipPhone("sip:amit@nist.gov");
                  }
                  
                  public void tearDown() throws Exception
                  {
                      ua.dispose();
                      sipStack.dispose();
                  }
                  
                  public void testBothSides() 
                  // test target: SipUnit API classes, incoming and outgoing SIP handling (a calls b)
                  {
                      try
                      {
                          SipPhone ub = sipStack.createSipPhone("sip:becky@nist.gov");
                           
                          SipCall a = ua.createSipCall();
                          SipCall b = ub.createSipCall();
                           
                          b.listenForIncomingCall(); // non-blocking
                          Thread.sleep(5);
                           
                          a.initiateOutgoingCall("sip:becky@nist.gov", thisHostAddr
                                  + ":5060/UDP");
                          assertLastOperationSuccess("a initiate call - " + a.format(), a);
                           
                          b.waitForIncomingCall(10000); // blocking
                          assertLastOperationSuccess("b wait incoming call - " + b.format(),
                                  b);
                           
                          b.sendIncomingCallResponse(Response.RINGING, null, -1);
                          assertLastOperationSuccess("b send RINGING - " + b.format(), b);
                           
                          Thread.sleep(1000);
                           
                          b.sendIncomingCallResponse(Response.OK, "Answer - Hello world", 0);
                          assertLastOperationSuccess("b send OK - " + b.format(), b);
                           
                          a.waitOutgoingCallResponse(10000); // block waiting for a response
                          assertLastOperationSuccess("a wait 1st response - " + a.format(), a);
                          assertEquals("Unexpected 1st response received", Response.RINGING,
                                  a.getReturnCode());
                          assertNotNull("Default response reason not sent", a
                                  .getLastReceivedResponse().getReasonPhrase());
                          assertEquals("Unexpected default reason", "Ringing", a
                                  .getLastReceivedResponse().getReasonPhrase());
                           
                          a.waitOutgoingCallResponse(10000); // block waiting for next response
                          assertLastOperationSuccess("a wait 2nd response - " + a.format(), a);
                           
                          assertEquals("Unexpected 2nd response received", Response.OK, a
                                  .getReturnCode());
                           
                          a.sendInviteOkAck();
                          assertLastOperationSuccess("Failure sending ACK - " + a.format(), a);
                           
                          Thread.sleep(1000);
                           
                          a.listenForDisconnect(); // non-blocking
                          assertLastOperationSuccess("a listen disc - " + a.format(), a);
                           
                          b.disconnect();
                          assertLastOperationSuccess("b disc - " + b.format(), b);
                           
                          a.waitForDisconnect(5000); // blocking
                          assertLastOperationSuccess("a wait disc - " + a.format(), a);
                           
                          a.respondToDisconnect();
                          assertLastOperationSuccess("a respond to disc - " + a.format(), a);
                           
                          ub.dispose();
                      }
                      catch (Exception e)
                      {
                          fail("Exception: " + e.getClass().getName() + ": " + e.getMessage());
                      }
                  }
             
            
           
          
         
        
       
      
     


    Constructor Summary
    SipTestCase()
              A no-arg constructor to enable serialization.
    SipTestCase(java.lang.String arg0)
              A constructor for this test case.
     
    Method Summary
     void assertAnswered(SipCall call)
              Asserts that the given incoming or outgoing call leg was answered.
     void assertAnswered(java.lang.String msg, SipCall call)
              Asserts that the given incoming or outgoing call leg was answered.
     void assertBodyContains(SipMessage sipMessage, java.lang.String value)
              Asserts that the given SIP message contains a body that includes the given value.
     void assertBodyContains(java.lang.String msg, SipMessage sipMessage, java.lang.String value)
              Asserts that the given SIP message contains a body that includes the given value.
     void assertBodyNotContains(SipMessage sipMessage, java.lang.String value)
              Asserts that the body in the given SIP message does not contain the value given, or that there is no body in the message.
     void assertBodyNotContains(java.lang.String msg, SipMessage sipMessage, java.lang.String value)
              Asserts that the body in the given SIP message does not contain the value given, or that there is no body in the message.
     void assertBodyNotPresent(SipMessage sipMessage)
              Asserts that the given SIP message contains no body.
     void assertBodyNotPresent(java.lang.String msg, SipMessage sipMessage)
              Asserts that the given SIP message contains no body.
     void assertBodyPresent(SipMessage sipMessage)
              Asserts that the given SIP message contains a body.
     void assertBodyPresent(java.lang.String msg, SipMessage sipMessage)
              Asserts that the given SIP message contains a body.
     void assertHeaderContains(SipMessage sipMessage, java.lang.String header, java.lang.String value)
              Asserts that the given SIP message contains at least one occurrence of the specified header and that at least one occurrence of this header contains the given value.
     void assertHeaderContains(java.lang.String msg, SipMessage sipMessage, java.lang.String header, java.lang.String value)
              Asserts that the given SIP message contains at least one occurrence of the specified header and that at least one occurrence of this header contains the given value.
     void assertHeaderNotContains(SipMessage sipMessage, java.lang.String header, java.lang.String value)
              Asserts that the given SIP message contains no occurrence of the specified header with the value given, or that there is no occurrence of the header in the message.
     void assertHeaderNotContains(java.lang.String msg, SipMessage sipMessage, java.lang.String header, java.lang.String value)
              Asserts that the given SIP message contains no occurrence of the specified header with the value given, or that there is no occurrence of the header in the message.
     void assertHeaderNotPresent(SipMessage sipMessage, java.lang.String header)
              Asserts that the given SIP message contains no occurrence of the specified header.
     void assertHeaderNotPresent(java.lang.String msg, SipMessage sipMessage, java.lang.String header)
              Asserts that the given SIP message contains no occurrence of the specified header.
     void assertHeaderPresent(SipMessage sipMessage, java.lang.String header)
              Asserts that the given SIP message contains at least one occurrence of the specified header.
     void assertHeaderPresent(java.lang.String msg, SipMessage sipMessage, java.lang.String header)
              Asserts that the given SIP message contains at least one occurrence of the specified header.
     void assertLastOperationFail(SipActionObject op)
              Asserts that the last SIP operation performed by the given object failed.
     void assertLastOperationFail(java.lang.String msg, SipActionObject op)
              Asserts that the last SIP operation performed by the given object failed.
     void assertLastOperationSuccess(SipActionObject op)
              Asserts that the last SIP operation performed by the given object was successful.
     void assertLastOperationSuccess(java.lang.String msg, SipActionObject op)
              Asserts that the last SIP operation performed by the given object was successful.
     void assertNoSubscriptionErrors(EventSubscriber subscription)
              Asserts that the given Subscription has not encountered any errors while processing received subscription responses and received NOTIFY requests.
     void assertNoSubscriptionErrors(java.lang.String msg, EventSubscriber subscription)
              Asserts that the given Subscription has not encountered any errors while processing received subscription responses and received NOTIFY requests.
     void assertNotAnswered(SipCall call)
              Asserts that the given incoming or outgoing call leg has not been answered.
     void assertNotAnswered(java.lang.String msg, SipCall call)
              Asserts that the given incoming or outgoing call leg has not been answered.
     void assertRequestNotReceived(java.lang.String method, long sequenceNumber, MessageListener obj)
              Asserts that the given message listener object has not received a request with the indicated CSeq method and sequence number.
     void assertRequestNotReceived(java.lang.String method, MessageListener obj)
              Asserts that the given message listener object has not received a request with the indicated request method.
     void assertRequestNotReceived(java.lang.String msg, java.lang.String method, long sequenceNumber, MessageListener obj)
              Asserts that the given message listener object has not received a request with the indicated CSeq method and sequence number.
     void assertRequestNotReceived(java.lang.String msg, java.lang.String method, MessageListener obj)
              Asserts that the given message listener object has not received a request with the indicated request method.
     void assertRequestReceived(java.lang.String method, long sequenceNumber, MessageListener obj)
              Asserts that the given message listener object received a request with the indicated CSeq method and CSeq sequence number.
     void assertRequestReceived(java.lang.String method, MessageListener obj)
              Asserts that the given message listener object received a request with the indicated request method.
     void assertRequestReceived(java.lang.String msg, java.lang.String method, long sequenceNumber, MessageListener obj)
              Asserts that the given message listener object received a request with the indicated CSeq method and CSeq sequence number.
     void assertRequestReceived(java.lang.String msg, java.lang.String method, MessageListener obj)
              Asserts that the given message listener object received a request with the indicated request method.
     void assertResponseNotReceived(int statusCode, MessageListener obj)
              Asserts that the given message listener object has not received a response with the indicated status code.
     void assertResponseNotReceived(int statusCode, java.lang.String method, long sequenceNumber, MessageListener obj)
              Asserts that the given message listener object has not received a response with the indicated status code, CSeq method and sequence number.
     void assertResponseNotReceived(java.lang.String msg, int statusCode, MessageListener obj)
              Asserts that the given message listener object has not received a response with the indicated status code.
     void assertResponseNotReceived(java.lang.String msg, int statusCode, java.lang.String method, long sequenceNumber, MessageListener obj)
              Asserts that the given message listener object has not received a response with the indicated status code, CSeq method and sequence number.
     void assertResponseReceived(int statusCode, MessageListener obj)
              Asserts that the given message listener object received a response with the indicated status code.
     void assertResponseReceived(int statusCode, java.lang.String method, long sequenceNumber, MessageListener obj)
              Asserts that the given message listener object received a response with the indicated status code, CSeq method and CSeq sequence number.
     void assertResponseReceived(java.lang.String msg, int statusCode, MessageListener obj)
              Asserts that the given message listener object received a response with the indicated status code.
     void assertResponseReceived(java.lang.String msg, int statusCode, java.lang.String method, long sequenceNumber, MessageListener obj)
              Asserts that the given message listener object received a response with the indicated status code, CSeq method and CSeq sequence number.
     void setUp()
              Sets up the environment for each test method prior to execution.
     void tearDown()
              Cleans up from the test method just executed.
     
    Methods inherited from class junit.framework.TestCase
    countTestCases, getName, run, run, runBare, setName, toString
     
    Methods inherited from class junit.framework.Assert
    assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
     
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
     

    Constructor Detail

    SipTestCase

    public SipTestCase(java.lang.String arg0)
    A constructor for this test case.

    Parameters:
    arg0 - the name of the test case

    SipTestCase

    public SipTestCase()
    A no-arg constructor to enable serialization. Call setName() if you use this.

    Method Detail

    setUp

    public void setUp()
               throws java.lang.Exception
    Sets up the environment for each test method prior to execution.

    Overrides:
    setUp in class junit.framework.TestCase
    Throws:
    java.lang.Exception

    tearDown

    public void tearDown()
                  throws java.lang.Exception
    Cleans up from the test method just executed.

    Overrides:
    tearDown in class junit.framework.TestCase
    Throws:
    java.lang.Exception

    assertLastOperationSuccess

    public void assertLastOperationSuccess(SipActionObject op)
    Asserts that the last SIP operation performed by the given object was successful.

    Parameters:
    op - the SipUnit object that executed an operation.

    assertLastOperationSuccess

    public void assertLastOperationSuccess(java.lang.String msg,
                                           SipActionObject op)
    Asserts that the last SIP operation performed by the given object was successful. Assertion failure output includes the given message text.

    Parameters:
    msg - message text to output if the assertion fails.
    op - the SipUnit object that executed an operation.

    assertLastOperationFail

    public void assertLastOperationFail(SipActionObject op)
    Asserts that the last SIP operation performed by the given object failed.

    Parameters:
    op - the SipUnit object that executed an operation.

    assertLastOperationFail

    public void assertLastOperationFail(java.lang.String msg,
                                        SipActionObject op)
    Asserts that the last SIP operation performed by the given object failed. Assertion failure output includes the given message text.

    Parameters:
    msg - message text to output if the assertion fails.
    op - the SipUnit object that executed an operation.

    assertHeaderPresent

    public void assertHeaderPresent(SipMessage sipMessage,
                                    java.lang.String header)
    Asserts that the given SIP message contains at least one occurrence of the specified header.

    Parameters:
    sipMessage - the SIP message.
    header - the string identifying the header, as specified in RFC-3261.

    assertHeaderPresent

    public void assertHeaderPresent(java.lang.String msg,
                                    SipMessage sipMessage,
                                    java.lang.String header)
    Asserts that the given SIP message contains at least one occurrence of the specified header. Assertion failure output includes the given message text.

    Parameters:
    msg - message text to output if the assertion fails.
    sipMessage - the SIP message.
    header - the string identifying the header as specified in RFC-3261.

    assertHeaderNotPresent

    public void assertHeaderNotPresent(SipMessage sipMessage,
                                       java.lang.String header)
    Asserts that the given SIP message contains no occurrence of the specified header.

    Parameters:
    sipMessage - the SIP message.
    header - the string identifying the header as specified in RFC-3261.

    assertHeaderNotPresent

    public void assertHeaderNotPresent(java.lang.String msg,
                                       SipMessage sipMessage,
                                       java.lang.String header)
    Asserts that the given SIP message contains no occurrence of the specified header. Assertion failure output includes the given message text.

    Parameters:
    msg - message text to output if the assertion fails.
    sipMessage - the SIP message.
    header - the string identifying the header as specified in RFC-3261.

    assertHeaderContains

    public void assertHeaderContains(SipMessage sipMessage,
                                     java.lang.String header,
                                     java.lang.String value)
    Asserts that the given SIP message contains at least one occurrence of the specified header and that at least one occurrence of this header contains the given value. The assertion fails if no occurrence of the header contains the value or if the header is not present in the mesage.

    Parameters:
    sipMessage - the SIP message.
    header - the string identifying the header as specified in RFC-3261.
    value - the string value within the header to look for. An exact string match is done against the entire contents of the header. The assertion will pass if any part of the header matches the value given.

    assertHeaderContains

    public void assertHeaderContains(java.lang.String msg,
                                     SipMessage sipMessage,
                                     java.lang.String header,
                                     java.lang.String value)
    Asserts that the given SIP message contains at least one occurrence of the specified header and that at least one occurrence of this header contains the given value. The assertion fails if no occurrence of the header contains the value or if the header is not present in the mesage. Assertion failure output includes the given message text.

    Parameters:
    msg - message text to output if the assertion fails.
    sipMessage - the SIP message.
    header - the string identifying the header as specified in RFC-3261.
    value - the string value within the header to look for. An exact string match is done against the entire contents of the header. The assertion will pass if any part of the header matches the value given.

    assertHeaderNotContains

    public void assertHeaderNotContains(SipMessage sipMessage,
                                        java.lang.String header,
                                        java.lang.String value)
    Asserts that the given SIP message contains no occurrence of the specified header with the value given, or that there is no occurrence of the header in the message. The assertion fails if any occurrence of the header contains the value.

    Parameters:
    sipMessage - the SIP message.
    header - the string identifying the header as specified in RFC-3261.
    value - the string value within the header to look for. An exact string match is done against the entire contents of the header. The assertion will fail if any part of the header matches the value given.

    assertHeaderNotContains

    public void assertHeaderNotContains(java.lang.String msg,
                                        SipMessage sipMessage,
                                        java.lang.String header,
                                        java.lang.String value)
    Asserts that the given SIP message contains no occurrence of the specified header with the value given, or that there is no occurrence of the header in the message. The assertion fails if any occurrence of the header contains the value. Assertion failure output includes the given message text.

    Parameters:
    msg - message text to output if the assertion fails.
    sipMessage - the SIP message.
    header - the string identifying the header as specified in RFC-3261.
    value - the string value within the header to look for. An exact string match is done against the entire contents of the header. The assertion will fail if any part of the header matches the value given.

    assertResponseReceived

    public void assertResponseReceived(int statusCode,
                                       MessageListener obj)
    Asserts that the given message listener object received a response with the indicated status code.

    Parameters:
    statusCode - The response status code to check for (eg, SipResponse.RINGING)
    obj - The MessageListener object (ie, SipCall, Subscription, etc.).

    assertResponseReceived

    public void assertResponseReceived(int statusCode,
                                       java.lang.String method,
                                       long sequenceNumber,
                                       MessageListener obj)
    Asserts that the given message listener object received a response with the indicated status code, CSeq method and CSeq sequence number.

    Parameters:
    statusCode - The response status code to check for (eg, SipResponse.RINGING)
    method - The CSeq method to look for (SipRequest.INVITE, etc.)
    sequenceNumber - The CSeq sequence number to look for
    obj - The MessageListener object (ie, SipCall, Subscription, etc.).

    assertResponseReceived

    public void assertResponseReceived(java.lang.String msg,
                                       int statusCode,
                                       MessageListener obj)
    Asserts that the given message listener object received a response with the indicated status code. Assertion failure output includes the given message text.

    Parameters:
    msg - message text to output if the assertion fails.
    statusCode - The response status code to check for (eg, SipResponse.RINGING)
    obj - The MessageListener object (ie, SipCall, Subscription, etc.).

    assertResponseReceived

    public void assertResponseReceived(java.lang.String msg,
                                       int statusCode,
                                       java.lang.String method,
                                       long sequenceNumber,
                                       MessageListener obj)
    Asserts that the given message listener object received a response with the indicated status code, CSeq method and CSeq sequence number. Assertion failure output includes the given message text.

    Parameters:
    msg - message text to output if the assertion fails.
    statusCode - The response status code to check for (eg, SipResponse.RINGING)
    method - The CSeq method to look for (SipRequest.INVITE, etc.)
    sequenceNumber - The CSeq sequence number to look for
    obj - The MessageListener object (ie, SipCall, Subscription, etc.).

    assertResponseNotReceived

    public void assertResponseNotReceived(int statusCode,
                                          MessageListener obj)
    Asserts that the given message listener object has not received a response with the indicated status code.

    Parameters:
    statusCode - The response status code to verify absent (eg, SipResponse.RINGING)
    obj - The MessageListener object (ie, SipCall, Subscription, etc.).

    assertResponseNotReceived

    public void assertResponseNotReceived(java.lang.String msg,
                                          int statusCode,
                                          MessageListener obj)
    Asserts that the given message listener object has not received a response with the indicated status code. Assertion failure output includes the given message text.

    Parameters:
    msg - message text to output if the assertion fails.
    statusCode - The response status code to verify absent (eg, SipResponse.RINGING)
    obj - The MessageListener object (ie, SipCall, Subscription, etc.).

    assertResponseNotReceived

    public void assertResponseNotReceived(int statusCode,
                                          java.lang.String method,
                                          long sequenceNumber,
                                          MessageListener obj)
    Asserts that the given message listener object has not received a response with the indicated status code, CSeq method and sequence number.

    Parameters:
    statusCode - The response status code to verify absent (eg, SipResponse.RINGING)
    method - The CSeq method to verify absent (SipRequest.INVITE, etc.)
    sequenceNumber - The CSeq sequence number to verify absent
    obj - The MessageListener object (ie, SipCall, Subscription, etc.).

    assertResponseNotReceived

    public void assertResponseNotReceived(java.lang.String msg,
                                          int statusCode,
                                          java.lang.String method,
                                          long sequenceNumber,
                                          MessageListener obj)
    Asserts that the given message listener object has not received a response with the indicated status code, CSeq method and sequence number. Assertion failure output includes the given message text.

    Parameters:
    msg - message text to output if the assertion fails.
    statusCode - The response status code to verify absent (eg, SipResponse.RINGING)
    method - The CSeq method to verify absent (SipRequest.INVITE, etc.)
    sequenceNumber - The CSeq sequence number to verify absent
    obj - The MessageListener object (ie, SipCall, Subscription, etc.).

    assertRequestReceived

    public void assertRequestReceived(java.lang.String method,
                                      MessageListener obj)
    Asserts that the given message listener object received a request with the indicated request method.

    Parameters:
    method - The request method to check for (eg, SipRequest.BYE)
    obj - The MessageListener object (ie, SipCall, Subscription, etc.).

    assertRequestReceived

    public void assertRequestReceived(java.lang.String method,
                                      long sequenceNumber,
                                      MessageListener obj)
    Asserts that the given message listener object received a request with the indicated CSeq method and CSeq sequence number.

    Parameters:
    method - The CSeq method to look for (SipRequest.REGISTER, etc.)
    sequenceNumber - The CSeq sequence number to look for
    obj - The MessageListener object (ie, SipCall, Subscription, etc.).

    assertRequestReceived

    public void assertRequestReceived(java.lang.String msg,
                                      java.lang.String method,
                                      MessageListener obj)
    Asserts that the given message listener object received a request with the indicated request method. Assertion failure output includes the given message text.

    Parameters:
    msg - message text to output if the assertion fails.
    method - The request method to check for (eg, SipRequest.INVITE)
    obj - The MessageListener object (ie, SipCall, Subscription, etc.).

    assertRequestReceived

    public void assertRequestReceived(java.lang.String msg,
                                      java.lang.String method,
                                      long sequenceNumber,
                                      MessageListener obj)
    Asserts that the given message listener object received a request with the indicated CSeq method and CSeq sequence number. Assertion failure output includes the given message text.

    Parameters:
    msg - message text to output if the assertion fails.
    method - The CSeq method to look for (SipRequest.INVITE, etc.)
    sequenceNumber - The CSeq sequence number to look for
    obj - The MessageListener object (ie, SipCall, Subscription, etc.).

    assertRequestNotReceived

    public void assertRequestNotReceived(java.lang.String method,
                                         MessageListener obj)
    Asserts that the given message listener object has not received a request with the indicated request method.

    Parameters:
    method - The request method to verify absent (eg, SipRequest.BYE)
    obj - The MessageListener object (ie, SipCall, Subscription, etc.).

    assertRequestNotReceived

    public void assertRequestNotReceived(java.lang.String msg,
                                         java.lang.String method,
                                         MessageListener obj)
    Asserts that the given message listener object has not received a request with the indicated request method. Assertion failure output includes the given message text.

    Parameters:
    msg - message text to output if the assertion fails.
    method - The request method to verify absent (eg, SipRequest.BYE)
    obj - The MessageListener object (ie, SipCall, Subscription, etc.).

    assertRequestNotReceived

    public void assertRequestNotReceived(java.lang.String method,
                                         long sequenceNumber,
                                         MessageListener obj)
    Asserts that the given message listener object has not received a request with the indicated CSeq method and sequence number.

    Parameters:
    method - The CSeq method to verify absent (SipRequest.INVITE, etc.)
    sequenceNumber - The CSeq sequence number to verify absent
    obj - The MessageListener object (ie, SipCall, Subscription, etc.).

    assertRequestNotReceived

    public void assertRequestNotReceived(java.lang.String msg,
                                         java.lang.String method,
                                         long sequenceNumber,
                                         MessageListener obj)
    Asserts that the given message listener object has not received a request with the indicated CSeq method and sequence number. Assertion failure output includes the given message text.

    Parameters:
    msg - message text to output if the assertion fails.
    method - The CSeq method to verify absent (SipRequest.INVITE, etc.)
    sequenceNumber - The CSeq sequence number to verify absent
    obj - The MessageListener object (ie, SipCall, Subscription, etc.).

    assertAnswered

    public void assertAnswered(SipCall call)
    Asserts that the given incoming or outgoing call leg was answered.

    Parameters:
    call - The incoming or outgoing call leg.

    assertAnswered

    public void assertAnswered(java.lang.String msg,
                               SipCall call)
    Asserts that the given incoming or outgoing call leg was answered. Assertion failure output includes the given message text.

    Parameters:
    msg - message text to output if the assertion fails.
    call - The incoming or outgoing call leg.

    assertNotAnswered

    public void assertNotAnswered(SipCall call)
    Asserts that the given incoming or outgoing call leg has not been answered.

    Parameters:
    call - The incoming or outgoing call leg.

    assertNotAnswered

    public void assertNotAnswered(java.lang.String msg,
                                  SipCall call)
    Asserts that the given incoming or outgoing call leg has not been answered. Assertion failure output includes the given message text.

    Parameters:
    msg - message text to output if the assertion fails.
    call - The incoming or outgoing call leg.

    assertBodyPresent

    public void assertBodyPresent(SipMessage sipMessage)
    Asserts that the given SIP message contains a body.

    Parameters:
    sipMessage - the SIP message.

    assertBodyPresent

    public void assertBodyPresent(java.lang.String msg,
                                  SipMessage sipMessage)
    Asserts that the given SIP message contains a body. Assertion failure output includes the given message text.

    Parameters:
    msg - message text to output if the assertion fails.
    sipMessage - the SIP message.

    assertBodyNotPresent

    public void assertBodyNotPresent(SipMessage sipMessage)
    Asserts that the given SIP message contains no body.

    Parameters:
    sipMessage - the SIP message.

    assertBodyNotPresent

    public void assertBodyNotPresent(java.lang.String msg,
                                     SipMessage sipMessage)
    Asserts that the given SIP message contains no body. Assertion failure output includes the given message text.

    Parameters:
    msg - message text to output if the assertion fails.
    sipMessage - the SIP message.

    assertBodyContains

    public void assertBodyContains(SipMessage sipMessage,
                                   java.lang.String value)
    Asserts that the given SIP message contains a body that includes the given value. The assertion fails if a body is not present in the message or is present but doesn't include the value.

    Parameters:
    sipMessage - the SIP message.
    value - the string value to look for in the body. An exact string match is done against the entire contents of the body. The assertion will pass if any part of the body matches the value given. ??case sensitive?

    assertBodyContains

    public void assertBodyContains(java.lang.String msg,
                                   SipMessage sipMessage,
                                   java.lang.String value)
    Asserts that the given SIP message contains a body that includes the given value. The assertion fails if a body is not present in the message or is present but doesn't include the value. Assertion failure output includes the given message text.

    Parameters:
    msg - message text to output if the assertion fails.
    sipMessage - the SIP message.
    value - the string value to look for in the body. An exact string match is done against the entire contents of the body. The assertion will pass if any part of the body matches the value given.

    assertBodyNotContains

    public void assertBodyNotContains(SipMessage sipMessage,
                                      java.lang.String value)
    Asserts that the body in the given SIP message does not contain the value given, or that there is no body in the message. The assertion fails if the body is present and contains the value.

    Parameters:
    sipMessage - the SIP message.
    value - the string value to look for in the body. An exact string match is done against the entire contents of the body. The assertion will fail if any part of the body matches the value given.

    assertBodyNotContains

    public void assertBodyNotContains(java.lang.String msg,
                                      SipMessage sipMessage,
                                      java.lang.String value)
    Asserts that the body in the given SIP message does not contain the value given, or that there is no body in the message. The assertion fails if the body is present and contains the value. Assertion failure output includes the given message text.

    Parameters:
    msg - message text to output if the assertion fails.
    sipMessage - the SIP message.
    value - the string value to look for in the body. An exact string match is done against the entire contents of the body. The assertion will fail if any part of the body matches the value given.

    assertNoSubscriptionErrors

    public void assertNoSubscriptionErrors(EventSubscriber subscription)
    Asserts that the given Subscription has not encountered any errors while processing received subscription responses and received NOTIFY requests. If the assertion fails, the encountered error(s) are included in the failure output.

    Parameters:
    subscription - the Subscription in question.

    assertNoSubscriptionErrors

    public void assertNoSubscriptionErrors(java.lang.String msg,
                                           EventSubscriber subscription)
    Asserts that the given Subscription has not encountered any errors while processing received subscription responses and received NOTIFY requests. Assertion failure output includes the given message text along with the encountered error(s).

    Parameters:
    msg - message text to include if the assertion fails.
    subscription - the Subscription in question.


    http://www.cafesip.org