cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1347068 - in /cxf/branches/2.5.x-fixes: ./ systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/ systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/
Date Wed, 06 Jun 2012 19:20:07 GMT
Author: dkulp
Date: Wed Jun  6 19:20:06 2012
New Revision: 1347068

URL: http://svn.apache.org/viewvc?rev=1347068&view=rev
Log:
Merged revisions 1346533 via  svn merge from
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1346533 | dkulp | 2012-06-05 14:57:40 -0400 (Tue, 05 Jun 2012) | 3 lines
  
  jaxrs to forkmode once
  Major update is to AtomPush to manually configure the single logger to
  leave the rest of the logging subsystem at the defaults.
........

Modified:
    cxf/branches/2.5.x-fixes/   (props changed)
    cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceJacksonSpringProviderTest.java
    cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java
    cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerStreamingTest.java
    cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerUserResourceTest.java
    cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSContinuationsTest.java
    cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSDataBindingTest.java
    cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSLoggingAtomPushTest.java
    cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/logging_atompush.properties
    cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/logging_atompush_atompub.properties
    cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/logging_atompush_batch.properties

Propchange: cxf/branches/2.5.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceJacksonSpringProviderTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceJacksonSpringProviderTest.java?rev=1347068&r1=1347067&r2=1347068&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceJacksonSpringProviderTest.java
(original)
+++ cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceJacksonSpringProviderTest.java
Wed Jun  6 19:20:06 2012
@@ -39,6 +39,7 @@ public class JAXRSClientServerResourceJa
     public static void startServers() throws Exception {
         assertTrue("server did not launch correctly",
                    launchServer(BookServerResourceJacksonSpringProviders.class, true));
+        createStaticBus();
     }
     
     @Test

Modified: cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java?rev=1347068&r1=1347067&r2=1347068&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java
(original)
+++ cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java
Wed Jun  6 19:20:06 2012
@@ -66,6 +66,7 @@ public class JAXRSClientServerSpringBook
     public static void startServers() throws Exception {
         assertTrue("server did not launch correctly", 
                    launchServer(BookServerSpring.class, true));
+        createStaticBus();
     }
     
     @Test

Modified: cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerStreamingTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerStreamingTest.java?rev=1347068&r1=1347067&r2=1347068&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerStreamingTest.java
(original)
+++ cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerStreamingTest.java
Wed Jun  6 19:20:06 2012
@@ -99,6 +99,7 @@ public class JAXRSClientServerStreamingT
         //keep out of process due to stack traces testing failures
         assertTrue("server did not launch correctly",
                    launchServer(Server.class));
+        createStaticBus();
     }
     
     @Test

Modified: cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerUserResourceTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerUserResourceTest.java?rev=1347068&r1=1347067&r2=1347068&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerUserResourceTest.java
(original)
+++ cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerUserResourceTest.java
Wed Jun  6 19:20:06 2012
@@ -105,6 +105,7 @@ public class JAXRSClientServerUserResour
     public static void startServers() throws Exception {
         assertTrue("server did not launch correctly",
                    launchServer(Server.class, true));
+        createStaticBus();
     }
     
     @Test

Modified: cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSContinuationsTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSContinuationsTest.java?rev=1347068&r1=1347067&r2=1347068&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSContinuationsTest.java
(original)
+++ cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSContinuationsTest.java
Wed Jun  6 19:20:06 2012
@@ -39,6 +39,7 @@ public class JAXRSContinuationsTest exte
 
     @BeforeClass
     public static void startServers() throws Exception {
+        createStaticBus();
         assertTrue("server did not launch correctly",
                    launchServer(BookContinuationServer.class, true));
     }

