org.jcoderz.commons.logging
Class FormatTest

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

public class FormatTest
extends TestCase

This class is used for testing the various Formats, especially if they are symmetric, i.e. whether parsing the string of a formatted object delivers the object again.


Constructor Summary
FormatTest()
          Creates a new instance of this.
FormatTest(String name)
          Creates a new instance of this and sets the test case.
 
Method Summary
 void testCollectionFormat()
          Tests the collection format with string escape and fixe length sub formats.
 void testFixLengthFormat()
          Tests the fix length format.
 void testLogMessage()
          Tests formatting and parsing a complete log message with the standard formatters.
 void testLogRecord()
          Tests formatting and parsing a complete trace log record with the standard formatters.
 void testLogRecordWithMultiLineText()
          Tests formatting and parsing a complete trace log record with the standard formatters.
 void testStringEscapeFormat()
          Tests the string escape format.
 
Methods inherited from class org.jcoderz.commons.TestCase
getBaseDir, getHostName, getSuite, hasTestCases
 
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

FormatTest

public FormatTest()
Creates a new instance of this.


FormatTest

public FormatTest(String name)
Creates a new instance of this and sets the test case.

Parameters:
name - The name of the test case.
Method Detail

testStringEscapeFormat

public void testStringEscapeFormat()
Tests the string escape format. Formats and parses several strings using this format and fails if parsing fails or does not deliver a string equal to the source string.


testFixLengthFormat

public void testFixLengthFormat()
Tests the fix length format. Formats and parses several strings using this format and fails if parsing fails or does not deliver a string equal to the source string.


testLogRecord

public void testLogRecord()
Tests formatting and parsing a complete trace log record with the standard formatters. Fails if parsing of the formatted log record fails.


testLogRecordWithMultiLineText

public void testLogRecordWithMultiLineText()
Tests formatting and parsing a complete trace log record with the standard formatters. The log record contains a multi line text message. Fails if parsing of the formatted log record fails.


testLogMessage

public void testLogMessage()
Tests formatting and parsing a complete log message with the standard formatters. Fails if parsing of the formatted log record fails.


testCollectionFormat

public void testCollectionFormat()
Tests the collection format with string escape and fixe length sub formats. Formats and parses several collection of strings using these formats and fails if parsing fails or does not deliver a string list equal to the source list.



Copyright 2007 The jCoderZ Project.