FileDocCategorySizeDatePackage
TestSipClientInitNotifyReq.javaAPI DocphoneME MR2 API (J2ME)3873Wed May 02 18:00:40 BST 2007gov.nist.microedition.sip

TestSipClientInitNotifyReq

public class TestSipClientInitNotifyReq extends com.sun.midp.i3test.TestCase
Tests for SipConnection class.

Fields Summary
Constructors Summary
Methods Summary
voidTest1(java.lang.String transport)
Body of the test 1. Try to initialization NOTIFY request out of dialog.

param
transport the name of transport protocol

        String method = "NOTIFY";
        /** Client connection. */
        SipClientConnection sc = null;
        try {
            // Open SIP client connection to the local SIP server
            sc = (SipClientConnection) 
            Connector.open("sip:sippy.tester@localhost:5060;transport="
                + transport);
        } catch (Exception ex) {
            assertNull("Exception during sc open", sc);
            ex.printStackTrace();
        }
        assertNotNull("sc is null", sc);

        // Move to INITIALIZED state
        try {
            sc.initRequest(method, null);
            fail("IllegalArgumentException was not caused");
        } catch (IllegalArgumentException e) {
            assertTrue("OK", true);
        } catch (Throwable e) {
            fail("INITIALIZED " +e +" was caused");
        }

        // close connection
        try {
            sc.close();
        } catch (Throwable e) {
            fail("" +e +" was caused");
        }
    
public voidrunTests()
Tests execute

    String arrProt[] = {"UDP", "TCP"};
    declare("Initialization NOTIFY request out of dialog");
        for (int i = 0; i < arrProt.length; i++) {
            Test1(arrProt[i]);
        }