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();
}
}