You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2010/03/30 22:36:10 UTC

svn commit: r929264 - /cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSLoggingAtomPullSpringTest.java

Author: dkulp
Date: Tue Mar 30 20:36:10 2010
New Revision: 929264

URL: http://svn.apache.org/viewvc?rev=929264&view=rev
Log:
Fix test that is randomly failing with latest 1.6 JDK

Modified:
    cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSLoggingAtomPullSpringTest.java

Modified: cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSLoggingAtomPullSpringTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSLoggingAtomPullSpringTest.java?rev=929264&r1=929263&r2=929264&view=diff
==============================================================================
--- cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSLoggingAtomPullSpringTest.java (original)
+++ cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSLoggingAtomPullSpringTest.java Tue Mar 30 20:36:10 2010
@@ -52,7 +52,7 @@ import org.junit.Test;
 
 public class JAXRSLoggingAtomPullSpringTest extends AbstractClientServerTestBase {
 
-    private JAXBContext context; 
+    private static JAXBContext context; 
     private int fakyLogger;
     private int namedLogger;
     private int resourceLogger;
@@ -60,9 +60,16 @@ public class JAXRSLoggingAtomPullSpringT
     
     @BeforeClass
     public static void beforeClass() throws Exception {
+        //make sure the Resource things have their static initializers called 
+        //to make sure the Loggers are created.  Otherwise, the Loggers that the server 
+        //sets the handler into could be garbage collected before the init is called
+        new Resource();
+        new Resource2();
+        new Resource3();
         // must be 'in-process' to communicate with inner class in single JVM
         // and to spawn class SpringServer w/o using main() method
         launchServer(SpringServer.class, true);
+        context = JAXBContext.newInstance(org.apache.cxf.management.web.logging.LogRecord.class);
     }
 
     @Ignore
@@ -74,7 +81,6 @@ public class JAXRSLoggingAtomPullSpringT
 
     @Before
     public void before() throws Exception {
-        context = JAXBContext.newInstance(org.apache.cxf.management.web.logging.LogRecord.class);
         Storage.clearRecords();
     }