org.jcoderz.commons.util
Class StringUtilTest

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

public class StringUtilTest
extends TestCase

Tests the StringUtil class.

Author:
Andreas Mandel

Constructor Summary
StringUtilTest()
           
 
Method Summary
 void testAsciiToString()
          testAsciiBytesToString with valid argument.
 void testAsciiToStringNull()
          testAsciiBytesToString with null argument.
 void testAsciiToStringWithNonAsciiChars()
          Tests the StringUtil.asciiToString(byte[]) with non ASCII characters.
 void testContains()
          Tests the method StringUtil.contains(String, String).
 void testEquals()
          Tests the method StringUtil.equals(String, String).
 void testFitToLength()
          Tests the method StringUtil.fitToLength(String, int, int).
 void testIsAscii()
          Tests the method StringUtil.isAscii(char).
 void testIsEmptyOrNull()
          Tests the method StringUtil.isEmptyOrNull(String).
 void testIsNullOrBlank()
          Tests the method StringUtil.isNullOrBlank(String).
 void testIsNullOrEmpty()
          Tests the method StringUtil.isNullOrEmpty(String).
 void testPadLeft()
          Tests the method StringUtil.padLeft(String, char, int).
 void testToString()
          test bytesToString with valid argument.
 void testToStringNull()
          testAsciiBytesToString with null argument.
 void testToStringUmlaute()
          test umlauteBytesToString with valid argument.
 void testTrimLeft()
          Tests the method StringUtil.trimLengthLeft(String, int).
 
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

StringUtilTest

public StringUtilTest()
Method Detail

testAsciiToStringNull

public void testAsciiToStringNull()
testAsciiBytesToString with null argument.


testAsciiToString

public void testAsciiToString()
testAsciiBytesToString with valid argument.


testAsciiToStringWithNonAsciiChars

public void testAsciiToStringWithNonAsciiChars()
Tests the StringUtil.asciiToString(byte[]) with non ASCII characters.


testToStringNull

public void testToStringNull()
testAsciiBytesToString with null argument.


testToString

public void testToString()
test bytesToString with valid argument.


testToStringUmlaute

public void testToStringUmlaute()
test umlauteBytesToString with valid argument.


testIsAscii

public void testIsAscii()
Tests the method StringUtil.isAscii(char).


testIsNullOrEmpty

public void testIsNullOrEmpty()
Tests the method StringUtil.isNullOrEmpty(String).


testIsEmptyOrNull

public void testIsEmptyOrNull()
Tests the method StringUtil.isEmptyOrNull(String).


testIsNullOrBlank

public void testIsNullOrBlank()
Tests the method StringUtil.isNullOrBlank(String).


testEquals

public void testEquals()
Tests the method StringUtil.equals(String, String).


testFitToLength

public void testFitToLength()
                     throws Exception
Tests the method StringUtil.fitToLength(String, int, int).

Throws:
Exception - in case of an unexpected error.

testTrimLeft

public void testTrimLeft()
Tests the method StringUtil.trimLengthLeft(String, int).


testPadLeft

public void testPadLeft()
Tests the method StringUtil.padLeft(String, char, int).


testContains

public void testContains()
Tests the method StringUtil.contains(String, String).



Copyright 2007 The jCoderZ Project.