Package org.mokai.connector.smpp

Examples of org.mokai.connector.smpp.SmppConnector$EnquireLinkThread


      connector.doStop();
    }
  }

  private SmppConnector createAndStartSmppConnector(SmppConfiguration configuration, MessageStore messageStore, MessageProducer messageProducer) throws Exception {
    SmppConnector connector = new SmppConnector(configuration);
    injectResource(new MockProcessorContext(), connector);

    if (messageStore == null) {
      messageStore = new MockMessageStore();
    }
    injectResource(messageStore, connector);

    if (messageProducer == null) {
      messageProducer = new MockMessageProducer();
    }
    injectResource(messageProducer, connector);

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

    return connector;
  }
View Full Code Here


    configuration.setSystemId("test");
    configuration.setPassword("test");

    MessageStore messageStore = new MockMessageStore();

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

    try {
      Message message = new Message();
      message.setProperty("to", "3542");
      message.setProperty("from", "3002175604");
      message.setProperty("text", "This is the test");
      message.setProperty("sequenceNumber", 1);
      message.setProperty("messageId", "12000");
      message.setProperty("commandStatus", 0);

      messageStore.saveOrUpdate(message);

      DeliverSm deliverSm = new DeliverSm();
      deliverSm.setEsmClass(SmppConstants.ESM_CLASS_MT_SMSC_DELIVERY_RECEIPT);
      deliverSm.setDestAddress(new Address((byte) 0, (byte) 0, "3002175604"));
      deliverSm.setSourceAddress(new Address((byte) 0, (byte) 0, "3542"));
      deliverSm.setShortMessage("id:12000 sub:1 dlvrd:1 submit date:1101010000 done date:1101010000 stat:DELIVRD err:0 text:This is a ... ".getBytes());

      // retrieve the session
      Assert.assertEquals(server.getSessions().size(), 1);
      SmppSession session = server.getSessions().iterator().next();
      Assert.assertNotNull(session);

      // send the delivery receipt
      session.sendRequest(deliverSm);

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

    configuration.setSystemId("test");
    configuration.setPassword("test");
    configuration.setInitialReconnectDelay(500);
    configuration.setReconnectDelay(500);

    SmppConnector connector = new SmppConnector(configuration);
    injectResource(new MockProcessorContext(), connector);
    connector.doStart();

    waitUntilStatus(connector, 3000, Status.FAILED);

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

    connector.doStop();
  }
View Full Code Here

TOP

Related Classes of org.mokai.connector.smpp.SmppConnector$EnquireLinkThread

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.