cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1212542 - in /cxf/branches/2.4.x-fixes: ./ systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
Date Fri, 09 Dec 2011 17:49:10 GMT
Author: dkulp
Date: Fri Dec  9 17:49:10 2011
New Revision: 1212542

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

........
  r1212154 | dkulp | 2011-12-08 16:59:48 -0500 (Thu, 08 Dec 2011) | 4 lines
  
  On java7, the test methods are executed in a different order and state
  in the singleton bookestore leaks across tests and causes failures.
  Add a reset that is called after each test to reset the singleton back
  to its empty state.
........

Modified:
    cxf/branches/2.4.x-fixes/   (props changed)
    cxf/branches/2.4.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
    cxf/branches/2.4.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java

Propchange: cxf/branches/2.4.x-fixes/
            ('svn:mergeinfo' removed)

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

Modified: cxf/branches/2.4.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java?rev=1212542&r1=1212541&r2=1212542&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
(original)
+++ cxf/branches/2.4.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
Fri Dec  9 17:49:10 2011
@@ -976,7 +976,14 @@ public class BookStore {
         return new BookSubresourceImpl();
     }
     
-    final void init() {
+    @GET
+    @Path("/reset")
+    public final String init() {
+        books.clear();
+        cds.clear();
+        bookId = 123;
+        cdId = 123;        
+        
         Book book = new Book();
         book.setId(bookId);
         book.setName("CXF in Action");
@@ -990,6 +997,7 @@ public class BookStore {
         cd1.setId(++cdId);
         cd1.setName("BICYCLE RACE");
         cds.put(cd1.getId(), cd1);
+        return "OK";
     }
     
     @XmlJavaTypeAdapter(BookInfoAdapter2.class)

Modified: cxf/branches/2.4.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java?rev=1212542&r1=1212541&r2=1212542&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
(original)
+++ cxf/branches/2.4.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
Fri Dec  9 17:49:10 2011
@@ -60,6 +60,7 @@ import org.apache.cxf.systest.jaxrs.Book
 import org.apache.cxf.systest.jaxrs.BookStore.BookInfoInterface;
 import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
 
+import org.junit.After;
 import org.junit.BeforeClass;
 import org.junit.Ignore;
 import org.junit.Test;
@@ -73,6 +74,10 @@ public class JAXRSClientServerBookTest e
         assertTrue("server did not launch correctly",
                    launchServer(BookServer.class));
     }
+    @After
+    public void resetBookServer() throws Exception {
+        new URL("http://localhost:" + PORT + "/bookstore/reset").openStream().close();
+    }
     
     @Test
     public void testMalformedAcceptType() {



Mime
View raw message