Package org.mokai.connector.smpp

Examples of org.mokai.connector.smpp.SmppConnector.doStop()


      startSimulator();
      waitUntilStatus(connector, DEFAULT_TIMEOUT, Status.OK);

      Assert.assertEquals(connector.getStatus(), Status.OK);
    } finally {
      connector.doStop();
    }
  }

  @Test
  public void testBindParameters() throws Exception {
View Full Code Here


    SmppConnector connector = new SmppConnector(configuration);
    injectResource(new MockProcessorContext(), connector);
    connector.doStart();
    waitUntilStatus(connector, DEFAULT_TIMEOUT, Status.OK);

    connector.doStop();

    // validate the bind packet
    Bind bind = pp.getBindPacket(DEFAULT_TIMEOUT);
    Assert.assertNotNull( bind );
    Assert.assertEquals( bind.getCommandId(), SmppPacket.BIND_TRANSCEIVER );
View Full Code Here

      Assert.assertEquals(submitSM.getSourceAddress().getAddress(), "3542");
      Assert.assertEquals(submitSM.getDataCoding(), 3);

      Assert.assertEquals(submitSM.getShortMessage(), "This is the test with ñ");
    } finally {
      connector.doStop();
    }
  }

  @Test
  public void testProcessLongMessage() throws Exception {
View Full Code Here

      Assert.assertEquals(ByteArrayUtil.toByte(segmentTlv.getValue()), 2);

      msgRefTlv = submitSm.getOptionalParameter(SmppConstants.TAG_SAR_MSG_REF_NUM);
      Assert.assertNotNull(msgRefTlv);
    } finally {
      connector.doStop();
    }
  }

  @Test
  public void testReceiveMessage() throws Exception {
View Full Code Here

      Message message = (Message) messageProducer.getMessage(0);
      Assert.assertEquals(to, message.getProperty("to", String.class));
      Assert.assertEquals(from, message.getProperty("from", String.class));
      Assert.assertEquals(text, message.getProperty("text", String.class));
    } finally {
      connector.doStop();
    }
  }

  @Test
  public void testReceiveDeliveryReceipt() throws Exception {
View Full Code Here

      Assert.assertEquals(from, receivedMessage.getProperty("to", String.class));
      Assert.assertEquals(to, receivedMessage.getProperty("from", String.class));
      Assert.assertEquals(receivedMessage.getProperty("messageId", String.class), 12000 + "");
      Assert.assertEquals("DELIVRD", receivedMessage.getProperty("finalStatus", String.class));
    } finally {
      connector.doStop();
    }
  }

  @Test
  public void testReceiveDeliveryReceiptWithHexaId() throws Exception {
View Full Code Here

      }

      Message receivedMessage = (Message) messageProducer.getMessage(0);
      Assert.assertNotNull(receivedMessage);
    } finally {
      connector.doStop();
    }
  }

  @Test
  public void testReceiveDeliveryReceiptWithDecId() throws Exception {
View Full Code Here

      }

      Message receivedMessage = (Message) messageProducer.getMessage(0);
      Assert.assertNotNull(receivedMessage);
    } finally {
      connector.doStop();
    }
  }

  @Test
  public void testFailedCommandStatuses() throws Exception {
View Full Code Here

      Assert.assertNotNull(m1);

      waitMessageUntilStatus(m1, DEFAULT_TIMEOUT, Message.STATUS_FAILED);
      Assert.assertEquals(m1.getStatus(), Message.STATUS_FAILED);
    } finally {
      connector.doStop();
    }
  }

  private SmppConnector createAndStartSmppConnector(SmppConfiguration configuration, MessageStore messageStore, MessageProducer messageProducer) throws Exception {
    SmppConnector connector = new SmppConnector(configuration);
View Full Code Here

      long timeout = 2000;
      if (receiveMessage(messageProducer, timeout)) {
        Assert.fail("the message was received");
      }
    } finally {
      connector.doStop();
    }
  }

  @Test
  public void testFailedConnectionOnStart() throws Exception {
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.