Code example for LogRecord

Methods: getLevel, setLevel

0
        long after = lr2.getMillis();
        assertTrue(after-before>0);
    } 
 
    public void testGetSetLevelNormal() { 
        assertSame(lr.getLevel(), Level.CONFIG);
        lr.setLevel(Level.ALL);
        assertSame(lr.getLevel(), Level.ALL);
        lr.setLevel(Level.FINEST);
        assertSame(lr.getLevel(), Level.FINEST);
    } 
 
    public void testGetSetThreadID_DifferentThread() { 
        lr.getThreadID();
        // Create and start the thread 
        MockThread thread = new MockThread();
        thread.start();
        try { 
            thread.join();
        } catch (InterruptedException e) {
            e.printStackTrace();