01: /*
02: * Copyright (C) The DNA Group. All rights reserved.
03: *
04: * This software is published under the terms of the DNA
05: * Software License version 1.1, a copy of which has been included
06: * with this distribution in the LICENSE.txt file.
07: */
08: package org.codehaus.dna.impl;
09:
10: import org.apache.log4j.Appender;
11: import org.apache.log4j.Layout;
12: import org.apache.log4j.Level;
13: import org.apache.log4j.spi.ErrorHandler;
14: import org.apache.log4j.spi.Filter;
15: import org.apache.log4j.spi.LoggingEvent;
16: import org.apache.log4j.spi.ThrowableInformation;
17:
18: class MockAppender implements Appender {
19: boolean m_output;
20: Level m_priority;
21: String m_message;
22: Throwable m_throwable;
23:
24: public void doAppend(LoggingEvent event) {
25: m_output = true;
26: m_priority = event.getLevel();
27: m_message = (String) event.getMessage();
28: final ThrowableInformation information = event
29: .getThrowableInformation();
30: if (null != information) {
31: m_throwable = information.getThrowable();
32: }
33: }
34:
35: public void addFilter(Filter filter) {
36: }
37:
38: public Filter getFilter() {
39: return null;
40: }
41:
42: public void clearFilters() {
43: }
44:
45: public void close() {
46: }
47:
48: public String getName() {
49: return null;
50: }
51:
52: public void setErrorHandler(ErrorHandler errorHandler) {
53: }
54:
55: public ErrorHandler getErrorHandler() {
56: return null;
57: }
58:
59: public void setLayout(Layout layout) {
60: }
61:
62: public Layout getLayout() {
63: return null;
64: }
65:
66: public void setName(String classname) {
67: }
68:
69: public boolean requiresLayout() {
70: return false;
71: }
72: }
|