@@ -0,0 +1,2297 @@
+/*%0A * Licensed under the Apache License, Version 2.0 (the %22License%22); %0A * you may not use this file except in compliance with the License. %0A * You may obtain a copy of the License at%0A * %0A *    http://www.apache.org/licenses/LICENSE-2.0%0A * %0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A * %0A */%0Apackage org.jsmpp.composing;%0A%0Aimport static org.testng.Assert.assertEquals;%0Aimport static org.testng.Assert.assertNotNull;%0A%0Aimport java.io.ByteArrayInputStream;%0Aimport java.io.ByteArrayOutputStream;%0Aimport java.io.DataInputStream;%0A%0Aimport org.jsmpp.DefaultPDUReader;%0Aimport org.jsmpp.DefaultPDUSender;%0Aimport org.jsmpp.PDUSender;%0Aimport org.jsmpp.SMPPConstant;%0Aimport org.jsmpp.bean.Command;%0Aimport org.jsmpp.bean.GenericNack;%0Aimport org.jsmpp.util.DefaultDecomposer;%0Aimport org.jsmpp.util.PDUDecomposer;%0Aimport org.testng.annotations.Test;%0A%0A/**%0A * Simulating sending and receive data from client to server (vice versa) by%0A * simple compose and decomposing the PDU.%0A * %0A * @author uudashr%0A * %0A */%0Apublic class ComposeDecompose %7B%0A    private PDUSender pduSender = new DefaultPDUSender();%0A    private DefaultPDUReader pduReader = new DefaultPDUReader();%0A    private PDUDecomposer decomposer = new DefaultDecomposer();%0A    %0A    /**%0A     * Test the composed PDU can decomposed properly.%0A     * %0A     * @throws Exception if an unexpected error found.%0A     */%0A    @Test(groups=%22checkintest%22)%0A    public void sendGenericNack() throws Exception %7B%0A        ByteArrayOutputStream out = new ByteArrayOutputStream();%0A        %0A        %0A        pduSender.sendGenericNack(out, SMPPConstant.STAT_ESME_RINVBNDSTS, 10);%0A        %0A        %0A        DataInputStream in = new DataInputStream(new ByteArrayInputStream(out.toByteArray()));%0A        Command header = pduReader.readPDUHeader(in);%0A        assertEquals(header.getCommandId(), SMPPConstant.CID_GENERIC_NACK, %22Unexpected command_id%22);%0A        %0A        byte%5B%5D pdu = pduReader.readPDU(in, header);%0A        GenericNack nack = decomposer.genericNack(pdu);%0A        assertNotNull(nack);%0A    %7D%0A    %0A%7D%0A

Add test case for composing and decomposing trough pduSender