Author: carnold
Date: Mon May 17 05:04:30 2010
New Revision: 944971

URL: http://svn.apache.org/viewvc?rev=944971&view=rev
Log:
Bug 48953: Unused imports and variables in test code cause gcj compile warnings

Modified:
    
logging/log4j/companions/extras/trunk/src/test/java/org/apache/log4j/EnhancedPatternLayoutTest.java
    
logging/log4j/companions/extras/trunk/src/test/java/org/apache/log4j/EnhancedPatternLayoutTestCase.java

Modified: 
logging/log4j/companions/extras/trunk/src/test/java/org/apache/log4j/EnhancedPatternLayoutTest.java
URL: 
http://svn.apache.org/viewvc/logging/log4j/companions/extras/trunk/src/test/java/org/apache/log4j/EnhancedPatternLayoutTest.java?rev=944971&r1=944970&r2=944971&view=diff
==============================================================================
--- 
logging/log4j/companions/extras/trunk/src/test/java/org/apache/log4j/EnhancedPatternLayoutTest.java
 (original)
+++ 
logging/log4j/companions/extras/trunk/src/test/java/org/apache/log4j/EnhancedPatternLayoutTest.java
 Mon May 17 05:04:30 2010
@@ -115,7 +115,7 @@ public class EnhancedPatternLayoutTest e
   /**
    * Class to ensure that protected members are still available.
    */
-  private static final class DerivedPatternLayout extends 
EnhancedPatternLayout {
+  public static final class DerivedPatternLayout extends EnhancedPatternLayout 
{
     /**
      * Constructs a new instance of DerivedPatternLayout.
      */

Modified: 
logging/log4j/companions/extras/trunk/src/test/java/org/apache/log4j/EnhancedPatternLayoutTestCase.java
URL: 
http://svn.apache.org/viewvc/logging/log4j/companions/extras/trunk/src/test/java/org/apache/log4j/EnhancedPatternLayoutTestCase.java?rev=944971&r1=944970&r2=944971&view=diff
==============================================================================
--- 
logging/log4j/companions/extras/trunk/src/test/java/org/apache/log4j/EnhancedPatternLayoutTestCase.java
 (original)
+++ 
logging/log4j/companions/extras/trunk/src/test/java/org/apache/log4j/EnhancedPatternLayoutTestCase.java
 Mon May 17 05:04:30 2010
@@ -30,6 +30,7 @@ import org.apache.log4j.util.RelativeTim
 import org.apache.log4j.util.SunReflectFilter;
 import org.apache.log4j.util.Transformer;
 import org.apache.log4j.util.MDCOrderFilter;
+import org.apache.log4j.spi.ThrowableInformation;
 
 import java.text.ParsePosition;
 import java.text.SimpleDateFormat;
@@ -563,6 +564,31 @@ public class EnhancedPatternLayoutTestCa
     root.debug("%throwable{none}, with exception", ex);
 
 
+    layout.setConversionPattern("%m%n%throwable{0}");
+    layout.activateOptions();
+    root.debug("%throwable{0}, no exception");
+    root.debug("%throwable{0}, with exception", ex);
+
+    layout.setConversionPattern("%m%n%throwable{1}");
+    layout.activateOptions();
+    root.debug("%throwable{1}, no exception");
+    root.debug("%throwable{1}, with exception", ex);
+
+    layout.setConversionPattern("%m%n%throwable{100}");
+    layout.activateOptions();
+    root.debug("%throwable{100}, no exception");
+    root.debug("%throwable{100}, with exception", ex);
+
+    //
+    //  manufacture a pattern to get just the first two lines
+    //
+    String[] trace = new ThrowableInformation(ex).getThrowableStrRep();
+    layout.setConversionPattern("%m%n%throwable{" + (2 - trace.length) + "}");
+    layout.activateOptions();
+    root.debug("%throwable{-n}, no exception");
+    root.debug("%throwable{-n}, with exception", ex);
+
+
       Transformer.transform(
         OUTPUT_FILE, FILTERED,
         new Filter[] {



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to