Modified: cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSDataBindingTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSDataBindingTest.java?rev=1347068&r1=1347067&r2=1347068&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSDataBindingTest.java
(original)
+++ cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSDataBindingTest.java
Wed Jun  6 19:20:06 2012
@@ -48,6 +48,7 @@ public class JAXRSDataBindingTest extend
     public static void startServers() throws Exception {
         assertTrue("server did not launch correctly", 
                    launchServer(BookDataBindingServer.class, true));
+        createStaticBus();
     }
     
     

Modified: cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSLoggingAtomPushTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSLoggingAtomPushTest.java?rev=1347068&r1=1347067&r2=1347068&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSLoggingAtomPushTest.java
(original)
+++ cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSLoggingAtomPushTest.java
Wed Jun  6 19:20:06 2012
@@ -21,6 +21,7 @@ package org.apache.cxf.systest.jaxrs;
 import java.io.ByteArrayInputStream;
 import java.io.InputStream;
 import java.util.Arrays;
+import java.util.Collection;
 import java.util.List;
 import java.util.Queue;
 import java.util.concurrent.ConcurrentLinkedQueue;
@@ -62,8 +63,8 @@ import org.junit.Test;
 
 public class JAXRSLoggingAtomPushTest extends Assert {
     public static final String PORT = TestUtil.getPortNumber(JAXRSLoggingAtomPushTest.class);
-    
-    private static final Logger LOG = LogUtils.getL7dLogger(JAXRSLoggingAtomPushTest.class);
+    public static final Logger LOG = LogUtils.getL7dLogger(JAXRSLoggingAtomPushTest.class);
+
     private static Server server;
     
     
@@ -89,6 +90,15 @@ public class JAXRSLoggingAtomPushTest ex
         ins.close();
         s = s.replaceAll("9080", PORT);
         lm.readConfiguration(new ByteArrayInputStream(s.getBytes("UTF-8")));
+        
+        for (Handler h : LOG.getHandlers()) {
+            LOG.removeHandler(h);
+            h.close();
+        }
+        if (lm.getProperty(JAXRSLoggingAtomPushTest.class.getName() + ".handlers") != null)
{
+            LOG.addHandler(new AtomPushHandler());
+        }
+        LOG.setUseParentHandlers(false);
     }
 
     private static void logSixEvents(Logger log) {
@@ -109,16 +119,17 @@ public class JAXRSLoggingAtomPushTest ex
 
     @AfterClass
     public static void afterClass() throws Exception {
-        if (server != null) {
-            server.destroy();
-        }
         LogManager lm = LogManager.getLogManager();
         try {
+            lm.reset();
             // restoring original configuration to not use tested logging handlers
             lm.readConfiguration();
         } catch (Exception e) {
             // ignore missing config file
         }
+        if (server != null) {
+            server.destroy();
+        }
     }
 
     @Before
@@ -126,6 +137,17 @@ public class JAXRSLoggingAtomPushTest ex
         Resource.clear();
     }
 
+    private void waitForFeeds(Collection<?> c, int count) throws Exception {
+        int iter = 0;
+        while (c.size() < count) {
+            Thread.sleep(100);
+            iter++;
+            if (iter > 30) {
+                return;
+            }
+        }
+    }
+    
     @Test
     public void testPrivateLogger() throws Exception {
         configureLogging("resources/logging_atompush_disabled.properties");
@@ -137,7 +159,7 @@ public class JAXRSLoggingAtomPushTest ex
         log.setLevel(Level.ALL);
         logSixEvents(log);
         // need to wait: multithreaded and client-server journey
-        Thread.sleep(3000);
+        waitForFeeds(Resource.feeds, 3);
         // 6 events / 2 element batch = 3 feeds expected
         assertEquals("Different logged events count;", 3, Resource.feeds.size());
     }
@@ -157,7 +179,7 @@ public class JAXRSLoggingAtomPushTest ex
         log.setLevel(Level.ALL);
         logSixEvents(log);
         // need to wait: multithreaded and client-server journey
-        Thread.sleep(3000);
+        waitForFeeds(Resource.feeds, 3);
         // 6 events / 2 element batch = 3 feeds expected
         assertEquals("Different logged events count;", 3, Resource.feeds.size());
     }
