KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > inversoft > savant > test > StringToolsTest


1 /*
2  * Copyright (c) 2003-2004, Inversoft, All Rights Reserved
3  *
4  * This software is distribuable under the GNU Lesser General Public License.
5  * For more information visit gnu.org.
6  */

7 package com.inversoft.savant.test;
8
9
10 import junit.framework.TestCase;
11
12 import com.inversoft.savant.StringTools;
13
14
15 /**
16  * <p>
17  * This class tests the string tools.
18  * </p>
19  *
20  * @author Brian Pontarelli
21  */

22 public class StringToolsTest extends TestCase {
23
24     /**
25      * Constructs a new <code>StringToolsTest</code>.
26      */

27     public StringToolsTest(String JavaDoc name) {
28         super(name);
29     }
30
31
32     public void testHexConvert() {
33         String JavaDoc value = "5f";
34         byte[] bytes = StringTools.fromHex(value);
35         assertEquals(1, bytes.length);
36         assertEquals(95, bytes[0]);
37
38         value = "5F";
39         bytes = StringTools.fromHex(value);
40         assertEquals(1, bytes.length);
41         assertEquals(95, bytes[0]);
42     }
43 }
Popular Tags