Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package test.unit.gov.nist.javax.sip.parser.ims;
 /*
 * Conditions Of Use
 *
 * This software was developed by employees of the National Institute of
 * Standards and Technology (NIST), an agency of the Federal Government.
 * Pursuant to title 15 Untied States Code Section 105, works of NIST
 * employees are not subject to copyright protection in the United States
 * and are considered to be in the public domain.  As a result, a formal
* license is not needed to use the software.
* This software is provided by NIST as a service and is expressly
* provided "AS IS."  NIST MAKES NO WARRANTY OF ANY KIND, EXPRESS, IMPLIED
* OR STATUTORY, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTY OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT
* AND DATA ACCURACY.  NIST does not warrant or make any representations
* regarding the use of the software or the results thereof, including but
* not limited to the correctness, accuracy, reliability or usefulness of
* the software.
* Permission to use this software is contingent upon your acceptance
* of the terms of this agreement
* .
*/
import  test.unit.gov.nist.javax.sip.parser.ParserTestCase;

Author(s):
aayush.bhatnagar Rancore Technologies Pvt Ltd, Mumbai India.
public class PServedUserParserTest extends ParserTestCase{
    @Override
    public void testParser() {
        ..println("*****************************************************");
        ..println("parsie parsie.....");
        ..println("*****************************************************");
        String[] p_serv_user = {"P-Served-User: <sip:aayush@rancore.com>;regstate=reg;sescase=orig\n",
                                "P-Served-User: <sip:aayush@rancore.com>;regstate=unreg\n",
                                "P-Served-User: <sip:aayush@rancore.com>;sescase=term\n",
                                "P-Served-User: <sip:aayush@rancore.com>\n",
                                "P-Served-User: <sip:aayush@rancore.com>;sescase=term;regstate=unreg\n"};
        super.testParser(PServedUserParser.classp_serv_user);
        ..println("******************************************************");
        ..println("From the perspective of the application, lets test the");
        ..println("encoding and usage of the P-Served-User header.");
        ..println("******************************************************");
        HeaderFactoryImpl himpl = new HeaderFactoryImpl();
        AddressFactory addfact = new AddressFactoryImpl();
        try {
            PServedUserHeader psuh = himpl.createPServedUserHeader(addfact.createAddress(addfact.createSipURI("aayush""rancore.com")));
            psuh.setSessionCase("orig");
            psuh.setRegistrationState("reg");
            ..println("The encoded header is---> "+psuh.toString());
            ..println("The sescase is---> "+psuh.getSessionCase());
            ..println("The Regs state is--->"+psuh.getRegistrationState());
        } catch (ParseException e) {
            e.printStackTrace();
        }
    }
New to GrepCode? Check out our FAQ X