001    package org.hackystat.utilities.logger;
002    
003    import static org.junit.Assert.assertEquals;
004    import java.util.logging.Logger;
005    import org.junit.Test;
006    
007    /**
008     * Tests the HackystatLogger class.
009     * 
010     * @author Philip Johnson
011     */
012    
013    public class TestHackystatLogger {
014    
015      /**
016       * Tests the logger. Instantiates the logger and writes a test message.
017       * 
018       */
019      @Test
020      public void testLogging() {
021        Logger logger = HackystatLogger.getLogger("org.hackystat.utilities.testlogger");
022        logger.fine("(Test message)");
023        logger = HackystatLogger.getLogger("org.hackystat.nestedlogger.test", "testlogging");
024        HackystatLogger.setLoggingLevel(logger, "FINE");
025        logger.fine("(Test message2)");
026        assertEquals("Checking identity", "org.hackystat.nestedlogger.test", logger.getName());
027      }
028    }