logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mwom...@apache.org
Subject svn commit: r372095 - in /logging/log4j/trunk/tests: input/watchdog/watchdog.FileWatchdog.test1_1.xml input/watchdog/watchdog.FileWatchdog.test2_1.properties src/java/org/apache/log4j/watchdog/FileWatchdogTestCase.java
Date Wed, 25 Jan 2006 03:59:38 GMT
Author: mwomack
Date: Tue Jan 24 19:59:36 2006
New Revision: 372095

URL: http://svn.apache.org/viewcvs?rev=372095&view=rev
Log:
Updated test case to function properly

Modified:
    logging/log4j/trunk/tests/input/watchdog/watchdog.FileWatchdog.test1_1.xml
    logging/log4j/trunk/tests/input/watchdog/watchdog.FileWatchdog.test2_1.properties
    logging/log4j/trunk/tests/src/java/org/apache/log4j/watchdog/FileWatchdogTestCase.java

Modified: logging/log4j/trunk/tests/input/watchdog/watchdog.FileWatchdog.test1_1.xml
URL: http://svn.apache.org/viewcvs/logging/log4j/trunk/tests/input/watchdog/watchdog.FileWatchdog.test1_1.xml?rev=372095&r1=372094&r2=372095&view=diff
==============================================================================
--- logging/log4j/trunk/tests/input/watchdog/watchdog.FileWatchdog.test1_1.xml (original)
+++ logging/log4j/trunk/tests/input/watchdog/watchdog.FileWatchdog.test1_1.xml Tue Jan 24
19:59:36 2006
@@ -20,6 +20,10 @@
   <logger name="org.apache.log4j.watchdog.FileWatchdogTestCase">
     <level value="debug"/>
   </logger>
+
+  <logger name="org.apache.log4j.watchdog.FileWatchdog">
+    <level value="error"/>
+  </logger>
   
   <root>
     <appender-ref ref="A1" />	       

Modified: logging/log4j/trunk/tests/input/watchdog/watchdog.FileWatchdog.test2_1.properties
URL: http://svn.apache.org/viewcvs/logging/log4j/trunk/tests/input/watchdog/watchdog.FileWatchdog.test2_1.properties?rev=372095&r1=372094&r2=372095&view=diff
==============================================================================
--- logging/log4j/trunk/tests/input/watchdog/watchdog.FileWatchdog.test2_1.properties (original)
+++ logging/log4j/trunk/tests/input/watchdog/watchdog.FileWatchdog.test2_1.properties Tue
Jan 24 19:59:36 2006
@@ -11,3 +11,4 @@
 
 #log4j.logger.org.apache.log4j=WARN
 log4j.logger.org.apache.log4j.watchdog.FileWatchdogTestCase=DEBUG
+log4j.logger.org.apache.log4j.watchdog.FileWatchdog=ERROR

Modified: logging/log4j/trunk/tests/src/java/org/apache/log4j/watchdog/FileWatchdogTestCase.java
URL: http://svn.apache.org/viewcvs/logging/log4j/trunk/tests/src/java/org/apache/log4j/watchdog/FileWatchdogTestCase.java?rev=372095&r1=372094&r2=372095&view=diff
==============================================================================
--- logging/log4j/trunk/tests/src/java/org/apache/log4j/watchdog/FileWatchdogTestCase.java
(original)
+++ logging/log4j/trunk/tests/src/java/org/apache/log4j/watchdog/FileWatchdogTestCase.java
Tue Jan 24 19:59:36 2006
@@ -127,7 +127,7 @@
       // now watch the file for changes
       FileWatchdog watchdog = new FileWatchdog();
       watchdog.setFile(configFile.getAbsolutePath());
-      watchdog.setInterval(1000);
+      watchdog.setInterval(500);
       watchdog.setConfigurator(JoranConfigurator.class.getName());
       ((LoggerRepositoryEx) LogManager.getLoggerRepository()).getPluginRegistry().addPlugin(watchdog);
       watchdog.activateOptions();
@@ -139,13 +139,13 @@
       logger.error("error message");
       logger.fatal("fatal message");
 
-      Thread.sleep(2000);
       // copy over a new version of the config file
       copyFile(sourceFile2, configFile);
+      configFile.setLastModified(System.currentTimeMillis());
       
-      // wait a few seconds for the watchdog to react
-      for (int i = 0; i < 40; i++) {
-          Thread.sleep(500);
+      // wait until it appears the watchdog reacts to the file change
+      for (int i = 0; i < 20; i++) {
+          Thread.sleep(1000);
           if (logger.getLevel() == Level.INFO) {
               // output some test messages
               logger.debug("debug message");
@@ -189,7 +189,7 @@
       // now watch the file for changes
       FileWatchdog watchdog = new FileWatchdog();
       watchdog.setFile(configFile.getAbsolutePath());
-      watchdog.setInterval(1000);
+      watchdog.setInterval(500);
       watchdog.setConfigurator(PropertyConfigurator.class.getName());
       ((LoggerRepositoryEx) LogManager.getLoggerRepository()).getPluginRegistry().addPlugin(watchdog);
       watchdog.activateOptions();
@@ -201,13 +201,13 @@
       logger.error("error message");
       logger.fatal("fatal message");
 
-      Thread.sleep(2000);
       // copy over a new version of the config file
       copyFile(sourceFile2, configFile);
-      
+      configFile.setLastModified(System.currentTimeMillis());
+
       // wait a few seconds for the watchdog to react
-      for (int i = 0; i < 40; i++) {
-          Thread.sleep(500);
+      for (int i = 0; i < 20; i++) {
+          Thread.sleep(1000);
           if (logger.getLevel() == Level.INFO) {
             // output some test messages
             logger.debug("debug message");



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message