cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r764054 - in /cxf/branches/2.1.x-fixes: ./ rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/ systests/src/test/java/org/apache/cxf/systest/jaxrs/
Date Fri, 10 Apr 2009 21:02:53 GMT
Author: dkulp
Date: Fri Apr 10 21:02:52 2009
New Revision: 764054

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

........
  r763953 | sergeyb | 2009-04-10 10:42:20 -0400 (Fri, 10 Apr 2009) | 1 line
  
  Couple of updates to get the JAXRS tests passing on IBM JDK
........

Modified:
    cxf/branches/2.1.x-fixes/   (props changed)
    cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriBuilderImplTest.java
    cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxrs/CD.java
    cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java

Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Apr 10 21:02:52 2009
@@ -1 +1 @@
-/cxf/trunk:743446,753380,753397,753421,754585,755365,757499,757859,757899,757935,757951,758195,758303,758308,758378,758690,758910,759890,759961,759963-759964,759966,760029,760073,760150,760171,760178,760198,760212,760456,760468,760582,760938,761094,761113,761120,761317,761759,761789,762393,762518,762567,763200,763272,763495,763854,763931,763942
+/cxf/trunk:743446,753380,753397,753421,754585,755365,757499,757859,757899,757935,757951,758195,758303,758308,758378,758690,758910,759890,759961,759963-759964,759966,760029,760073,760150,760171,760178,760198,760212,760456,760468,760582,760938,761094,761113,761120,761317,761759,761789,762393,762518,762567,763200,763272,763495,763854,763931,763942,763953

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

Modified: cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriBuilderImplTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriBuilderImplTest.java?rev=764054&r1=764053&r2=764054&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriBuilderImplTest.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriBuilderImplTest.java
Fri Apr 10 21:02:52 2009
@@ -25,9 +25,12 @@
 import java.util.HashMap;
 import java.util.Map;
 
+import javax.ws.rs.core.MultivaluedMap;
+
 import org.apache.cxf.jaxrs.resources.Book;
 import org.apache.cxf.jaxrs.resources.BookStore;
 import org.apache.cxf.jaxrs.resources.UriBuilderWrongAnnotations;
+import org.apache.cxf.jaxrs.utils.JAXRSUtils;
 
 import org.junit.Assert;
 import org.junit.Test;
@@ -301,7 +304,7 @@
         URI newUri = new UriBuilderImpl().scheme("http").host("foo").port(1234).path("bar").queryParam("n1",
                                                                                         
              "v1")
             .queryParam("n2", "v2").fragment("fragment").build();
-        assertEquals("URI is not built correctly", uri, newUri);
+        compareURIs(uri, newUri);
     }
 
     
@@ -394,4 +397,18 @@
 
     
     
+    private void compareURIs(URI uri1, URI uri2) {
+        
+        assertEquals("Unexpected scheme", uri1.getScheme(), uri2.getScheme());
+        assertEquals("Unexpected host", uri1.getHost(), uri2.getHost());
+        assertEquals("Unexpected port", uri1.getPort(), uri2.getPort());
+        assertEquals("Unexpected path", uri1.getPath(), uri2.getPath());
+        assertEquals("Unexpected fragment", uri1.getFragment(), uri2.getFragment());
+        
+        MultivaluedMap<String, String> queries1 = 
+            JAXRSUtils.getStructuredParams(uri1.getRawQuery(), "&", false);
+        MultivaluedMap<String, String> queries2 = 
+            JAXRSUtils.getStructuredParams(uri2.getRawQuery(), "&", false);
+        assertEquals("Unexpected queries", queries1, queries2);
+    }
 }

Modified: cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxrs/CD.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxrs/CD.java?rev=764054&r1=764053&r2=764054&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxrs/CD.java (original)
+++ cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxrs/CD.java Fri
Apr 10 21:02:52 2009
@@ -29,6 +29,11 @@
     public CD() {
     }
     
+    public CD(String name, long id) {
+        this.name = name;
+        this.id = id;
+    }
+    
     public void setName(String n) {
         name = n;
     }
@@ -45,4 +50,16 @@
         return id;
     }
 
+    public boolean equals(Object o) {
+        if (!(o instanceof CD)) {
+            return false;
+        }
+        
+        CD other = (CD)o;
+        return name.equals(other.name) && id == other.id;
+    }
+    
+    public int hashCode() {
+        return name.hashCode() + new Long(id).hashCode();
+    }
 }

Modified: cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java?rev=764054&r1=764053&r2=764054&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
(original)
+++ cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
Fri Apr 10 21:02:52 2009
@@ -23,6 +23,8 @@
 import java.io.InputStream;
 import java.net.URL;
 import java.net.URLConnection;
+import java.util.Collection;
+import java.util.List;
 
 import javax.ws.rs.core.Response;
 
@@ -599,9 +601,12 @@
     @Test
     public void testGetCDs() throws Exception {
         
-        getAndCompareAsStrings("http://localhost:9080/bookstore/cds",
-                               "resources/expected_get_cds124.txt",
-                               "application/xml", 200);
+        WebClient wc = WebClient.create("http://localhost:9080/bookstore/cds");
+        CDs cds = wc.get(CDs.class);
+        Collection<CD> collection = cds.getCD();
+        assertEquals(2, collection.size());
+        assertTrue(collection.contains(new CD("BICYCLE RACE", 124)));
+        assertTrue(collection.contains(new CD("BOHEMIAN RHAPSODY", 123)));
     }
     
     @Test



Mime
View raw message