/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.log4j.net;

import junit.framework.TestCase;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.apache.log4j.spi.LoggingEvent;
import org.apache.log4j.spi.TriggeringEventEvaluator;
import org.apache.log4j.xml.DOMConfigurator;

/**
 * Tests for SMTPAppender.
 */
public class SMTPAppenderTest extends TestCase {
    public SMTPAppenderTest(final String testName) {
        super(testName);
    }

    /**
     * Reset configuration after every test.
     */
  public void tearDown() {
      LogManager.resetConfiguration();
  }

    /**
     * Trivial implementation of TriggeringEventEvaluator.
     */
  public static final class MockTriggeringEventEvaluator implements TriggeringEventEvaluator {
        /**
         * {@inheritDoc}
         */
      public boolean isTriggeringEvent(final LoggingEvent event) {
          return true;
      }
  }

    /**
     * Tests that triggeringPolicy element will set evaluator.
     */
  public void testTrigger() {
      DOMConfigurator.configure("input/xml/smtpAppender1.xml");
      SMTPAppender appender = (SMTPAppender) Logger.getRootLogger().getAppender("A1");
      TriggeringEventEvaluator evaluator = appender.getEvaluator();
      assertTrue(evaluator instanceof MockTriggeringEventEvaluator);
  }
}

@@ -838,34 +838,108 @@
 ort 
-junit.framework.TestCas
+static org.apache.log4j.TestContants.TEST_INPUT_PREFIX;%0Aimport static org.junit.Assert.assertTru
 e;%0A
+%0A
 impo
@@ -1142,16 +1142,63 @@
 gurator;
+%0Aimport org.junit.After;%0Aimport org.junit.Test;
 %0A%0A/**%0A *
@@ -1260,124 +1260,17 @@
 est 
-extends TestCase %7B%0A    public SMTPAppenderTest(final String testName) %7B%0A        super(testName);%0A    %7D%0A%0A    /**%0A    
+%7B%0A%0A%09/**%0A%09
  * R
@@ -1306,26 +1306,30 @@
 y test.%0A
-     */%0A  
+%09 */%0A%09@After%0A%09
 public v
@@ -1345,22 +1345,18 @@
 own() %7B%0A
-      
+%09%09
 LogManag
@@ -1380,33 +1380,26 @@
 tion();%0A
-  %7D%0A%0A    /**%0A    
+%09%7D%0A%0A%09/**%0A%09
  * Trivi
@@ -1441,34 +1441,30 @@
 tEvaluator.%0A
-    
+%09
  */%0A
-  
+%09
 public stati
@@ -1548,63 +1548,41 @@
 r %7B%0A
-        /**%0A         * %7B@inheritDoc%7D%0A         */%0A      
+%09%09/**%0A%09%09 * %7B@inheritDoc%7D%0A%09%09 */%0A%09%09
 publ
@@ -1642,18 +1642,11 @@
 ) %7B%0A
-          
+%09%09%09
 retu
@@ -1658,33 +1658,22 @@
 ue;%0A
-      %7D%0A  %7D%0A%0A    /**%0A    
+%09%09%7D%0A%09%7D%0A%0A%09/**%0A%09
  * T
@@ -1731,18 +1731,21 @@
 or.%0A
-     */%0A  
+%09 */%0A%09@Test%0A%09
 publ
@@ -1768,22 +1768,18 @@
 ger() %7B%0A
-      
+%09%09
 DOMConfi
@@ -1800,15 +1800,29 @@
 ure(
-%22input/
+TEST_INPUT_PREFIX + %22
 xml/
@@ -1842,22 +1842,18 @@
 .xml%22);%0A
-      
+%09%09
 SMTPAppe
@@ -1925,22 +1925,18 @@
 (%22A1%22);%0A
-      
+%09%09
 Triggeri
@@ -1989,22 +1989,18 @@
 ator();%0A
-      
+%09%09
 assertTr
@@ -2054,14 +2054,13 @@
 uator);%0A
-  
+%09
 %7D%0A%7D%0A

fix SMTPAppenderTest