org.jcoderz.commons.util
Class HexUtilTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.jcoderz.commons.util.HexUtilTest
All Implemented Interfaces:
Test

public class HexUtilTest
extends TestCase

Tests the HexUtil class.

Author:
Albrecht Messner

Constructor Summary
HexUtilTest()
           
 
Method Summary
static void main(String[] args)
          Main method to run test stand-alone.
 void testBytesToHex()
          Tests the bytesToHex method of the HexUtil class.
 void testCrossCheck()
          Perform a cross check with the Integer.toHexString functionality.
 void testHexDump()
          Test the hexdump method and prints out the result for visual test.
 void testHexDump2()
          Test hexdump with sixteen bytes from 'a' to 'p'.
 void testHexDumpWithEmptyArray()
          Test hexdump with a zero-length byte array.
 void testHexDumpWithNull()
          Test hexdump with a null byte array.
 void testInvalidStrings()
          Tests a couple of invalid hex strings.
 void testNullAndEmpty()
          Test empty and null byte array.
 void testValidStrings()
          Tests a couple of valid hex strings.
 void testVariousBytes()
          Tests boundaries.
 void testWithRandomData()
          Test HexUtil with 10k of random data.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HexUtilTest

public HexUtilTest()
Method Detail

main

public static void main(String[] args)
Main method to run test stand-alone.

Parameters:
args - command line arguments

testBytesToHex

public void testBytesToHex()
Tests the bytesToHex method of the HexUtil class.


testVariousBytes

public void testVariousBytes()
Tests boundaries.


testCrossCheck

public void testCrossCheck()
Perform a cross check with the Integer.toHexString functionality.


testNullAndEmpty

public void testNullAndEmpty()
Test empty and null byte array.


testValidStrings

public void testValidStrings()
Tests a couple of valid hex strings.


testInvalidStrings

public void testInvalidStrings()
Tests a couple of invalid hex strings.


testWithRandomData

public void testWithRandomData()
Test HexUtil with 10k of random data.


testHexDump

public void testHexDump()
Test the hexdump method and prints out the result for visual test.


testHexDump2

public void testHexDump2()
Test hexdump with sixteen bytes from 'a' to 'p'.


testHexDumpWithEmptyArray

public void testHexDumpWithEmptyArray()
Test hexdump with a zero-length byte array.


testHexDumpWithNull

public void testHexDumpWithNull()
Test hexdump with a null byte array.



Copyright 2007 The jCoderZ Project.