Examples of SipURI


Examples of javax.servlet.sip.SipURI

  /**
   * @see ServletRequest#getParameter(String)
   */
  public String getParameter(String name)
    {
    SipURI paramUri = getParamUri();
   
    if (paramUri == null)
      return null;
   
    return paramUri.getParameter(name);
  }
View Full Code Here

Examples of javax.servlet.sip.SipURI

   */
  public Map getParameterMap()
    {
    Map map = new HashMap();
   
    SipURI paramUri = getParamUri();
   
    if (paramUri != null)
        {
      Iterator it = paramUri.getParameterNames();
      while (it.hasNext())
            {
        String key = (String) it.next();
        map.put(key, new String[] {paramUri.getParameter(key)});
      }
    }
    return Collections.unmodifiableMap(map);
  }
View Full Code Here

Examples of javax.servlet.sip.SipURI

  /**
   * @see javax.servlet.ServletRequest#getParameterNames()
   */
  public Enumeration getParameterNames()
    {
    SipURI paramUri = getParamUri();
   
    if (paramUri == null)
      return Collections.enumeration(Collections.EMPTY_LIST);
   
    return new IteratorToEnum(paramUri.getParameterNames());
  }
View Full Code Here

Examples of javax.servlet.sip.SipURI

 

  @Test
  public void testSipUser() throws Exception
  {
    SipURI uri = sipURI("sip:user@host.com:3261");
    assertEquals("user", uri.getUser());
    assertEquals("host.com", uri.getHost());
  }
View Full Code Here

Examples of javax.servlet.sip.SipURI

  }

  @Test
  public void testPassword() throws Exception
  {
    SipURI uri = sipURI("sip:user:passwd@host.com");
    assertEquals("passwd", uri.getUserPassword());
  }
View Full Code Here

Examples of javax.servlet.sip.SipURI

   
    assertEquals("host-1.com", sipURI("sip:user@host-1.com:3261").getHost());
    assertEquals("[::1]", sipURI("sip:user@[::1]:5060").getHost());
    try {sipURI("sip:user@space here:5060"); fail(); } catch (ServletParseException e) {}
    try {sipURI("sip:user@plus+here:5060"); fail(); } catch (ServletParseException e) {}
    SipURI uri = sipURI("sip:1234@foo.com");
    uri.setHost("::1");
    assertEquals("[::1]", uri.getHost());
    assertEquals("sip:1234@[::1]", uri.toString());
   
    uri = sipURI("sip:vivekg@chair-dnrc.example.com ; transport = TCP");
    assertEquals("chair-dnrc.example.com", uri.getHost());
    assertEquals("TCP", uri.getParameter("transport"));
  }
View Full Code Here

Examples of javax.servlet.sip.SipURI

  }

  @Test
  public void testParam() throws Exception
  {
    SipURI uri = sipURI("sip:1234@foo.com;user=phone;lr");
    assertEquals(true, uri.getLrParam());
    assertEquals("phone", uri.getUserParam());
    assertNull(uri.getParameter("unknown"));
    assertNull(uri.getParameter("transport"));
    HashMap<String, String> params = new HashMap<String, String>();
    params.put("user", "phone");
    params.put("lr", "");
    Iterator<String> it = uri.getParameterNames();
    while (it.hasNext())
    {
      String name = (String) it.next();
      assertTrue(params.containsKey(name));
      assertEquals(params.get(name), uri.getParameter(name));
      params.remove(name);
    }
    assertTrue(params.isEmpty());
  }
View Full Code Here

Examples of javax.servlet.sip.SipURI

  }

  @Test
  public void testHeader() throws Exception
  {
    SipURI uri = sipURI("sip:1234@foo.com?Subject=nexcom");
    assertEquals("nexcom", uri.getHeader("Subject"));
    assertNull(uri.getHeader("unknown"));
  }
View Full Code Here

Examples of javax.servlet.sip.SipURI

  @Test
  public void testDifferent() throws Exception
  {
    for (int i = 0; i < __different.length; i++)
    {
      SipURI uri1 = sipURI(__different[i][0]);
      SipURI uri2 = sipURI(__different[i][1]);
      assertFalse(uri1.equals(uri2));
      assertFalse(uri2.equals(uri1));
    }
  }
View Full Code Here

Examples of javax.servlet.sip.SipURI

  }

  @Test
  public void testClone() throws Exception
  {
    SipURI uri = sipURI("sip:user@host.com:1234;foo=bar");
    SipURI clone = (SipURI) uri.clone();
   
    assertEquals(uri.toString(), clone.toString());
    uri.setLrParam(true);
    assertFalse(clone.getLrParam());
    assertTrue(uri.getLrParam());
  }
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.