@@ -165,18 +187,18 @@ public class JAXRSLoggingAtomPushTest ex
     @Test
     public void testOneElementBatch() throws Exception {
         configureLogging("resources/logging_atompush.properties");
-        logSixEvents(LOG);
+        logSixEvents(LogUtils.getL7dLogger(JAXRSLoggingAtomPushTest.class));
         // need to wait: multithreaded and client-server journey
-        Thread.sleep(3000);
+        waitForFeeds(Resource.feeds, 6);
         assertEquals("Different logged events count;", 6, Resource.feeds.size());
     }
 
     @Test
     public void testMultiElementBatch() throws Exception {
         configureLogging("resources/logging_atompush_batch.properties");
-        logSixEvents(LOG);
+        logSixEvents(LogUtils.getL7dLogger(JAXRSLoggingAtomPushTest.class));
         // need to wait: multithreaded and client-server journey
-        Thread.sleep(3000);
+        waitForFeeds(Resource.feeds, 2);
         // 6 events / 3 element batch = 2 feeds expected
         assertEquals("Different logged events count;", 2, Resource.feeds.size());
     }
@@ -213,9 +235,9 @@ public class JAXRSLoggingAtomPushTest ex
     @Test
     public void testAtomPubEntries() throws Exception {
         configureLogging("resources/logging_atompush_atompub.properties");
-        logSixEvents(LOG);
+        logSixEvents(LogUtils.getL7dLogger(JAXRSLoggingAtomPushTest.class));
         // need to wait: multithreaded and client-server journey
-        Thread.sleep(3000);
+        waitForFeeds(Resource.entries, 6);
         // 6 events logged as entries
         assertEquals("Different logged events count;", 6, Resource.entries.size());
     }

Modified: cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/logging_atompush.properties
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/logging_atompush.properties?rev=1347068&r1=1347067&r2=1347068&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/logging_atompush.properties
(original)
+++ cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/logging_atompush.properties
Wed Jun  6 19:20:06 2012
@@ -1,28 +1,7 @@
-# Atom logger plus echo on console
-handlers = org.apache.cxf.management.web.logging.atom.AtomPushHandler, java.util.logging.ConsoleHandler
-
-# Set the default logging level for the root logger
-.level = ALL
-
 # Set logging levels for the package-named loggers 
-org.apache.cxf.systest.jaxrs.level = ALL
-
-# Need to turn off logging from surrounding environment to properly count log entries in
tests
-# (specified sub-entries since root level overrides sub-levels... yes, JUL is dumb :)
-org.apache.cxf.jaxrs.level = OFF
-org.apache.cxf.phase.level = OFF
-org.apache.cxf.service.level = OFF
-org.apache.cxf.interceptor.level = OFF
-org.apache.cxf.transport.level = OFF
-org.apache.cxf.bus.level = OFF
-org.apache.cxf.configuration.level = OFF
-org.apache.cxf.endpoint.level = OFF
-org.apache.cxf.resource.level = OFF
-org.springframework.level = OFF
-org.mortbay.level = OFF
-org.eclipse.level = OFF
-org.apache.axiom.level = OFF
-org.apache.cxf.ws.policy.level = OFF
+org.apache.cxf.systest.jaxrs.JAXRSLoggingAtomPushTest.level = ALL
+org.apache.cxf.systest.jaxrs.JAXRSLoggingAtomPushTest.handlers = org.apache.cxf.management.web.logging.atom.AtomPushHandler
+org.apache.cxf.systest.jaxrs.JAXRSLoggingAtomPushTest.useParentHandlers = false
 
 # Atom handler specific settings
 org.apache.cxf.management.web.logging.atom.AtomPushHandler.url = http://localhost:9080

