Package org.jsmpp.bean

Examples of org.jsmpp.bean.DeliverSm


        verify(endpoint, processor, exceptionHandler, deliverSm, exchange);
    }
   
    @Test
    public void onAcceptDeliverSmException() throws Exception {
        DeliverSm deliverSm = createMock(DeliverSm.class);
        Exchange exchange = createMock(Exchange.class);
       
        expect(endpoint.createOnAcceptDeliverSmExchange(deliverSm))
            .andReturn(exchange);
        processor.process(exchange);
View Full Code Here


        verify(endpoint, processor, exceptionHandler, deliverSm, exchange);
    }
   
    @Test
    public void onAcceptDeliverSmProcessRequestException() throws Exception {
        DeliverSm deliverSm = createMock(DeliverSm.class);
        Exchange exchange = createMock(Exchange.class);
        ProcessRequestException exception = new ProcessRequestException("forced exception for test", 100);
       
        expect(endpoint.createOnAcceptDeliverSmExchange(deliverSm))
            .andReturn(exchange);
View Full Code Here

        assertSame(ExchangePattern.InOut, exchange.getPattern());
    }

    @Test
    public void createOnAcceptDeliverSmExchange() throws Exception {
        DeliverSm deliverSm = createMock(DeliverSm.class);
        SmppMessage message = createMock(SmppMessage.class);
        expect(binding.createSmppMessage(deliverSm)).andReturn(message);
        message.setExchange(isA(Exchange.class));
       
        replay(deliverSm, binding, message);
View Full Code Here

        assertSame(ExchangePattern.InOnly, exchange.getPattern());
    }

    @Test
    public void createOnAcceptDeliverSmWithExchangePattern() throws Exception {
        DeliverSm deliverSm = createMock(DeliverSm.class);
        SmppMessage message = createMock(SmppMessage.class);
        expect(binding.createSmppMessage(deliverSm)).andReturn(message);
        message.setExchange(isA(Exchange.class));
       
        replay(deliverSm, binding, message);
View Full Code Here

        assertTrue(message.isDataSm());
    }

    @Test
    public void testSmppMessageDeliverSm() {
        DeliverSm command = new DeliverSm();
        message = new SmppMessage(command, new SmppConfiguration());
       
        assertTrue(message.getCommand() instanceof DeliverSm);
        assertTrue(message.getHeaders().isEmpty());
        assertTrue(message.isDeliverSm());
View Full Code Here

        assertTrue(message.isDeliverSm());
    }
   
    @Test
    public void testSmppMessageDeliverReceipt() {
        DeliverSm command = new DeliverSm();
        command.setSmscDeliveryReceipt();
        command.setShortMessage("id:2 sub:001 dlvrd:001 submit date:0908312310 done date:0908312311 stat:DELIVRD err:xxx Text:Hello SMPP world!".getBytes());
        message = new SmppMessage(command, new SmppConfiguration());
       
        assertTrue(message.getCommand() instanceof DeliverSm);
        assertTrue(message.getHeaders().isEmpty());
        assertTrue(message.isDeliveryReceipt());
View Full Code Here

        assertNull(message.createBody());
    }
   
    @Test
    public void createBodyShouldReturnTheShortMessageIfTheCommandIsAMessageRequest() {
        DeliverSm command = new DeliverSm();
        command.setShortMessage("Hello SMPP world!".getBytes());
        message = new SmppMessage(command, new SmppConfiguration());
       
        assertEquals("Hello SMPP world!", message.createBody());
    }
View Full Code Here

        assertEquals("SmppMessage: null", message.toString());
    }
   
    @Test
    public void toStringShouldReturnTheShortMessageIfTheCommandIsNotNull() {
        DeliverSm command = new DeliverSm();
        command.setShortMessage("Hello SMPP world!".getBytes());
        message = new SmppMessage(command, new SmppConfiguration());
       
        assertEquals("SmppMessage: PDUHeader(0, 00000000, 00000000, 0)", message.toString());
    }
View Full Code Here

        assertEquals(SmppMessageType.AlertNotification.toString(), smppMessage.getHeader(SmppBinding.MESSAGE_TYPE));
    }

    @Test
    public void createSmppMessageFromDeliveryReceiptShouldReturnASmppMessage() throws Exception {
        DeliverSm deliverSm = new DeliverSm();
        deliverSm.setSmscDeliveryReceipt();
        deliverSm.setShortMessage("id:2 sub:001 dlvrd:001 submit date:0908312310 done date:0908312311 stat:DELIVRD err:xxx Text:Hello SMPP world!".getBytes());
        SmppMessage smppMessage = binding.createSmppMessage(deliverSm);
       
        assertEquals("Hello SMPP world!", smppMessage.getBody());
        assertEquals(8, smppMessage.getHeaders().size());
        assertEquals("2", smppMessage.getHeader(SmppBinding.ID));
View Full Code Here

        assertEquals(SmppMessageType.DeliveryReceipt.toString(), smppMessage.getHeader(SmppBinding.MESSAGE_TYPE));
    }
   
    @Test
    public void createSmppMessageFromDeliverSmShouldReturnASmppMessage() throws Exception {
        DeliverSm deliverSm = new DeliverSm();
        deliverSm.setShortMessage("Hello SMPP world!".getBytes());
        deliverSm.setSequenceNumber(1);
        deliverSm.setCommandId(1);
        deliverSm.setSourceAddr("1818");
        deliverSm.setDestAddress("1919");
        deliverSm.setScheduleDeliveryTime("090831230627004+");
        deliverSm.setValidityPeriod("090901230627004+");
        deliverSm.setServiceType("WAP");
        SmppMessage smppMessage = binding.createSmppMessage(deliverSm);
       
        assertEquals("Hello SMPP world!", smppMessage.getBody());
        assertEquals(8, smppMessage.getHeaders().size());
        assertEquals(1, smppMessage.getHeader(SmppBinding.SEQUENCE_NUMBER));
View Full Code Here

TOP

Related Classes of org.jsmpp.bean.DeliverSm

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.