Code example for LogManager

Methods: addLoggergetLogger

0
     */ 
    public void testGetLogger_hierarchy() throws Exception { 
        // test hierarchy 
        Logger foo = new MockLogger("testGetLogger_hierachy.foo", null);
        // but for non-mock LogManager, foo's parent should be root 
        assertTrue(manager.addLogger(foo));
        assertSame(manager.getLogger(""), manager.getLogger("testGetLogger_hierachy.foo")
                .getParent());
    } 
 
    /* 
     * test for method public Logger getLogger(String name) 
     */ 
    public void testGetLogger_nameSpace() throws Exception { 
        // test name with space 
        Logger foo = new MockLogger(FOO, null);
        Logger fooBeforeSpace = new MockLogger(FOO + " ", null);
        Logger fooAfterSpace = new MockLogger(" " + FOO, null);
        Logger fooWithBothSpace = new MockLogger(" " + FOO + " ", null);
        assertTrue(mockManager.addLogger(foo));