logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From psm...@apache.org
Subject svn commit: r548865 - in /logging/sandbox/jul-to-log4j-bridge: pom.xml src/test/java/org/apache/log4j/jul/JULReceiverTest.java
Date Tue, 19 Jun 2007 22:07:30 GMT
Author: psmith
Date: Tue Jun 19 15:07:29 2007
New Revision: 548865

URL: http://svn.apache.org/viewvc?view=rev&rev=548865
Log:
Updated pom to reflect change in dependency version numbers.

For some reason one of the unit tests is still failing under maven, but not under eclipse.


Modified:
    logging/sandbox/jul-to-log4j-bridge/pom.xml
    logging/sandbox/jul-to-log4j-bridge/src/test/java/org/apache/log4j/jul/JULReceiverTest.java

Modified: logging/sandbox/jul-to-log4j-bridge/pom.xml
URL: http://svn.apache.org/viewvc/logging/sandbox/jul-to-log4j-bridge/pom.xml?view=diff&rev=548865&r1=548864&r2=548865
==============================================================================
--- logging/sandbox/jul-to-log4j-bridge/pom.xml (original)
+++ logging/sandbox/jul-to-log4j-bridge/pom.xml Tue Jun 19 15:07:29 2007
@@ -92,8 +92,8 @@
       <plugin>
         <artifactId>maven-compiler-plugin</artifactId>
         <configuration>
-            <source>1.3</source>
-            <target>1.3</target>
+            <source>1.4</source>
+            <target>1.4</target>
         </configuration>
       </plugin>
   <plugin> 
@@ -114,7 +114,7 @@
     <dependency>
       <groupId>log4j</groupId>
       <artifactId>log4j</artifactId>
-      <version>1.2.15</version>
+      <version>1.2.15-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>junit</groupId>
@@ -125,7 +125,7 @@
     <dependency>
       <groupId>log4j</groupId>
       <artifactId>apache-log4j-component</artifactId>
-      <version>0.1-SNAPSHOT</version>
+      <version>1.0-SNAPSHOT</version>
     </dependency>
   </dependencies>
   <reporting>

Modified: logging/sandbox/jul-to-log4j-bridge/src/test/java/org/apache/log4j/jul/JULReceiverTest.java
URL: http://svn.apache.org/viewvc/logging/sandbox/jul-to-log4j-bridge/src/test/java/org/apache/log4j/jul/JULReceiverTest.java?view=diff&rev=548865&r1=548864&r2=548865
==============================================================================
--- logging/sandbox/jul-to-log4j-bridge/src/test/java/org/apache/log4j/jul/JULReceiverTest.java
(original)
+++ logging/sandbox/jul-to-log4j-bridge/src/test/java/org/apache/log4j/jul/JULReceiverTest.java
Tue Jun 19 15:07:29 2007
@@ -17,12 +17,15 @@
 package org.apache.log4j.jul;
 
 import java.net.URL;
+import java.util.Iterator;
+import java.util.List;
 
 import org.apache.log4j.LogManager;
 import org.apache.log4j.Logger;
 import org.apache.log4j.LoggerRepositoryExImpl;
 import org.apache.log4j.plugins.PluginConfigurator;
 import org.apache.log4j.spi.LoggerRepository;
+import org.apache.log4j.spi.LoggingEvent;
 import org.apache.log4j.spi.RepositorySelector;
 import org.apache.logging.julbridge.MockAppender;
 
@@ -31,12 +34,13 @@
 public class JULReceiverTest extends TestCase {
 
     private final Object repositorySelectorGuard = new Object();
-    private MockAppender mockAppender = new MockAppender();
     final LoggerRepository repositoryExImpl = new LoggerRepositoryExImpl(LogManager
             .getLoggerRepository());
+    private MockAppender mockAppender;
 
     protected void setUp() throws Exception {
         super.setUp();
+        mockAppender = new MockAppender();
         LogManager.resetConfiguration();
         LogManager.setRepositorySelector(new RepositorySelector() {
 
@@ -57,8 +61,20 @@
         Logger.getRootLogger().addAppender(mockAppender);
         java.util.logging.Logger juliLogger = java.util.logging.Logger.getLogger("foo");
         juliLogger.info("boo");
-        assertEquals("Should have received 1 event: ", 1, mockAppender.observedLoggingEvents.size());
+        assertEquals("Should have received 1 event: " + convertToString(mockAppender.observedLoggingEvents),
1, mockAppender.observedLoggingEvents.size());
 
+    }
+
+    private String convertToString(List observedLoggingEvents) {
+        StringBuffer buf = new StringBuffer();
+        for (Iterator iterator = observedLoggingEvents.iterator(); iterator
+                .hasNext();) {
+            LoggingEvent event = (LoggingEvent) iterator.next();
+            buf.append("message:'").append(event.getMessage()).append("', ");
+            buf.append("timeStamp: ").append(event.getTimeStamp());
+            buf.append("logger:").append(event.getLevel());
+        }
+        return buf.toString();
     }
 
 }



---------------------------------------------------------------------
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