logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rpo...@apache.org
Subject svn commit: r1557643 - in /logging/log4j/log4j2/trunk/log4j-api/src: main/java/org/apache/logging/log4j/spi/LoggerStream.java test/java/org/apache/logging/log4j/LoggerTest.java test/java/org/apache/logging/log4j/spi/LoggerStreamTest.java
Date Mon, 13 Jan 2014 02:24:34 GMT
Author: rpopma
Date: Mon Jan 13 02:24:33 2014
New Revision: 1557643

URL: http://svn.apache.org/r1557643
Log:
removed dead code, author tag and improved JUnit test

Modified:
    logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/spi/LoggerStream.java
    logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/LoggerTest.java
    logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/spi/LoggerStreamTest.java

Modified: logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/spi/LoggerStream.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/spi/LoggerStream.java?rev=1557643&r1=1557642&r2=1557643&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/spi/LoggerStream.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/spi/LoggerStream.java
Mon Jan 13 02:24:33 2014
@@ -269,15 +269,6 @@ public class LoggerStream extends PrintS
             }
         }
 
-        private int lastIndexOf(int b) {
-            for (int i = count - 1; i >= 0; --i) {
-                if (buf[i] == b) {
-                    return i;
-                }
-            }
-            return -1;
-        }
-
         @Override
         public synchronized void write(int b) {
             if (b == '\r') {

Modified: logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/LoggerTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/LoggerTest.java?rev=1557643&r1=1557642&r2=1557643&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/LoggerTest.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/LoggerTest.java
Mon Jan 13 02:24:33 2014
@@ -16,6 +16,13 @@
  */
 package org.apache.logging.log4j;
 
+import static org.hamcrest.CoreMatchers.*;
+import static org.junit.Assert.*;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Locale;
+
 import org.apache.logging.log4j.message.ParameterizedMessageFactory;
 import org.apache.logging.log4j.message.StringFormatterMessageFactory;
 import org.apache.logging.log4j.message.StructuredDataMessage;
@@ -23,13 +30,6 @@ import org.apache.logging.log4j.spi.Logg
 import org.junit.Before;
 import org.junit.Test;
 
-import java.util.Date;
-import java.util.List;
-import java.util.Locale;
-
-import static org.hamcrest.CoreMatchers.startsWith;
-import static org.junit.Assert.*;
-
 /**
  *
  */
@@ -243,13 +243,15 @@ public class LoggerTest {
         stream.println("Debug message 1");
         stream.print("Debug message 2");
         stream.println();
-        stream.println();
+        stream.println(); // verify blank log message
         stream.print("Debug message 3\n");
-        assertEquals(4, results.size());
+        stream.print("\r\n"); // verify windows EOL works
+        assertEquals(5, results.size());
         assertThat("Incorrect message", results.get(0), startsWith(" DEBUG Debug message
1"));
         assertThat("Incorrect message", results.get(1), startsWith(" DEBUG Debug message
2"));
-        assertEquals("Message should be blank-ish", results.get(2), " DEBUG ");
+        assertEquals("Message should be blank-ish", " DEBUG ", results.get(2));
         assertThat("Incorrect message", results.get(3), startsWith(" DEBUG Debug message
3"));
+        assertEquals("Message should be blank-ish", " DEBUG ", results.get(4));
     }
 
     @Test

Modified: logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/spi/LoggerStreamTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/spi/LoggerStreamTest.java?rev=1557643&r1=1557642&r2=1557643&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/spi/LoggerStreamTest.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/spi/LoggerStreamTest.java
Mon Jan 13 02:24:33 2014
@@ -32,10 +32,6 @@ import java.util.List;
 import static org.hamcrest.core.StringStartsWith.startsWith;
 import static org.junit.Assert.*;
 
-/**
- * @author msicker
- * @version 1.0.0
- */
 @RunWith(Parameterized.class)
 public class LoggerStreamTest {
     private List<String> results;



Mime
View raw message