Package org.jsmpp.bean

Examples of org.jsmpp.bean.DataSm


        assertTrue(message.isAlertNotification());
    }
   
    @Test
    public void testSmppMessageDataSm() {
        DataSm command = new DataSm();
        message = new SmppMessage(command, new SmppConfiguration());
       
        assertTrue(message.getCommand() instanceof DataSm);
        assertTrue(message.getHeaders().isEmpty());
        assertTrue(message.isDataSm());
View Full Code Here


        assertEquals(SmppMessageType.DeliverSm.toString(), smppMessage.getHeader(SmppBinding.MESSAGE_TYPE));
    }
   
    @Test
    public void createSmppMessageFromDataSmShouldReturnASmppMessage() throws Exception {
        DataSm dataSm = new DataSm();
        dataSm.setSequenceNumber(1);
        dataSm.setCommandId(1);
        dataSm.setCommandStatus(0);
        dataSm.setSourceAddr("1818");
        dataSm.setSourceAddrNpi(NumberingPlanIndicator.NATIONAL.value());
        dataSm.setSourceAddrTon(TypeOfNumber.NATIONAL.value());
        dataSm.setDestAddress("1919");
        dataSm.setDestAddrNpi(NumberingPlanIndicator.NATIONAL.value());
        dataSm.setDestAddrTon(TypeOfNumber.NATIONAL.value());
        dataSm.setServiceType("WAP");
        dataSm.setRegisteredDelivery((byte) 0);
        SmppMessage smppMessage = binding.createSmppMessage(dataSm, "1");
       
        assertNull(smppMessage.getBody());
        assertEquals(14, smppMessage.getHeaders().size());
        assertEquals("1", smppMessage.getHeader(SmppBinding.ID));
View Full Code Here

    }
   
    @Test
    public void onAcceptDataSmSuccess() throws Exception {
        SMPPSession session = createMock(SMPPSession.class);
        DataSm dataSm = createMock(DataSm.class);
        Exchange exchange = createMock(Exchange.class);
        OptionalParameter[] optionalParameters = new OptionalParameter[]{};
       
        expect(endpoint.createOnAcceptDataSm(dataSm, "1"))
            .andReturn(exchange);
        processor.process(exchange);
        expect(dataSm.getOptionalParametes())
            .andReturn(optionalParameters);
       
        replay(endpoint, processor, exceptionHandler, session, dataSm, exchange);
       
        DataSmResult result = listener.onAcceptDataSm(dataSm, session);
View Full Code Here

    }
   
    @Test
    public void onAcceptDataSmException() throws Exception {
        SMPPSession session = createMock(SMPPSession.class);
        DataSm dataSm = createMock(DataSm.class);
        Exchange exchange = createMock(Exchange.class);
        Exception exception = new Exception("forced exception for test");
       
        expect(endpoint.createOnAcceptDataSm(dataSm, "1"))
            .andReturn(exchange);
View Full Code Here

    }
   
    @Test
    public void onAcceptDataSmProcessRequestException() throws Exception {
        SMPPSession session = createMock(SMPPSession.class);
        DataSm dataSm = createMock(DataSm.class);
        Exchange exchange = createMock(Exchange.class);
        ProcessRequestException exception = new ProcessRequestException("forced exception for test", 100);
       
        expect(endpoint.createOnAcceptDataSm(dataSm, "1"))
            .andReturn(exchange);
View Full Code Here

        assertSame(ExchangePattern.InOut, exchange.getPattern());
    }
   
    @Test
    public void createOnAcceptDataSm() throws Exception {
        DataSm dataSm = createMock(DataSm.class);
        SmppMessage message = createMock(SmppMessage.class);
        expect(binding.createSmppMessage(eq(dataSm), isA(String.class))).andReturn(message);
        message.setExchange(isA(Exchange.class));
       
        replay(dataSm, binding, message);
View Full Code Here

        assertSame(ExchangePattern.InOnly, exchange.getPattern());
    }
   
    @Test
    public void createOnAcceptDataSmWithExchangePattern() throws Exception {
        DataSm dataSm = createMock(DataSm.class);
        SmppMessage message = createMock(SmppMessage.class);
        expect(binding.createSmppMessage(eq(dataSm), isA(String.class))).andReturn(message);
        message.setExchange(isA(Exchange.class));
       
        replay(dataSm, binding, message);
View Full Code Here

        assertTrue(message.isAlertNotification());
    }
   
    @Test
    public void testSmppMessageDataSm() {
        DataSm command = new DataSm();
        message = new SmppMessage(command, new SmppConfiguration());
       
        assertTrue(message.getCommand() instanceof DataSm);
        assertTrue(message.getHeaders().isEmpty());
        assertTrue(message.isDataSm());
View Full Code Here

        assertEquals(SmppMessageType.DeliverSm.toString(), smppMessage.getHeader(SmppBinding.MESSAGE_TYPE));
    }
   
    @Test
    public void createSmppMessageFromDataSmShouldReturnASmppMessage() throws Exception {
        DataSm dataSm = new DataSm();
        dataSm.setSequenceNumber(1);
        dataSm.setCommandId(1);
        dataSm.setCommandStatus(0);
        dataSm.setSourceAddr("1818");
        dataSm.setSourceAddrNpi(NumberingPlanIndicator.NATIONAL.value());
        dataSm.setSourceAddrTon(TypeOfNumber.NATIONAL.value());
        dataSm.setDestAddress("1919");
        dataSm.setDestAddrNpi(NumberingPlanIndicator.NATIONAL.value());
        dataSm.setDestAddrTon(TypeOfNumber.NATIONAL.value());
        dataSm.setServiceType("WAP");
        dataSm.setRegisteredDelivery((byte) 0);
        SmppMessage smppMessage = binding.createSmppMessage(dataSm, "1");
       
        assertNull(smppMessage.getBody());
        assertEquals(14, smppMessage.getHeaders().size());
        assertEquals("1", smppMessage.getHeader(SmppBinding.ID));
View Full Code Here

        assertEquals(SmppMessageType.DeliverSm.toString(), smppMessage.getHeader(SmppConstants.MESSAGE_TYPE));
    }
   
    @Test
    public void createSmppMessageFromDataSmShouldReturnASmppMessage() throws Exception {
        DataSm dataSm = new DataSm();
        dataSm.setSequenceNumber(1);
        dataSm.setCommandId(1);
        dataSm.setCommandStatus(0);
        dataSm.setSourceAddr("1818");
        dataSm.setSourceAddrNpi(NumberingPlanIndicator.NATIONAL.value());
        dataSm.setSourceAddrTon(TypeOfNumber.NATIONAL.value());
        dataSm.setDestAddress("1919");
        dataSm.setDestAddrNpi(NumberingPlanIndicator.NATIONAL.value());
        dataSm.setDestAddrTon(TypeOfNumber.NATIONAL.value());
        dataSm.setServiceType("WAP");
        dataSm.setRegisteredDelivery((byte) 0);
        SmppMessage smppMessage = binding.createSmppMessage(dataSm, "1");
       
        assertNull(smppMessage.getBody());
        assertEquals(14, smppMessage.getHeaders().size());
        assertEquals("1", smppMessage.getHeader(SmppConstants.ID));
View Full Code Here

TOP

Related Classes of org.jsmpp.bean.DataSm

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.