smppSessionFactoryBean.afterPropertiesSet();
ExtendedSmppSession extendedSmppSession = smppSessionFactoryBean.getObject();
Assert.assertTrue(extendedSmppSession instanceof ExtendedSmppSessionAdaptingDelegate);
ExtendedSmppSessionAdaptingDelegate es = (ExtendedSmppSessionAdaptingDelegate) extendedSmppSession;
Assert.assertNotNull("the factoried object should not be null", extendedSmppSession);
es.addMessageReceiverListener(new MessageReceiverListener() {
public void onAcceptDeliverSm(DeliverSm deliverSm) throws ProcessRequestException {
logger.debug("in onAcceptDeliverSm");
}
public void onAcceptAlertNotification(AlertNotification alertNotification) {
logger.debug("in onAcceptAlertNotification");
}
public DataSmResult onAcceptDataSm(DataSm dataSm, Session source) throws ProcessRequestException {
logger.debug("in onAcceptDataSm");
return null;
}
});
Assert.assertEquals(extendedSmppSession.getClass(), ExtendedSmppSessionAdaptingDelegate.class);
Assert.assertNotNull(es.getTargetClientSession());
Assert.assertTrue(es.getTargetClientSession() != null);
final SMPPSession s = es.getTargetClientSession();
ReflectionUtils.doWithFields(ExtendedSmppSessionAdaptingDelegate.class, new ReflectionUtils.FieldCallback() {
public void doWith(Field field) throws IllegalArgumentException, IllegalAccessException {
if (field.getName().equalsIgnoreCase("messageReceiverListener")) {
field.setAccessible(true);