@@ -0,0 +1,2243 @@
+package org.jsmpp.util;%0Aimport static org.testng.Assert.assertEquals;%0A%0Aimport org.testng.annotations.BeforeMethod;%0Aimport org.testng.annotations.Test;%0A/**%0A * @author uudashr%0A *%0A */%0Apublic class PDUByteBufferTest %7B%0A    private static final int BYTE_LENGTH = 1;%0A    private static final int INTEGER_LENGTH = 4;%0A    private static final int INITIAL_LENGTH = INTEGER_LENGTH;%0A    %0A    private PDUByteBuffer byteBuffer;%0A    %0A    @BeforeMethod%0A    public void setUp() %7B%0A        byteBuffer = new PDUByteBuffer(new DumbCapacityPolicy());%0A    %7D%0A    %0A    @Test(groups=%22checkintest%22)%0A    public void initialLengthValidity() %7B%0A        assertEquals(byteBuffer.toBytes().length, INITIAL_LENGTH);%0A    %7D%0A    %0A    @Test(groups=%22checkintest%22, dependsOnMethods=%22initialLengthValidity%22)%0A    public void testLengthValidityForIntAppends() %7B%0A        for (int i = 0; i %3C 5; i++) %7B%0A            byteBuffer.append(10);%0A            assertEquals(byteBuffer.toBytes().length, INITIAL_LENGTH + (INTEGER_LENGTH * (i + 1)), %22Failed on iteration %22 + i);%0A        %7D%0A    %7D%0A    %0A    @Test(groups=%22checkintest%22, dependsOnMethods=%22initialLengthValidity%22)%0A    public void testLengthValidityForByteAppends() %7B%0A        for (int i = 0; i %3C 5; i++) %7B%0A            byteBuffer.append((byte)10);%0A            assertEquals(byteBuffer.toBytes().length, INITIAL_LENGTH + (BYTE_LENGTH * (i + 1)), %22Failed on iteration %22 + i);%0A        %7D%0A    %7D%0A    %0A    @Test(groups=%22checkintest%22, dependsOnMethods=%22initialLengthValidity%22)%0A    public void testLengthValidityForCString() %7B%0A        String hello = %22PDUByteBuffer integration test for JSMPP API%22;%0A        for (int i = 0; i %3C 5; i++) %7B%0A            byteBuffer.append(hello);%0A            assertEquals(byteBuffer.toBytes().length, INITIAL_LENGTH + (hello.length() * (i + 1)) + (i + 1), %22Failed on iteration %22 + i);%0A        %7D%0A    %7D%0A    %0A    @Test(groups=%22checkintest%22, dependsOnMethods=%22initialLengthValidity%22)%0A    public void testLengthValidityForString() %7B%0A        String hello = %22PDUByteBuffer integration test for JSMPP API%22;%0A        for (int i = 0; i %3C 5; i++) %7B%0A            byteBuffer.append(hello, false);%0A            assertEquals(byteBuffer.toBytes().length, INITIAL_LENGTH + (hello.length() * (i + 1)), %22Failed on iteration %22 + i);%0A        %7D%0A    %7D%0A%7D%0A

Add unit test for PDUByteBuffer