1   /*
2    * Copyright (c) 2003 Caltha Sp.J., All rights reserved
3    * 
4    * Created on Dec 3, 2003
5    */
6   package org.objectledge.logging;
7   
8   import junit.framework.TestCase;
9   
10  import org.apache.log4j.Logger;
11  import org.objectledge.configuration.ConfigurationFactory;
12  import org.objectledge.filesystem.ClasspathFileSystemProvider;
13  import org.objectledge.filesystem.FileSystem;
14  import org.objectledge.filesystem.FileSystemProvider;
15  import org.objectledge.filesystem.LocalFileSystemProvider;
16  import org.objectledge.utils.TracingException;
17  import org.objectledge.xml.XMLGrammarCache;
18  import org.objectledge.xml.XMLValidator;
19  
20  /***
21   *
22   *
23   * @author <a href="Rafal.Krzewski">rafal@caltha.pl</a>
24   * @version $Id: LoggingConfiguratorTest.java,v 1.13 2004/06/25 12:55:37 fil Exp $
25   */
26  public class LoggingConfiguratorTest extends TestCase
27  {
28  
29      /***
30       * Constructor for LoggingConfiguratorTest.
31       * @param arg0
32       */
33      public LoggingConfiguratorTest(String arg0)
34      {
35          super(arg0);
36      }
37  
38      public void testConfigurator()
39          throws Exception
40      {
41          FileSystemProvider lfs = new LocalFileSystemProvider("local", "src/test/resources");
42          FileSystemProvider cfs = new ClasspathFileSystemProvider("classpath", 
43              getClass().getClassLoader());
44          FileSystem fs = new FileSystem(new FileSystemProvider[] { lfs, cfs }, 4096, 4096);
45          XMLValidator xv = new XMLValidator(new XMLGrammarCache());
46          ConfigurationFactory cf = new ConfigurationFactory(fs, xv, "config");
47          new LoggingConfigurator(cf, fs);    
48          Logger logger = Logger.getLogger(LoggingConfiguratorTest.class);
49          logger.debug("Yipee!");
50          logger.error("tracing", new TracingException(4));
51      }
52  }