FileDocCategorySizeDatePackage
TestMultilineHeaders.javaAPI DocphoneME MR2 API (J2ME)3923Wed May 02 18:00:40 BST 2007javax.microedition.sip

TestMultilineHeaders

public class TestMultilineHeaders extends SipHeaderBaseTest
Test for support of multiline header values.

Fields Summary
Constructors Summary
Methods Summary
voidTest1()
Body of the test 1: support of multiline header values.

        SipHeader sh;

        // Header's name / header's value to set / expected return value
        String[][] strHeaders = {
            {
                "Subject",
                    "I know you're there,\r\n" +
                    "\tpick up the phone and talk to me!",
                        "I know you're there, pick up the phone and talk to me!"
            },

            {
                "Subject",
                    "I know you're there,\r\n" +
                    " pick up the phone and talk to me!",
                        "I know you're there, pick up the phone and talk to me!"
            },

            {
                "Subject",
                    "I know you're there,\r\n" +
                    "     pick up the phone and talk to me!",
                        "I know you're there,     pick up " +
                            "the phone and talk to me!"
            },

            {
                "Subject",
                    "I know you're there,\n\r" +
                    "\tpick up the phone and talk to me!",
                        "I know you're there, pick up the phone and talk to me!"
            },

            {
                "Subject",
                    "I know you're there,\n" +
                    "\tpick up the phone and talk to me!",
                        "I know you're there, pick up the phone and talk to me!"
            },

            {
                "Subject",
                    "I know you're there,\r" +
                    "\tpick up the phone and talk to me!",
                        "I know you're there, pick up the phone and talk to me!"
            },

            {
                "Organization",
                    "Sun \n" + " Microsystems",
                        "Sun  Microsystems"
            },

            {
                "AnExtendedHeader",
                    "I know you're there,\r\n" +
                    " pick up the phone and talk to me!",
                        "I know you're there, pick up the phone and talk to me!"
            },
        };

        for (int i = 0; i < strHeaders.length; i++) {
            sh = createSipHeader(strHeaders[i][0], strHeaders[i][1]);

            if (sh == null) {
                return;
            }

            String val = sh.getValue();
            assertEquals("Invalid header's value!", strHeaders[i][2], val);
        } // end for
    
public voidrunTests()
Run the tests.

        declare("Test for support of multiline header values");
        Test1();