Package org.serviceconnector.net

Examples of org.serviceconnector.net.IEncoderDecoder.decode()


    InputStream is = new ByteArrayInputStream(buffer);
    IEncoderDecoder coder = coderFactory.createEncoderDecoder(new SCMPPart(SCMPVersion.CURRENT));

    SCMPMessage message = null;
    try {
      message = (SCMPMessage) coder.decode(is);
    } catch (Exception e) {
      Assert.fail("Should not throw exception");
    }
    verifySCMP(message);
View Full Code Here


    is = new ByteArrayInputStream(buffer);
    coder = coderFactory.createEncoderDecoder(new SCMPPart(SCMPVersion.CURRENT));

    message = null;
    try {
      message = (SCMPMessage) coder.decode(is);
    } catch (Exception e) {
      Assert.fail("Should not throw exception");
    }
    verifySCMPStringBody(message);
  }
View Full Code Here

        ConnectionLogger.logReadBuffer(this.getClass().getSimpleName(), request.getServerName(), request.getServerPort(),
            buffer, 0, buffer.length);
      }
      ByteArrayInputStream bais = new ByteArrayInputStream(buffer);
      encoderDecoder = AppContext.getEncoderDecoderFactory().createEncoderDecoder(buffer);
      reqMessage = (SCMPMessage) encoderDecoder.decode(bais);

      if (reqMessage.isKeepAlive() == true) {
        // keep alive received, just reply nothing more to do.
        reqMessage.setIsReply(true);
        // write reply to servlet output stream
View Full Code Here

    InputStream is = new ByteArrayInputStream(buffer);
    IEncoderDecoder coder = coderFactory.createEncoderDecoder(new SCMPKeepAlive(SCMPVersion.CURRENT));

    SCMPMessage message = null;
    try {
      message = (SCMPMessage) coder.decode(is);
    } catch (Exception e) {
      Assert.fail("Should not throw exception");
    }
    verifySCMP(message);
  }
View Full Code Here

    InputStream is = new ByteArrayInputStream(buffer);
    IEncoderDecoder coder = coderFactory.createEncoderDecoder(new SCMPKeepAlive(SCMPVersion.CURRENT));

    SCMPMessage message = null;
    try {
      message = (SCMPMessage) coder.decode(is);
    } catch (Exception e) {
      Assert.fail("Should not throw exception");
    }
    verifySCMP(message);
  }
View Full Code Here

    byte[] buffer = requestString.getBytes();
    InputStream is = new ByteArrayInputStream(buffer);
    IEncoderDecoder coder = coderFactory.createEncoderDecoder(new SCMPPart(SCMPVersion.CURRENT));

    try {
      coder.decode(is);
      Assert.fail("Should throw exception");
    } catch (Exception e) {
      Assert.assertEquals("Incompatible SCMP release nr. [xxx]", e.getMessage());
    }
  }
View Full Code Here

    byte[] buffer = requestString.getBytes();
    InputStream is = new ByteArrayInputStream(buffer);
    IEncoderDecoder coder = coderFactory.createEncoderDecoder(new SCMPPart(SCMPVersion.CURRENT));

    try {
      coder.decode(is);
      Assert.fail("Should throw exception");
    } catch (Exception e) {
      Assert.assertEquals("Incompatible SCMP release nr. [9.9]", e.getMessage());
    }
  }
View Full Code Here

    byte[] buffer = requestString.getBytes();
    InputStream is = new ByteArrayInputStream(buffer);
    IEncoderDecoder coder = coderFactory.createEncoderDecoder(new SCMPPart(SCMPVersion.CURRENT));

    try {
      coder.decode(is);
      Assert.fail("Should throw exception");
    } catch (Exception e) {
      Assert.assertEquals("Incompatible SCMP release nr. [0.9]", e.getMessage());
    }
  }
View Full Code Here

    byte[] buffer = requestString.getBytes();
    InputStream is = new ByteArrayInputStream(buffer);
    IEncoderDecoder coder = coderFactory.createEncoderDecoder(new SCMPPart(SCMPVersion.CURRENT));

    try {
      coder.decode(is);
    } catch (Exception e) {
      Assert.fail("Should not throw exception");
    }
  }
View Full Code Here

    byte[] buffer = requestString.getBytes();
    InputStream is = new ByteArrayInputStream(buffer);
    IEncoderDecoder coder = coderFactory.createEncoderDecoder(new SCMPPart(SCMPVersion.CURRENT));

    try {
      coder.decode(is);
      Assert.fail("Should throw exception");
    } catch (Exception e) {
      Assert.assertEquals("Incompatible SCMP release nr. [2.0]", e.getMessage());
    }
  }
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.