KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jzonic > jlo > formatter > DefaultFormatterTest


1 /*
2  * SimpleFormatterTest.java
3  * JUnit based test
4  *
5  * Created on 21. Januar 2003, 23:06
6  */

7
8 package org.jzonic.jlo.formatter;
9
10 import junit.framework.Test;
11 import junit.framework.TestCase;
12 import junit.framework.TestSuite;
13 import org.jzonic.jlo.LogRecord;
14 import org.jzonic.jlo.Target;
15
16 /**
17  *
18  * @author Administrator
19  */

20 public class DefaultFormatterTest extends TestCase {
21     
22     public DefaultFormatterTest(java.lang.String JavaDoc testName) {
23         super(testName);
24     }
25     
26     public static void main(java.lang.String JavaDoc[] args) {
27         junit.textui.TestRunner.run(suite());
28     }
29     
30     public static Test suite() {
31         TestSuite suite = new TestSuite(DefaultFormatterTest.class);
32         return suite;
33     }
34     
35     public void testFormat() {
36         String JavaDoc test = help();
37         System.out.println(test);
38         assertNotNull("huhu",test);
39     }
40     
41     public String JavaDoc help() {
42         LogRecord lr = new LogRecord("Test",Target.trace);
43         DefaultFormatter df = new DefaultFormatter("Test");
44         String JavaDoc test = df.formatMessage(lr);
45         return test;
46     }
47     
48     
49 }
50
Popular Tags