/*
 * Java SMPP API
 * Copyright (C) 1998 - 2002 by Oran Kelly
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 * 
 * A copy of the LGPL can be viewed at http://www.gnu.org/copyleft/lesser.html
 * Java SMPP API author: orank@users.sf.net
 * Java SMPP API Homepage: http://smppapi.sourceforge.net/
 *
 * $Id$
 */
package ie.omk.smpp.util;

import java.util.Arrays;

import junit.framework.TestCase;

public class EncodingTest extends TestCase {

    public EncodingTest(String s) {
	super (s);
    }

    public void testDefaultAlphabet() {
    }

    public void testASCIIEncoding() {
	// "Test message" in ASCII characters.
	byte[] msg_bytes = {
	    0x54, 0x65, 0x73, 0x74, 0x20, 0x6d, 0x65, 0x73, 0x73,
	    0x61, 0x67, 0x65
	};

	String msg = "Test message";

	ASCIIEncoding ae = ASCIIEncoding.getInstance();
	assertTrue(Arrays.equals(msg_bytes, ae.encodeString(msg)));
	assertEquals(msg, ae.decodeString(msg_bytes));
    }

    public void testLatinEncoding() {
	// "Test message" followed by:
	// Yen symbol
	// Pound sign (European interpretation, not what I would call a "hash").
	// Superscript 3
	// Latin capital letter AE
	byte[] msg_bytes = {
	    0x54, 0x65, 0x73, 0x74, 0x20, 0x6d, 0x65, 0x73, 0x73,
	    0x61, 0x67, 0x65, (byte)0xa5, (byte)0xa3, (byte)0xb3, (byte)0xc6
	};

	String msg = "Test message";

	Latin1Encoding enc = Latin1Encoding.getInstance();
	assertTrue(Arrays.equals(msg_bytes, enc.encodeString(msg)));
	assertEquals(msg, enc.decodeString(msg_bytes));
    }

    public void testUCS2Encoding() {
    }

    public void testBinaryEncoding() {
    }
}

@@ -2170,32 +2170,555 @@
 bytes));%0A    %7D%0A%0A
+    public void testHPRomanEncoding() %7B%0A%0A%09HPRoman8Encoding enc = HPRoman8Encoding.getInstance();%0A%0A%09// The full character table in a string..%0A%09String msg = %22 !%5C%22#$%25&,()*+,-./0123456789:;%3C=%3E?@ABCDEFGHIJKLMNOPQRS%22%0A%09    + %22TUVWXYZ%5B%5C%5C%5D%5E_%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D~%5Cu00a0%22%0A%09    + %22%5Cu00b4%5Cu0300%5Cu0302%5Cu00a8%5Cu0303%5Cu20a4%5Cu007e%22%0A%09    + %22%5Cu0192%22%0A%09    + %22%5Cu00be%5Cu00bc%5Cu00bd%5Cu25a0%22;%0A%0A%09byte%5B%5D b = enc.encodeString(msg);%0A%09String decStr = enc.decodeString(b);%0A%0A%09assertEquals(msg.length(), b.length);%0A%09assertEquals(msg, decStr);%0A    %7D%0A%0A
     public void 

Add HPRoman8 encoding test