/*
 * 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.nt;
import junit.framework.TestCase;
import org.apache.log4j.Logger;
import org.apache.log4j.LogManager;
import org.apache.log4j.Level;
import org.apache.log4j.BasicConfigurator;


/**
 *
 * NTEventLogAppender tests.
 *
 * @author Curt Arnold
 */
public class NTEventLogAppenderTest extends TestCase {

  /**
   *   Clean up configuration after each test.
   */
  public void tearDown() {
    LogManager.shutdown();
  }

  /**
   *   Simple test of NTEventLogAppender.
   */
  public void testSimple() {
    BasicConfigurator.configure(new NTEventLogAppender());
    Logger logger = Logger.getLogger("org.apache.log4j.nt.NTEventLogAppenderTest");
    int i  = 0;
    logger.debug( "Message " + i++);
    logger.info( "Message " + i++);
    logger.warn( "Message " + i++);
    logger.error( "Message " + i++);
    logger.log(Level.FATAL, "Message " + i++);
    logger.debug("Message " + i++,  new Exception("Just testing."));
  }
}

@@ -832,39 +832,50 @@
 nt;%0A
+%0A
 import 
-junit.framework.TestCase
+org.apache.log4j.BasicConfigurator
 ;%0Aim
@@ -897,21 +897,20 @@
 .log4j.L
-ogger
+evel
 ;%0Aimport
@@ -956,36 +956,37 @@
 g.apache.log4j.L
-evel
+ogger
 ;%0Aimport org.apa
@@ -986,40 +986,68 @@
 org.
-apache.log4j.BasicConfigurator;%0A
+junit.After;%0Aimport org.junit.Ignore;%0Aimport org.junit.Test;
 %0A%0A/*
@@ -1110,16 +1110,24 @@
 old%0A */%0A
+@Ignore%0A
 public c
@@ -1158,40 +1158,19 @@
 est 
-extends TestCase 
 %7B%0A%0A
-  
+%09
 /**%0A
-   *  
+%09 *
  Cle
@@ -1206,24 +1206,30 @@
 h test.%0A
-  
+%09
  */%0A
-  
+%09@After%0A%09
 public v
@@ -1245,20 +1245,18 @@
 own() %7B%0A
-    
+%09%09
 LogManag
@@ -1274,25 +1274,20 @@
 ();%0A
-  %7D%0A%0A  
+%09%7D%0A%0A%09
 /**%0A
-   *  
+%09 *
  Sim
@@ -1322,16 +1322,21 @@
 er.%0A
-  
+%09
  */%0A
-  
+%09@Test%0A%09
 publ
@@ -1358,20 +1358,18 @@
 ple() %7B%0A
-    
+%09%09
 BasicCon
@@ -1415,20 +1415,18 @@
 der());%0A
-    
+%09%09
 Logger l
@@ -1501,28 +1501,23 @@
 %22);%0A
-    
+%09%09
 int i 
- 
 = 0;%0A
-    
+%09%09
 logg
@@ -1525,17 +1525,16 @@
 r.debug(
- 
 %22Message
@@ -1540,28 +1540,26 @@
 e %22 + i++);%0A
-    
+%09%09
 logger.info(
@@ -1558,17 +1558,16 @@
 er.info(
- 
 %22Message
@@ -1573,28 +1573,26 @@
 e %22 + i++);%0A
-    
+%09%09
 logger.warn(
@@ -1591,17 +1591,16 @@
 er.warn(
- 
 %22Message
@@ -1606,28 +1606,26 @@
 e %22 + i++);%0A
-    
+%09%09
 logger.error
@@ -1625,17 +1625,16 @@
 r.error(
- 
 %22Message
@@ -1640,28 +1640,26 @@
 e %22 + i++);%0A
-    
+%09%09
 logger.log(L
@@ -1689,20 +1689,18 @@
 + i++);%0A
-    
+%09%09
 logger.d
@@ -1721,17 +1721,16 @@
 %22 + i++,
- 
  new Exc
@@ -1755,14 +1755,13 @@
 ng.%22));%0A
-  
+%09
 %7D%0A%7D%0A

disable NTEventLogAppenderTest