Modified: cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/logging_atompush_atompub.properties
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/logging_atompush_atompub.properties?rev=1347068&r1=1347067&r2=1347068&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/logging_atompush_atompub.properties
(original)
+++ cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/logging_atompush_atompub.properties
Wed Jun  6 19:20:06 2012
@@ -1,28 +1,7 @@
-# Atom logger plus echo on console
-handlers = org.apache.cxf.management.web.logging.atom.AtomPushHandler, java.util.logging.ConsoleHandler
-
-# Set the default logging level for the root logger
-.level = ALL
-
 # Set logging levels for the package-named loggers 
-org.apache.cxf.systest.jaxrs.level = ALL
-
-# Need to turn off logging from surrounding environment to properly count log entries in
tests
-# (specified sub-entries since root level overrides sub-levels... yes, JUL is dumb :)
-org.apache.cxf.jaxrs.level = OFF
-org.apache.cxf.phase.level = OFF
-org.apache.cxf.service.level = OFF
-org.apache.cxf.interceptor.level = OFF
-org.apache.cxf.transport.level = OFF
-org.apache.cxf.bus.level = OFF
-org.apache.cxf.configuration.level = OFF
-org.apache.cxf.endpoint.level = OFF
-org.apache.cxf.resource.level = OFF
-org.springframework.level = OFF
-org.mortbay.level = OFF
-org.eclipse.level = OFF
-org.apache.axiom.level = OFF
-org.apache.cxf.ws.policy.level = OFF
+org.apache.cxf.systest.jaxrs.JAXRSLoggingAtomPushTest.level = ALL
+org.apache.cxf.systest.jaxrs.JAXRSLoggingAtomPushTest.handlers = org.apache.cxf.management.web.logging.atom.AtomPushHandler
+org.apache.cxf.systest.jaxrs.JAXRSLoggingAtomPushTest.useParentHandlers = false
 
 # Atom handler specific settings
 org.apache.cxf.management.web.logging.atom.AtomPushHandler.url = http://localhost:9080/atomPub

Modified: cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/logging_atompush_batch.properties
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/logging_atompush_batch.properties?rev=1347068&r1=1347067&r2=1347068&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/logging_atompush_batch.properties
(original)
+++ cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/logging_atompush_batch.properties
Wed Jun  6 19:20:06 2012
@@ -1,27 +1,8 @@
-# Atom logger plus echo on console
-handlers = org.apache.cxf.management.web.logging.atom.AtomPushHandler, java.util.logging.ConsoleHandler
-
-# Set the default logging level for the root logger
-.level = ALL
 
 # Set logging levels for the package-named loggers 
-org.apache.cxf.systest.jaxrs.level = ALL
-
-# Need to turn off logging from surrounding environment to properly count log entries in
tests
-# (specified sub-entries since root level overrides sub-levels... yes, JUL is dumb :)
-org.apache.cxf.jaxrs.level = OFF
-org.apache.cxf.phase.level = OFF
-org.apache.cxf.service.level = OFF
-org.apache.cxf.interceptor.level = OFF
-org.apache.cxf.transport.level = OFF
-org.apache.cxf.bus.level = OFF
-org.apache.cxf.configuration.level = OFF
-org.apache.cxf.endpoint.level = OFF
-org.apache.cxf.resource.level = OFF
-org.springframework.level = OFF
-org.mortbay.level = OFF
-org.eclipse.level = OFF
-org.apache.axiom.level = OFF
+org.apache.cxf.systest.jaxrs.JAXRSLoggingAtomPushTest.level = ALL
+org.apache.cxf.systest.jaxrs.JAXRSLoggingAtomPushTest.handlers = org.apache.cxf.management.web.logging.atom.AtomPushHandler
+org.apache.cxf.systest.jaxrs.JAXRSLoggingAtomPushTest.useParentHandlers = false
 
 # Atom handler specific settings
 org.apache.cxf.management.web.logging.atom.AtomPushHandler.url = http://localhost:9080



Mime
View raw message