Package gov.nist.javax.sip.stack

Examples of gov.nist.javax.sip.stack.WebSocketCodec


    ByteArrayInputStream bais3 = new ByteArrayInputStream(raw3);
    ByteArrayInputStream bais4 = new ByteArrayInputStream(raw4);
    ByteArrayInputStream bais5 = new ByteArrayInputStream(raw2);
    ByteArrayInputStream bais6 = new ByteArrayInputStream(raw3);
    ByteArrayInputStream bais7 = new ByteArrayInputStream(raw4);
    WebSocketCodec codec = new WebSocketCodec(true, false);
    assertNull(codec.decode(bais1));
    assertNull(codec.decode(bais2));
    assertNull(codec.decode(bais3));
    String s = new String(codec.decode(bais4));
    System.out.println(s);
    assertNotNull(s);
    assertTrue(s.startsWith("REGISTER"));
    assertNull(codec.decode(bais5));
    assertNull(codec.decode(bais6));
    s = new String(codec.decode(bais7));
    System.out.println(s);
    assertNotNull(s);
    assertTrue(s.startsWith("REGISTER"));
  }
View Full Code Here


   */
  public void testByteOverflowMetadata() throws Exception {
    ByteArrayInputStream bais1 = new ByteArrayInputStream(raw5);
    ByteArrayInputStream bais2 = new ByteArrayInputStream(raw5);
    ByteArrayInputStream bais3 = new ByteArrayInputStream(raw5);
    WebSocketCodec codec = new WebSocketCodec(true, false);
    String s = new String(codec.decode(bais1));
    System.out.println(s);
    assertTrue(s.startsWith("REGISTER"));
    s = new String(codec.decode(bais2));
    System.out.println(s);
    s = new String(codec.decode(bais3));
    System.out.println(s);
    assertNotNull(s);
    assertTrue(s.startsWith("REGISTER"));
  }
View Full Code Here

   * Two messages in single frame
   * @throws Exception
   */
  public void testMoreThanOneMessageInTheFrame() throws Exception {
    ByteArrayInputStream bais1 = new ByteArrayInputStream(raw52);
    WebSocketCodec codec = new WebSocketCodec(true, false);
    String s = new String(codec.decode(bais1));
    assertNotNull(s);
    assertTrue(s.startsWith("REGISTER"));
    System.out.println(s);
    s = new String(codec.decode(new ByteArrayInputStream(new byte[]{})));
    System.out.println(s);
    assertNotNull(s);
    assertTrue(s.startsWith("REGISTER"));
   
  }
View Full Code Here

TOP

Related Classes of gov.nist.javax.sip.stack.WebSocketCodec

Copyright © 2018 www.massapicom. 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.