Examples of SCMPPart


Examples of org.serviceconnector.scmp.SCMPPart

   * Description: Encode EXC test<br>
   * Expectation: passes
   */
  @Test
  public void t22_encodeEXCTest() {
    IEncoderDecoder coder = coderFactory.createEncoderDecoder(new SCMPPart(SCMPVersion.CURRENT));

    this.headKey = SCMPHeaderKey.EXC;
    String header = "msn=" + msgSequenceNr + "\n" + "bty=" + bodyType.getValue() + "\n" + "mty=" + msgType.getValue() + "\n";

    String expectedString = TestUtil.getSCMPString(headKey, header, body);
View Full Code Here

Examples of org.serviceconnector.scmp.SCMPPart

   * Description: Encode PRQ test<br>
   * Expectation: passes
   */
  @Test
  public void t23_EncodePRQTest() {
    IEncoderDecoder coder = coderFactory.createEncoderDecoder(new SCMPPart(SCMPVersion.CURRENT));

    this.headKey = SCMPHeaderKey.PRQ;
    String header = "msn=" + msgSequenceNr + "\n" + "bty=" + bodyType.getValue() + "\n" + "mty=" + msgType.getValue() + "\n";

    String expectedString = TestUtil.getSCMPString(headKey, header, body);

    SCMPMessage encodeRes = new SCMPPart(SCMPVersion.CURRENT);
    encodeRes.setHeader(encodeScmp);
    encodeRes.setBody(body.getBytes());

    OutputStream os = new ByteArrayOutputStream();
    try {
      coder.encode(os, encodeRes);
    } catch (Exception e) {
View Full Code Here

Examples of org.serviceconnector.scmp.SCMPPart

   * Description: Encode PRS test<br>
   * Expectation: passes
   */
  @Test
  public void t24_EncodePRSTest() {
    IEncoderDecoder coder = coderFactory.createEncoderDecoder(new SCMPPart(SCMPVersion.CURRENT));

    this.headKey = SCMPHeaderKey.PRS;
    String header = "msn=" + msgSequenceNr + "\n" + "bty=" + bodyType.getValue() + "\n" + "mty=" + msgType.getValue() + "\n";

    String expectedString = TestUtil.getSCMPString(headKey, header, body);

    SCMPMessage encodeRes = new SCMPPart(SCMPVersion.CURRENT);
    encodeRes.setIsReply(true);
    encodeRes.setHeader(encodeScmp);
    encodeRes.setBody(body.getBytes());

    OutputStream os = new ByteArrayOutputStream();
    try {
      coder.encode(os, encodeRes);
    } catch (Exception e) {
View Full Code Here

Examples of org.serviceconnector.scmp.SCMPPart

   * Description: Encode body types test<br>
   * Expectation: passes
   */
  @Test
  public void t25_EncodeBodyTypesTest() {
    IEncoderDecoder coder = coderFactory.createEncoderDecoder(new SCMPPart(SCMPVersion.CURRENT));

    String header = "msn=" + msgSequenceNr + "\n" + "bty=" + bodyType.getValue() + "\n" + "mty=" + msgType.getValue() + "\n";

    String expectedString = TestUtil.getSCMPString(headKey, header, body);

View Full Code Here

Examples of org.serviceconnector.scmp.SCMPPart

  public void t01_InvalidSCMPVersionFormatTest() {
    String requestString = "REQ 0000053 00053 xxx\nldt=2010-08-02T11:24:52.093+0200\nver=1.0-000\nmty=ATT";

    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) {
View Full Code Here

Examples of org.serviceconnector.scmp.SCMPPart

  public void t02_InvalidSCMPVersion9_9Test() {
    String requestString = "REQ 0000053 00053 9.9\nldt=2010-08-02T11:24:52.093+0200\nver=1.0-000\nmty=ATT";

    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) {
View Full Code Here

Examples of org.serviceconnector.scmp.SCMPPart

  public void t03_InvalidSCMPVersion0_9Test() {
    String requestString = "REQ 0000053 00053 0.9\nldt=2010-08-02T11:24:52.093+0200\nver=1.0-000\nmty=ATT";

    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) {
View Full Code Here

Examples of org.serviceconnector.scmp.SCMPPart

  public void t03_ValidSCMPVersionTest() {
    String requestString = "REQ 0000052 00052 1.0\nldt=2010-08-02T11:24:52.093+0200\nver=1.0-000\nmty=ATT";

    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

Examples of org.serviceconnector.scmp.SCMPPart

  @Test
  public void t10_InvalidReleaseNumberTest() {
    String requestString = "REQ 0000053 00053 2.0\nldt=2010-08-02T11:24:52.093+0200\nver=1.0-000\nmty=ATT";
    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) {
View Full Code Here

Examples of org.serviceconnector.scmp.SCMPPart

    SCMPMessage request = new SCMPMessage(SCMPVersion.CURRENT);
    request.setBody("request");
    request.setMessageType(SCMPMsgType.CLN_EXECUTE);

    SCMPPart firstPart = new SCMPPart(SCMPVersion.CURRENT, false);
    String bodyString = "first part request";
    firstPart.setBody(bodyString);
    SCMPCompositeReceiver largeResponse = new SCMPCompositeReceiver(request, firstPart);

    bodyLength += bodyString.length();
    body.append(bodyString);
    Assert.assertEquals(bodyLength, largeResponse.getOffset());

    for (int i = 0; i < 10; i++) {
      SCMPPart part = new SCMPPart(SCMPVersion.CURRENT);
      bodyString = "part nr: " + i;
      part.setBody(bodyString);
      largeResponse.add(part);
      bodyLength += bodyString.length();
      body.append(bodyString);
      Assert.assertEquals(bodyLength, largeResponse.getOffset());
    }
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.