1 /*
2 * File: JDK14LoggerTest.java
3 * Date: Oct 29, 2003
4 */
5 package com.rhi.architecture.logging;
6
7 import com.rhi.architecture.resource.InitializationException;
8
9 import java.util.*;
10
11 import junit.framework.*;
12
13 /***
14 * JDK14LoggerTest
15 *
16 * @author <a href="mailto:pete_mckinstry@yahoo.com">Pete McKinstry</a>
17 * @copyright 2003, All rights reserved.
18 */
19 public class JDK14LoggerTest extends TestCase {
20
21 private static Logger logger;
22
23 /***
24 * Constructor for JDK14LoggerTest.
25 * @param arg0
26 */
27 public JDK14LoggerTest(String arg0) {
28 super(arg0);
29 }
30
31 /***
32 * Create & initialize the logger
33 * @throws Exception
34 */
35 protected void setUp() throws Exception {
36 // settings.
37 Properties props = new Properties();
38
39 // logger
40 try {
41 logger = new JDK14Logger();
42 logger.init( props );
43 }
44 catch (InitializationException e) {
45 System.err.println("Exception = " + e );
46 e.printStackTrace(System.err);
47 fail("failed to initalize Logger. e = " + e);
48 }
49 }
50
51
52 /***
53 * Shutdown the logger
54 * @throws Exception
55 */
56 protected void tearDown() throws Exception {
57 logger.close();
58 logger = null;
59 }
60
61 /***
62 *
63 * @throws Exception
64 */
65 public void testFatal() throws Exception {
66 logger.fatal("fatal message");
67 }
68
69 /***
70 *
71 * @throws Exception
72 */
73 public void testError() throws Exception {
74 logger.error("error message");
75 }
76
77 /***
78 *
79 * @throws Exception
80 */
81 public void testInfo() throws Exception {
82 logger.info("info message");
83 }
84
85 /***
86 *
87 * @throws Exception
88 */
89 public void testDebug() throws Exception {
90 logger.debug("debug message");
91 }
92
93 /***
94 *
95 * @throws Exception
96 */
97 public void testTrace() throws Exception {
98 logger.trace("trace message");
99 }
100
101 /***
102 * main()
103 * @param args
104 */
105 public static void main(String[] args) {
106 junit.textui.TestRunner.run(JDK14LoggerTest.class);
107 }
108
109 }
This page was automatically generated by Maven