Examples of newPublish()


Examples of org.cafesip.sipunit.PublishSession.newPublish()

     * </pre>
   */
  public void testSubscription3() throws Exception
  {
    PublishSession publishSession = new PublishSession(getBobPhone());
        Request publish = publishSession.newPublish(getClass().getResourceAsStream("publish1.xml"), 60); // 1
        publishSession.sendRequest(publish, SipResponse.OK); // 2
   
    SubscribeSession presenceSession = new SubscribeSession(getAlicePhone(), "presence");
    Request subscribe = presenceSession.newInitialSubscribe(100, getBobUri()); // 3
    presenceSession.sendRequest(subscribe, Response.OK); // 4
View Full Code Here

Examples of org.cafesip.sipunit.PublishSession.newPublish()

     * Note: Alice and Bob are inverted in this test.
   */
  public void testWaitingState() throws Exception
  {
    PublishSession publishSession = new PublishSession(getAlicePhone());
        Request publish = publishSession.newPublish(getClass().getResourceAsStream("publish1.xml"), 60); // 1
        publishSession.sendRequest(publish, SipResponse.OK); // 2
       
        SubscribeSession presenceSession = new SubscribeSession(getBobPhone(), "presence");
    Request subscribe = presenceSession.newInitialSubscribe(0, getAliceUri()); // 3
    presenceSession.sendRequest(subscribe, Response.OK); // 4
View Full Code Here

Examples of org.cafesip.sipunit.PublishSession.newPublish()

        assertEquals("closed", dev.getBasicStatus());
       
        Thread.sleep(200);
       
        PublishSession publishSession = new PublishSession(getBobPhone());
        Request publish = publishSession.newPublish(getClass().getResourceAsStream("publish1.xml"), 20);
        publishSession.sendRequest(publish, SipResponse.OK);

        // get the NOTIFY
        reqevent = s.waitNotify(10000);
        assertNotNull(s.format(), reqevent);
View Full Code Here

Examples of org.cafesip.sipunit.PublishSession.newPublish()

   
   
    public void testEtags() throws Exception
    {      
       PublishSession publishSession = new PublishSession(getBobPhone());
         Request publish = publishSession.newPublish(getClass().getResourceAsStream("publish1.xml"), 20);
         Response response = publishSession.sendRequest(publish, SipResponse.OK);
        
         SIPETagHeader etagHeader = (SIPETagHeader) response.getHeader(SIPETagHeader.NAME);
         assertNotNull(etagHeader);
         String etag = etagHeader.getETag();
View Full Code Here

Examples of org.cafesip.sipunit.PublishSession.newPublish()

        
         SIPETagHeader etagHeader = (SIPETagHeader) response.getHeader(SIPETagHeader.NAME);
         assertNotNull(etagHeader);
         String etag = etagHeader.getETag();
        
         publish = publishSession.newPublish(getClass().getResourceAsStream("publish2.xml"), 20);
         HeaderFactory hf = publishSession.getHeaderFactory();
         publish.setHeader(hf.createSIPIfMatchHeader(etag));
         response = publishSession.sendRequest(publish, SipResponse.OK);
         etagHeader = (SIPETagHeader) response.getHeader(SIPETagHeader.NAME);
         assertNotNull(etagHeader);
View Full Code Here

Examples of org.cafesip.sipunit.PublishSession.newPublish()

         publish.setHeader(hf.createSIPIfMatchHeader(etag));
         response = publishSession.sendRequest(publish, SipResponse.OK);
         etagHeader = (SIPETagHeader) response.getHeader(SIPETagHeader.NAME);
         assertNotNull(etagHeader);
        
         publish = publishSession.newPublish(getClass().getResourceAsStream("publish1.xml"), 20);
         publish.setHeader(hf.createSIPIfMatchHeader(etag)); //Use old etag
         response = publishSession.sendRequest(publish, SipServletResponse.SC_CONDITIONAL_REQUEST_FAILED);
        
         publish = publishSession.newUnpublish(); // 25
      publishSession.sendRequest(publish, Response.OK); // 26
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.