From: <kea...@na...> - 2003-04-03 16:50:47
|
I haven't made JUnit test case yet, but here's the simplest example I can cook up: import org.webmacro.*; public class WMLogTest { static public void main(String[] args) throws Exception { org.webmacro.Log log = null; WM wm = null; for (int i=1; i<4; i++){ wm = new WM("wm.properties"); log = wm.getLog("wm"); log.notice("Test message " + i); wm.destroy(); } } } You can see from the output below that "Test message 1" gets logged once, "Test message 2" get logged twice, etc. Keats 11:44:12 AM LogFile NOTICE --- Log Started --- 11:44:12 AM broker NOTICE starting org.webmacro.Broker: wm.properties 11:44:12 AM broker NOTICE Loaded settings from WebMacro.defaults, wm.properties, (System Properties) 11:44:12 AM wm NOTICE new WebMacro(wm.properties) v@VERSION@ 11:44:12 AM wm NOTICE Test message 1 11:44:12 AM broker NOTICE shutting down 11:44:12 AM LogFile NOTICE --- Log Started --- 11:44:12 AM broker NOTICE starting org.webmacro.Broker: wm.properties 11:44:12 AM broker NOTICE starting org.webmacro.Broker: wm.properties 11:44:12 AM broker NOTICE Loaded settings from WebMacro.defaults, wm.properties, (System Properties) 11:44:12 AM broker NOTICE Loaded settings from WebMacro.defaults, wm.properties, (System Properties) 11:44:12 AM wm NOTICE new WebMacro(wm.properties) v@VERSION@ 11:44:12 AM wm NOTICE new WebMacro(wm.properties) v@VERSION@ 11:44:12 AM wm NOTICE Test message 2 11:44:12 AM wm NOTICE Test message 2 11:44:12 AM broker NOTICE shutting down 11:44:12 AM broker NOTICE shutting down 11:44:12 AM LogFile NOTICE --- Log Started --- 11:44:12 AM broker NOTICE starting org.webmacro.Broker: wm.properties 11:44:12 AM broker NOTICE starting org.webmacro.Broker: wm.properties 11:44:12 AM broker NOTICE starting org.webmacro.Broker: wm.properties 11:44:12 AM broker NOTICE Loaded settings from WebMacro.defaults, wm.properties, (System Properties) 11:44:12 AM broker NOTICE Loaded settings from WebMacro.defaults, wm.properties, (System Properties) 11:44:12 AM broker NOTICE Loaded settings from WebMacro.defaults, wm.properties, (System Properties) 11:44:12 AM wm NOTICE new WebMacro(wm.properties) v@VERSION@ 11:44:12 AM wm NOTICE new WebMacro(wm.properties) v@VERSION@ 11:44:12 AM wm NOTICE new WebMacro(wm.properties) v@VERSION@ 11:44:12 AM wm NOTICE Test message 3 11:44:12 AM wm NOTICE Test message 3 11:44:12 AM wm NOTICE Test message 3 11:44:12 AM broker NOTICE shutting down 11:44:12 AM broker NOTICE shutting down 11:44:12 AM broker NOTICE shutting down |