incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chet...@apache.org
Subject svn commit: r1550694 - in /sling/trunk/bundles/commons/log/src: main/java/ch/qos/logback/classic/spi/ main/java/org/apache/sling/commons/log/logback/internal/ test/java/org/apache/sling/commons/log/logback/integration/
Date Fri, 13 Dec 2013 11:49:02 GMT
Author: chetanm
Date: Fri Dec 13 11:49:02 2013
New Revision: 1550694

URL: http://svn.apache.org/r1550694
Log:
SLING-3049 - Make Logback Stacktrace Packaging data support OSGi aware

Disabling the PackagingDataCalculator support in OSGi as current logic of estimating class
would not work properly in OSGi env

Removed:
    sling/trunk/bundles/commons/log/src/main/java/ch/qos/logback/classic/spi/PackagingDataCalculator.java
Modified:
    sling/trunk/bundles/commons/log/src/main/java/org/apache/sling/commons/log/logback/internal/LogConfigManager.java
    sling/trunk/bundles/commons/log/src/test/java/org/apache/sling/commons/log/logback/integration/ITAppenderServices.java

Modified: sling/trunk/bundles/commons/log/src/main/java/org/apache/sling/commons/log/logback/internal/LogConfigManager.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/commons/log/src/main/java/org/apache/sling/commons/log/logback/internal/LogConfigManager.java?rev=1550694&r1=1550693&r2=1550694&view=diff
==============================================================================
--- sling/trunk/bundles/commons/log/src/main/java/org/apache/sling/commons/log/logback/internal/LogConfigManager.java
(original)
+++ sling/trunk/bundles/commons/log/src/main/java/org/apache/sling/commons/log/logback/internal/LogConfigManager.java
Fri Dec 13 11:49:02 2013
@@ -613,8 +613,8 @@ public class LogConfigManager implements
         if (packagingData != null) {
             packagingDataEnabled = Boolean.valueOf(packagingData.toString());
         } else {
-            //Defaults to true
-            packagingDataEnabled = true;
+            //Defaults to false i.e. disabled in OSGi env
+            packagingDataEnabled = false;
         }
     }
 

Modified: sling/trunk/bundles/commons/log/src/test/java/org/apache/sling/commons/log/logback/integration/ITAppenderServices.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/commons/log/src/test/java/org/apache/sling/commons/log/logback/integration/ITAppenderServices.java?rev=1550694&r1=1550693&r2=1550694&view=diff
==============================================================================
--- sling/trunk/bundles/commons/log/src/test/java/org/apache/sling/commons/log/logback/integration/ITAppenderServices.java
(original)
+++ sling/trunk/bundles/commons/log/src/test/java/org/apache/sling/commons/log/logback/integration/ITAppenderServices.java
Fri Dec 13 11:49:02 2013
@@ -28,13 +28,10 @@ import javax.inject.Inject;
 
 import ch.qos.logback.classic.Level;
 import ch.qos.logback.classic.Logger;
-import ch.qos.logback.classic.spi.ClassPackagingData;
 import ch.qos.logback.classic.spi.ILoggingEvent;
-import ch.qos.logback.classic.spi.StackTraceElementProxy;
 import ch.qos.logback.core.Appender;
 import ch.qos.logback.core.AppenderBase;
 import org.junit.After;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.ops4j.pax.exam.Option;
@@ -47,9 +44,7 @@ import org.osgi.service.cm.Configuration
 import org.osgi.service.cm.ConfigurationAdmin;
 import org.slf4j.LoggerFactory;
 
-import static org.hamcrest.CoreMatchers.is;
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertThat;
 import static org.junit.Assert.assertTrue;
 import static org.ops4j.pax.exam.CoreOptions.composite;
 import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
@@ -124,27 +119,6 @@ public class ITAppenderServices extends 
         assertEquals(2, ta.events.size());
     }
 
-    @Ignore("SLING-3049")
-    @Test
-    public void testPackagingData() throws Exception {
-        TestAppender ta = registerAppender("foo.bar.packaging");
-        delay();
-
-        Logger foo = (Logger)LoggerFactory.getLogger("foo.bar.packaging");
-        foo.warn("This is a test", new Exception());
-
-        // One event should be logged.
-        assertEquals(1, ta.events.size());
-        ILoggingEvent e = ta.events.get(0);
-        StackTraceElementProxy[] stProxies = e.getThrowableProxy().getStackTraceElementProxyArray();
-
-        ClassPackagingData cpd1 = stProxies[0].getClassPackagingData();
-
-        //For pax exam the bundle is created with name starting with PAXEXAM-PROBE
-        //As codeLocation is OSGi env is bundle symbolic name we check for that
-        assertThat(cpd1.getCodeLocation(), is(bundleContext.getBundle().getSymbolicName()));
-    }
-
     @After
     public void unregisterAppender(){
         sr.unregister();



Mime
View raw message