@@ -0,0 +1,2394 @@
+/*%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.util;%0A%0Aimport static org.testng.Assert.assertEquals;%0Aimport static org.testng.Assert.assertTrue;%0A%0Aimport org.jsmpp.PDUStringException;%0Aimport org.testng.annotations.Test;%0A%0A/**%0A * @author uudashr%0A *%0A */%0Apublic class OctetStringValidationTest %7B%0A    private static final String FULL_LENGTH_TEXT = %22Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor%22;%0A    private static final int MAX_SHORT_MESSAGE_LENGTH = 254;%0A    %0A    @Test%0A    public void zeroLength() throws Exception %7B%0A        String shortMessage = %22%22;%0A        assertEquals(shortMessage.length(), 0);%0A        StringValidator.validateString(shortMessage.getBytes(), StringParameter.SHORT_MESSAGE);%0A    %7D%0A    %0A    @Test%0A    public void nonZeroBelow255Length() throws Exception %7B%0A        String shortMessage = %22This is a simple message%22;%0A        assertTrue(shortMessage.length() %3E 0);%0A        assertTrue(shortMessage.length() %3C= MAX_SHORT_MESSAGE_LENGTH);%0A        StringValidator.validateString(shortMessage.getBytes(), StringParameter.SHORT_MESSAGE);%0A    %7D%0A    %0A    %0A    %0A    @Test%0A    public void fullLegth() throws Exception %7B%0A        assertEquals(FULL_LENGTH_TEXT.length(), MAX_SHORT_MESSAGE_LENGTH);%0A        StringValidator.validateString(FULL_LENGTH_TEXT.getBytes(), StringParameter.SHORT_MESSAGE);%0A    %7D%0A    %0A    @Test(expectedExceptions = PDUStringException.class)%0A    public void overLengthText() throws Exception %7B%0A        String shortMessage = FULL_LENGTH_TEXT + %22 %22;%0A        assertTrue(shortMessage.length() %3E MAX_SHORT_MESSAGE_LENGTH);%0A        StringValidator.validateString(shortMessage.getBytes(), StringParameter.SHORT_MESSAGE);%0A    %7D%0A%7D%0A

Add new test case for OctetString validation