Package org.jzonic.jlo.formatter

Source Code of org.jzonic.jlo.formatter.SimpleFormatterTest

/*
* SimpleFormatterTest.java
* JUnit based test
*
* Created on 21. Januar 2003, 23:06
*/

package org.jzonic.jlo.formatter;

import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.jzonic.jlo.LogRecord;
import org.jzonic.jlo.Target;

import java.util.HashMap;
import java.util.Map;

/**
*
* @author Administrator
*/
public class SimpleFormatterTest extends TestCase {
   
    public SimpleFormatterTest(java.lang.String testName) {
        super(testName);
    }
   
    public static void main(java.lang.String[] args) {
        junit.textui.TestRunner.run(suite());
    }
   
    public static Test suite() {
        TestSuite suite = new TestSuite(SimpleFormatterTest.class);
        return suite;
    }
   
    public void testFormat() {
        LogRecord lr = new LogRecord("Test",Target.trace);
        SimpleFormatter sf = new SimpleFormatter("Test");
        String test = sf.formatMessage(lr);
        assertNotNull(test);
    }

    public void testFormat2() {
        LogRecord lr = new LogRecord("Test",Target.trace);
        SimpleFormatter sf = new SimpleFormatter("Test");
        Map params = new HashMap();
        params.put("date","dd.MM.yyyy");
        sf.setParameter(params);
        String test = sf.formatMessage(lr);
        assertNotNull(test);
        System.out.println(test);
    }


}
TOP

Related Classes of org.jzonic.jlo.formatter.SimpleFormatterTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.