FileDocCategorySizeDatePackage
SocketAppenderTest.javaAPI DocApache log4j 1.2.152934Sat Aug 25 00:09:34 BST 2007org.apache.log4j.net

SocketAppenderTest

public class SocketAppenderTest extends TestCase

Fields Summary
private static Logger
logger
private static Appender
primary
private static LastOnlyAppender
secondary
Constructors Summary
public SocketAppenderTest(String testName)
Create new instance.

	    super(testName);
    
Methods Summary
protected voidsetUp()

        DOMConfigurator.configure("input/xml/SocketAppenderTestConfig.xml");

        logger = Logger.getLogger(SocketAppenderTest.class);
        primary = logger.getAppender("remote");
        secondary = (LastOnlyAppender) Logger.getLogger(
                "org.apache.log4j.net.SocketAppenderTestDummy").getAppender("lastOnly");
    
protected voidtearDown()

    
public voidtestFallbackErrorHandlerWhenStarting()

        String msg = "testFallbackErrorHandlerWhenStarting";
        logger.debug(msg);

        // above debug log will fail and shoul be redirected to secondary appender
        assertEquals("SocketAppender with FallbackErrorHandler", msg, secondary.getLastMessage());