Keel 2.1RC2

org.apache.log.output.test
Class OutputTargetTestCase

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byorg.apache.log.output.test.OutputTargetTestCase
All Implemented Interfaces:
junit.framework.Test

public final class OutputTargetTestCase
extends junit.framework.TestCase

Test suite for the formatters. TODO: Incorporate testing for ContextStack and ContextMap

Author:

Field Summary
private static RawFormatter FORMATTER
           
private static java.lang.String HEAD
           
private  java.io.File m_logFile
           
private static java.lang.String M1
           
private static java.lang.String M2
           
private static java.lang.String M3
           
private static java.lang.String OUTPUT
           
private static java.lang.String R1
           
private static java.lang.String R2
           
private static java.lang.String R3
           
private static java.lang.String TAIL
           
 
Fields inherited from class junit.framework.TestCase
 
Constructor Summary
OutputTargetTestCase(java.lang.String name)
           
 
Method Summary
private  Logger doStreamOutputTest(java.io.ByteArrayOutputStream output, LogTarget target)
           
private  void doStreamTest(java.io.ByteArrayOutputStream output, AbstractOutputTarget target)
           
private  java.lang.String getFileContents(java.io.File file)
           
private  Logger getNewLogger(LogTarget target)
           
private  java.lang.String getResult(java.io.ByteArrayOutputStream output)
           
 void testFileTarget()
           
 void testMemoryTarget1()
          Test that MemoryTarget triggers on buffer size hit.
 void testMemoryTarget2()
          Test that MemoryTarget triggers on priority correctly.
 void testMemoryTarget3()
          Test that MemoryTarget triggers on priority correctly.
 void testSafeFileTarget()
           
 void testStreamTarget()
           
 void testWriterTarget()
           
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, name, run, run, runBare, runTest, setName, setUp, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assert, assert, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertNotNull, assertNotNull, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

M1

private static java.lang.String M1

M2

private static java.lang.String M2

M3

private static java.lang.String M3

HEAD

private static java.lang.String HEAD

TAIL

private static java.lang.String TAIL

R1

private static java.lang.String R1

R2

private static java.lang.String R2

R3

private static java.lang.String R3

OUTPUT

private static java.lang.String OUTPUT

FORMATTER

private static RawFormatter FORMATTER

m_logFile

private final java.io.File m_logFile
Constructor Detail

OutputTargetTestCase

public OutputTargetTestCase(java.lang.String name)
                     throws java.io.IOException
Method Detail

getResult

private java.lang.String getResult(java.io.ByteArrayOutputStream output)

testStreamTarget

public void testStreamTarget()
                      throws java.lang.Exception
Throws:
java.lang.Exception

testWriterTarget

public void testWriterTarget()
                      throws java.lang.Exception
Throws:
java.lang.Exception

testFileTarget

public void testFileTarget()
                    throws java.lang.Exception
Throws:
java.lang.Exception

testSafeFileTarget

public void testSafeFileTarget()
                        throws java.lang.Exception
Throws:
java.lang.Exception

testMemoryTarget1

public void testMemoryTarget1()
                       throws java.lang.Exception
Test that MemoryTarget triggers on buffer size hit.

Throws:
java.lang.Exception - if an error occurs

testMemoryTarget2

public void testMemoryTarget2()
                       throws java.lang.Exception
Test that MemoryTarget triggers on priority correctly.

Throws:
java.lang.Exception - if an error occurs

testMemoryTarget3

public void testMemoryTarget3()
                       throws java.lang.Exception
Test that MemoryTarget triggers on priority correctly.

Throws:
java.lang.Exception - if an error occurs

getNewLogger

private Logger getNewLogger(LogTarget target)

getFileContents

private java.lang.String getFileContents(java.io.File file)
                                  throws java.io.IOException
Throws:
java.io.IOException

doStreamOutputTest

private Logger doStreamOutputTest(java.io.ByteArrayOutputStream output,
                                  LogTarget target)

doStreamTest

private void doStreamTest(java.io.ByteArrayOutputStream output,
                          AbstractOutputTarget target)

Keel 2.1RC2

Please see keelframework.org for information about new Keel releases.