cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r797450 - in /cxf/branches/2.2.x-fixes: ./ systests/src/test/java/org/apache/cxf/systest/jaxrs/ systests/src/test/java/org/apache/cxf/systest/jaxrs/resources/ systests/src/test/java/org/apache/cxf/systest/type_test/
Date Fri, 24 Jul 2009 13:47:09 GMT
Author: dkulp
Date: Fri Jul 24 13:47:09 2009
New Revision: 797450

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

........
  r797192 | peterjones | 2009-07-23 15:11:47 -0400 (Thu, 23 Jul 2009) | 3 lines
  
  [CXF-2353] Updated test to check Book fields rather than do a string comparison.
  Resolves test failure with ibm jdk.
........

Removed:
    cxf/branches/2.2.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxrs/resources/expected_add_book_aegis.txt
Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    cxf/branches/2.2.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java
    cxf/branches/2.2.x-fixes/systests/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient.java

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jul 24 13:47:09 2009
@@ -1 +1 @@
-/cxf/trunk:782728-782730,783097,783294,783396,784059,784181-784184,784893,784895,785279-785282,785468,785621,785624,785651,785734,785866,786142,786271-786272,786395,786512,786514,786582-786583,786638,786647,786850,787200,787269,787277-787279,787290-787291,787305,787323,787366,787849,788030,788060,788187,788444,788451,788703,788752,788774,788819-788820,789013,789371,789387,789420,789527-789530,789704-789705,789788,789811,789896-789901,790074,790094,790134,790188,790294,790553,790637-790644,790868,791301,791354,791538,791753,791947,792007,792096,792183,792261-792265,792271,792604,792683-792685,792975,792985,793059,793570,794297,794396,794680,794728,794771,794778-794780,794892,795044,795104,795160,795583,795907,796022-796023,796352,796593,796741,796780,796994-796997,797117,797159
+/cxf/trunk:782728-782730,783097,783294,783396,784059,784181-784184,784893,784895,785279-785282,785468,785621,785624,785651,785734,785866,786142,786271-786272,786395,786512,786514,786582-786583,786638,786647,786850,787200,787269,787277-787279,787290-787291,787305,787323,787366,787849,788030,788060,788187,788444,788451,788703,788752,788774,788819-788820,789013,789371,789387,789420,789527-789530,789704-789705,789788,789811,789896-789901,790074,790094,790134,790188,790294,790553,790637-790644,790868,791301,791354,791538,791753,791947,792007,792096,792183,792261-792265,792271,792604,792683-792685,792975,792985,793059,793570,794297,794396,794680,794728,794771,794778-794780,794892,795044,795104,795160,795583,795907,796022-796023,796352,796593,796741,796780,796994-796997,797117,797159,797192

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

Modified: cxf/branches/2.2.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java?rev=797450&r1=797449&r2=797450&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java
(original)
+++ cxf/branches/2.2.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java
Fri Jul 24 13:47:09 2009
@@ -26,6 +26,7 @@
 import java.net.Socket;
 import java.net.URL;
 import java.net.URLConnection;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -41,6 +42,7 @@
 import org.apache.cxf.jaxrs.client.JAXRSClientFactory;
 import org.apache.cxf.jaxrs.client.WebClient;
 import org.apache.cxf.jaxrs.ext.xml.XMLSource;
+import org.apache.cxf.jaxrs.provider.AegisElementProvider;
 import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
 
 import org.junit.BeforeClass;
@@ -158,6 +160,22 @@
         assertEquals(getStringFromInputStream(expected), getStringFromInputStream(in));
     }
     
+    private void getBookAegis(String endpointAddress, String type) throws Exception {
+        getBookAegis(endpointAddress, type, null);
+    }
+    
+    private void getBookAegis(String endpointAddress, String type, String mHeader) throws
Exception {
+        WebClient client = WebClient.create(endpointAddress,
+            Collections.singletonList(new AegisElementProvider()));
+        if (mHeader != null) {
+            client = client.header("X-HTTP-Method-Override", mHeader);
+        }
+        Book book = client.accept(type).get(Book.class);
+
+        assertEquals(124L, book.getId());
+        assertEquals("CXF in Action - 2", book.getName());
+    }
+    
     @Test
     public void testAddInvalidXmlBook() throws Exception {
         
@@ -208,13 +226,13 @@
                "resources/expected_get_book123.txt");
                 
     }
-    
+
     @Test
     public void testGetBookAegis() throws Exception {
         
         String endpointAddress =
             "http://localhost:9080/the/thebooks4/bookstore/books/aegis"; 
-        getBook(endpointAddress, "resources/expected_add_book_aegis.txt", "application/xml");

+        getBookAegis(endpointAddress, "application/xml"); 
     }
     
     @Test
@@ -222,7 +240,7 @@
         
         String endpointAddress =
             "http://localhost:9080/the/thebooks4/bookstore/books/aegis/retrieve?_method=RETRIEVE";

-        getBook(endpointAddress, "resources/expected_add_book_aegis.txt", "application/xml");

+        getBookAegis(endpointAddress, "application/xml"); 
     }
     
     @Test
@@ -230,7 +248,7 @@
         
         String endpointAddress =
             "http://localhost:9080/the/thebooks4/bookstore/books/aegis/retrieve"; 
-        getBook(endpointAddress, "resources/expected_add_book_aegis.txt", "application/xml",
"RETRIEVE"); 
+        getBookAegis(endpointAddress, "application/xml", "RETRIEVE"); 
     }
     
     @Test
@@ -253,9 +271,7 @@
         String aegisData = sb.toString();
         s.getInputStream().close();
         s.close();
-        String expected = getStringFromInputStream(
-                              getClass().getResourceAsStream("resources/expected_add_book_aegis.txt"));
-        assertTrue(aegisData.contains(expected));
+        assertTrue(aegisData.contains("CXF in Action - 2"));
         
     }
     

Modified: cxf/branches/2.2.x-fixes/systests/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient.java?rev=797450&r1=797449&r2=797450&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient.java
(original)
+++ cxf/branches/2.2.x-fixes/systests/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient.java
Fri Jul 24 13:47:09 2009
@@ -743,10 +743,7 @@
         yOrig.setHour(22);
         yOrig.setMinute(4);
         yOrig.setSecond(15);
-        // XXX - Setting the millisecond part here seems to cause
-        // a xerces validation error with the ibm jdk. That should
-        // be valid.
-        // yOrig.setMillisecond(250);
+        yOrig.setMillisecond(250);
 
         Holder<XMLGregorianCalendar> y = new Holder<XMLGregorianCalendar>(yOrig);
         Holder<XMLGregorianCalendar> z = new Holder<XMLGregorianCalendar>();
@@ -820,7 +817,7 @@
 
     @Test
     public void testGMonth() throws Exception {
-        if (!shouldRunTest("GMonth")) {
+        if (!shouldRunTest("GMonth")) { 
             return;
         }
         javax.xml.datatype.DatatypeFactory datatypeFactory = javax.xml.datatype.DatatypeFactory.newInstance();



Mime
View raw message