cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r748193 - in /cxf/trunk: rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ rt/frontend/jaxrs/src/test/java/org...
Date Thu, 26 Feb 2009 16:14:18 GMT
Author: sergeyb
Date: Thu Feb 26 16:14:17 2009
New Revision: 748193

URL: http://svn.apache.org/viewvc?rev=748193&view=rev
Log:
JAXRS: UriBuilder and resource method selection algorithm update

Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
    cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/SelectMethodCandidatesTest.java
    cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriBuilderImplTest.java
    cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/resources/TestResource.java
    cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
    cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
    cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceCreatedSpringProviderTest.java
    cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/resources/expected_get_cds124.txt

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java?rev=748193&r1=748192&r2=748193&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
Thu Feb 26 16:14:17 2009
@@ -90,7 +90,7 @@
         resetResponse();
         
         Class<?> declaringClass = m.getDeclaringClass();
-        if (Client.class == declaringClass) {
+        if (Client.class == declaringClass || Object.class == declaringClass) {
             return m.invoke(this, params);
         }
         

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java?rev=748193&r1=748192&r2=748193&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java
Thu Feb 26 16:14:17 2009
@@ -222,7 +222,7 @@
 
     @Override
     public UriBuilder path(String path) throws IllegalArgumentException {
-        List<PathSegment> segments = JAXRSUtils.getPathSegments(path, false);
+        List<PathSegment> segments = JAXRSUtils.getPathSegments(path, false, false);
         if (!paths.isEmpty() && !matrix.isEmpty()) {
             PathSegment ps = paths.remove(paths.size() - 1);
             paths.add(replacePathSegment(ps));
@@ -252,13 +252,11 @@
         // scheme-specific part is whatever after ":" of URI
         // see: http://en.wikipedia.org/wiki/URI_scheme
         try {
-            URI uri = new URI("whatever://" + ssp);
-            port = uri.getPort();
-            host = uri.getHost();
-            paths = JAXRSUtils.getPathSegments(uri.getPath(), false);
-            fragment = uri.getFragment();
-            query = JAXRSUtils.getStructuredParams(uri.getQuery(), "&", true);
-            userInfo = uri.getUserInfo();
+            if (scheme == null) {
+                scheme = "http";
+            }
+            URI uri = new URI(scheme + "://" + ssp);
+            setUriParts(uri);
         } catch (URISyntaxException e) {
             throw new IllegalArgumentException("Wrong syntax of scheme-specific part", e);
         }
@@ -291,7 +289,7 @@
     }
 
     private void setPathAndMatrix(String path) {
-        paths = JAXRSUtils.getPathSegments(path, false);
+        paths = JAXRSUtils.getPathSegments(path, false, false);
         if (!paths.isEmpty()) {
             matrix = paths.get(paths.size() - 1).getMatrixParameters();
         } else {

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java?rev=748193&r1=748192&r2=748193&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java Thu
Feb 26 16:14:17 2009
@@ -106,6 +106,11 @@
     }
     
     public static List<PathSegment> getPathSegments(String thePath, boolean decode)
{
+        return getPathSegments(thePath, decode, true);
+    }
+    
+    public static List<PathSegment> getPathSegments(String thePath, boolean decode,

+                                                    boolean ignoreLastSlash) {
         String[] segments = thePath.split("/");
         List<PathSegment> theList = new ArrayList<PathSegment>();
         for (String path : segments) {
@@ -114,8 +119,9 @@
             }
         }
         int len = thePath.length();
-        if (len > 1 && thePath.charAt(len - 1) == '/') {
-            theList.add(new PathSegmentImpl("", false));
+        if (len > 0 && thePath.charAt(len - 1) == '/') {
+            String value = ignoreLastSlash ? "" : "/";
+            theList.add(new PathSegmentImpl(value, false));
         }
         return theList;
     }
@@ -248,6 +254,7 @@
         int consumeMatched = 0;
         int produceMatched = 0;
         
+        boolean subresourcesOnly = true;
         for (MediaType acceptType : acceptContentTypes) {
             for (OperationResourceInfo ori : resource.getMethodDispatcher().getOperationResourceInfos())
{
                 URITemplate uriTemplate = ori.getURITemplate();
@@ -264,6 +271,7 @@
                             boolean cMatched = matchConsumeTypes(requestType, ori);
                             boolean pMatched = matchProduceTypes(acceptType, ori);
                             if (mMatched && cMatched && pMatched) {
+                                subresourcesOnly = false;
                                 candidateList.put(ori, map);    
                             } else {
                                 methodMatched = mMatched ? methodMatched + 1 : methodMatched;
@@ -274,15 +282,18 @@
                     }
                 }
             }
-            if (!candidateList.isEmpty()) {
-                Map.Entry<OperationResourceInfo, MultivaluedMap<String, String>>
firstEntry = 
-                    candidateList.entrySet().iterator().next();
-                values.clear();
-                values.putAll(firstEntry.getValue());
-                return firstEntry.getKey();
+            if (!candidateList.isEmpty() && !subresourcesOnly) {
+                break;
             }
         }
-
+        if (!candidateList.isEmpty()) {
+            Map.Entry<OperationResourceInfo, MultivaluedMap<String, String>>
firstEntry = 
+                candidateList.entrySet().iterator().next();
+            values.clear();
+            values.putAll(firstEntry.getValue());
+            return firstEntry.getKey();
+        }
+        
         int status = pathMatched == 0 ? 404 : methodMatched == 0 ? 405 
                      : consumeMatched == 0 ? 415 : produceMatched == 0 ? 406 : 404;
         String name = resource.isRoot() ? "NO_OP_EXC" : "NO_SUBRESOURCE_METHOD_FOUND";
@@ -337,14 +348,14 @@
             return -1;
         }
          
-        if (mt1.getType().equals(mt2.getType())) {
-            if (mt1.isWildcardSubtype() && !mt2.isWildcardSubtype()) {
-                return 1;
-            }
-            if (!mt1.isWildcardSubtype() && mt2.isWildcardSubtype()) {
-                return -1;
-            }       
+        
+        if (mt1.isWildcardSubtype() && !mt2.isWildcardSubtype()) {
+            return 1;
         }
+        if (!mt1.isWildcardSubtype() && mt2.isWildcardSubtype()) {
+            return -1;
+        }       
+        
         
         float q1 = getMediaTypeQualityFactor(mt1.getParameters().get("q"));
         float q2 = getMediaTypeQualityFactor(mt2.getParameters().get("q"));

Modified: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/SelectMethodCandidatesTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/SelectMethodCandidatesTest.java?rev=748193&r1=748192&r2=748193&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/SelectMethodCandidatesTest.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/SelectMethodCandidatesTest.java
Thu Feb 26 16:14:17 2009
@@ -36,10 +36,51 @@
 public class SelectMethodCandidatesTest extends Assert {
     
     @Test
+    public void testFindTargetSubResource() throws Exception {
+        JAXRSServiceFactoryBean sf = new JAXRSServiceFactoryBean();
+        sf.setResourceClasses(org.apache.cxf.jaxrs.resources.TestResource.class);
+        sf.create();
+        List<ClassResourceInfo> resources = ((JAXRSServiceImpl)sf.getService()).getClassResourceInfos();
+        String contentTypes = "*/*";
+        String acceptContentTypes = "text/xml,*/*";
+        
+        MetadataMap<String, String> values = new MetadataMap<String, String>();
+        ClassResourceInfo resource = JAXRSUtils.selectResourceClass(resources, "/1/2/3/d/resource",
values);
+        OperationResourceInfo ori = JAXRSUtils.findTargetMethod(resource, 
+                                    values.getFirst(URITemplate.FINAL_MATCH_GROUP), 
+                                    "GET", values, contentTypes, 
+                                    JAXRSUtils.sortMediaTypes(acceptContentTypes));
+        assertNotNull(ori);
+        assertEquals("resourceMethod needs to be selected", "resourceMethod",
+                     ori.getMethodToInvoke().getName());
+    }
+    
+    @Test
+    public void testSelectUsingQualityFactors() throws Exception {
+        JAXRSServiceFactoryBean sf = new JAXRSServiceFactoryBean();
+        sf.setResourceClasses(org.apache.cxf.jaxrs.resources.TestResource.class);
+        sf.create();
+        List<ClassResourceInfo> resources = ((JAXRSServiceImpl)sf.getService()).getClassResourceInfos();
+        String contentTypes = "*/*";
+        String acceptContentTypes = "application/xml;q=0.5,application/json";
+        
+        MetadataMap<String, String> values = new MetadataMap<String, String>();
+        ClassResourceInfo resource = JAXRSUtils.selectResourceClass(resources, "/1/2/3/d/resource1",
values);
+        OperationResourceInfo ori = JAXRSUtils.findTargetMethod(resource, 
+                                    values.getFirst(URITemplate.FINAL_MATCH_GROUP), 
+                                    "GET", values, contentTypes, 
+                                    JAXRSUtils.sortMediaTypes(acceptContentTypes));
+        assertNotNull(ori);
+        assertEquals("jsonResource needs to be selected", "jsonResource",
+                     ori.getMethodToInvoke().getName());
+    }
+    
+    @Test
     public void testFindTargetResourceClassWithTemplates() throws Exception {
         JAXRSServiceFactoryBean sf = new JAXRSServiceFactoryBean();
         sf.setResourceClasses(org.apache.cxf.jaxrs.resources.TestResource.class);
-        sf.create();        
+        sf.create();
+        
         List<ClassResourceInfo> resources = ((JAXRSServiceImpl)sf.getService()).getClassResourceInfos();
 
         String contentTypes = "*/*";

Modified: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriBuilderImplTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriBuilderImplTest.java?rev=748193&r1=748192&r2=748193&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriBuilderImplTest.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriBuilderImplTest.java
Thu Feb 26 16:14:17 2009
@@ -47,6 +47,34 @@
     }
 
     @Test
+    public void testTrailingSlash() throws Exception {
+        URI uri = new URI("http://bar/");
+        URI newUri = new UriBuilderImpl(uri).build();
+        assertEquals("URI is not built correctly", "http://bar/", newUri.toString());
+    }
+    
+    @Test
+    public void testPathTrailingSlash() throws Exception {
+        URI uri = new URI("http://bar");
+        URI newUri = new UriBuilderImpl(uri).path("/").build();
+        assertEquals("URI is not built correctly", "http://bar/", newUri.toString());
+    }
+    
+    @Test
+    public void testPathTrailingSlash2() throws Exception {
+        URI uri = new URI("http://bar");
+        URI newUri = new UriBuilderImpl(uri).path("/").path("/").build();
+        assertEquals("URI is not built correctly", "http://bar/", newUri.toString());
+    }
+    
+    @Test
+    public void testSchemeSpecificPart() throws Exception {
+        URI uri = new URI("http://bar");
+        URI newUri = new UriBuilderImpl(uri).scheme("https").schemeSpecificPart("foo/bar").build();
+        assertEquals("URI is not built correctly", "https://foo/bar", newUri.toString());
+    }
+    
+    @Test
     public void testReplacePath() throws Exception {
         URI uri = new URI("http://foo/bar/baz;m1=m1value");
         URI newUri = new UriBuilderImpl(uri).replacePath("/newpath").build();

Modified: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/resources/TestResource.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/resources/TestResource.java?rev=748193&r1=748192&r2=748193&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/resources/TestResource.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/resources/TestResource.java
Thu Feb 26 16:14:17 2009
@@ -30,7 +30,31 @@
     public TestResource() {
     }
     
+    @Path("/resource")
+    public TestResource subresource() {
+        return this;
+    }
+    
+    @Path("/resource")
+    @GET
+    @Produces("application/json")
+    public String resourceMethod() {
+        return "";
+    }
+    
+    @GET
+    @Produces("application/xml")
+    @Path("/resource1")
+    public TestResource xmlResource() {
+        return this;
+    }
     
+    @Path("/resource1")
+    @GET
+    @Produces("application/json")
+    public String jsonResource() {
+        return "";
+    }
     
     @GET
     @Path("/")

Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java?rev=748193&r1=748192&r2=748193&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java (original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java Thu Feb 26
16:14:17 2009
@@ -180,6 +180,7 @@
 
     @GET
     @Path("/books/{bookId}/")
+    @Produces("application/xml")
     public Book getBook(@PathParam("bookId") String id) throws BookNotFoundFault {
         return doGetBook(id);
     }
@@ -235,7 +236,7 @@
     
     @GET
     @Path("/books/{bookId}/")
-    @Produces("application/json")
+    @Produces("application/json;q=0.9")
     public Book getBookAsJSON() throws BookNotFoundFault {
         return doGetBook(currentBookId);
     }

Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java?rev=748193&r1=748192&r2=748193&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
(original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
Thu Feb 26 16:14:17 2009
@@ -45,7 +45,7 @@
     @BeforeClass
     public static void startServers() throws Exception {
         assertTrue("server did not launch correctly",
-                   launchServer(BookServer.class));
+                   launchServer(BookServer.class, true));
     }
     
     @Test
@@ -241,6 +241,15 @@
     }
     
     @Test
+    public void testGetBookXmlWildcard() throws Exception {
+        
+        getAndCompareAsStrings("http://localhost:9080/bookstore/books/123",
+                               "resources/expected_get_book123.txt",
+                               "*/*", 200);
+        
+    }
+    
+    @Test
     public void testGetBookBySegment() throws Exception {
         getAndCompareAsStrings("http://localhost:9080/bookstore/segment/matrix2;first=12;second=3",
                                "resources/expected_get_book123.txt",
@@ -504,41 +513,19 @@
         
     @Test
     public void testGetCDs() throws Exception {
-        String endpointAddress =
-            "http://localhost:9080/bookstore/cds"; 
-        URL url = new URL(endpointAddress);
-        URLConnection connect = url.openConnection();
-        connect.addRequestProperty("Accept", "application/xml");
-        InputStream in = connect.getInputStream();
-        assertNotNull(in);           
-
-        InputStream expected124 = getClass().getResourceAsStream("resources/expected_get_cds124.txt");
-        String result = getStringFromInputStream(in);
-        //System.out.println("---" + result);
-        assertTrue(result.indexOf(getStringFromInputStream(expected124)) >= 0);
+        
+        getAndCompareAsStrings("http://localhost:9080/bookstore/cds",
+                               "resources/expected_get_cds124.txt",
+                               "application/xml", 200);
     }
     
     @Test
     public void testGetCDJSON() throws Exception {
-        String endpointAddress =
-            "http://localhost:9080/bookstore/cd/123"; 
-
-        GetMethod get = new GetMethod(endpointAddress);
-        get.addRequestHeader("Accept" , "application/json");
-
-        HttpClient httpclient = new HttpClient();
         
-        try {
-            int result = httpclient.executeMethod(get);
-            assertEquals(200, result);
-
-            InputStream expected = getClass().getResourceAsStream("resources/expected_get_cdjson.txt");
-            
-            assertEquals(getStringFromInputStream(expected), get.getResponseBodyAsString());
-        } finally {
-            // Release current connection to the connection pool once you are done
-            get.releaseConnection();
-        }  
+        getAndCompareAsStrings("http://localhost:9080/bookstore/cd/123",
+                               "resources/expected_get_cdjson.txt",
+                               "application/json", 200);
+        
     }
     
     @SuppressWarnings("deprecation")
@@ -599,6 +586,7 @@
     
     @Test
     public void testGetCDsJSON() throws Exception {
+        
         String endpointAddress =
             "http://localhost:9080/bookstore/cds"; 
 
@@ -625,72 +613,29 @@
     
     @Test
     public void testGetCDXML() throws Exception {
-        String endpointAddress =
-            "http://localhost:9080/bookstore/cd/123"; 
-
-        GetMethod get = new GetMethod(endpointAddress);
-        get.addRequestHeader("Accept" , "application/xml");
-
-        HttpClient httpclient = new HttpClient();
         
-        try {
-            int result = httpclient.executeMethod(get);
-            assertEquals(200, result);
-
-            InputStream expected = getClass().getResourceAsStream("resources/expected_get_cd.txt");
-            
-            assertEquals(getStringFromInputStream(expected), get.getResponseBodyAsString());
-        } finally {
-            // Release current connection to the connection pool once you are done
-            get.releaseConnection();
-        }  
+        getAndCompareAsStrings("http://localhost:9080/bookstore/cd/123",
+                               "resources/expected_get_cd.txt",
+                               "application/xml", 200);
     }
     
     
     @Test
     public void testGetCDWithMultiContentTypesXML() throws Exception {
-        String endpointAddress =
-            "http://localhost:9080/bookstore/cdwithmultitypes/123"; 
-
-        GetMethod get = new GetMethod(endpointAddress);
-        get.addRequestHeader("Accept" , "application/xml");
-
-        HttpClient httpclient = new HttpClient();
         
-        try {
-            int result = httpclient.executeMethod(get);
-            assertEquals(200, result);
-
-            InputStream expected = getClass().getResourceAsStream("resources/expected_get_cd.txt");
-            
-            assertEquals(getStringFromInputStream(expected), get.getResponseBodyAsString());
-        } finally {
-            // Release current connection to the connection pool once you are done
-            get.releaseConnection();
-        }  
+        getAndCompareAsStrings("http://localhost:9080/bookstore/cdwithmultitypes/123",
+                               "resources/expected_get_cd.txt",
+                               "application/json;q=0.8,application/xml", 200);
     }
     
     @Test
     public void testGetCDWithMultiContentTypesJSON() throws Exception {
-        String endpointAddress =
-            "http://localhost:9080/bookstore/cdwithmultitypes/123"; 
-
-        GetMethod get = new GetMethod(endpointAddress);
-        get.addRequestHeader("Accept" , "application/json");
-
-        HttpClient httpclient = new HttpClient();
-        
-        try {
-            int result = httpclient.executeMethod(get);
-            assertEquals(200, result);
-
-            InputStream expected = getClass().getResourceAsStream("resources/expected_get_cdjson.txt");
-            
-            assertEquals(getStringFromInputStream(expected), get.getResponseBodyAsString());
-        } finally {
-            // Release current connection to the connection pool once you are done
-            get.releaseConnection();
-        }  
+        getAndCompareAsStrings("http://localhost:9080/bookstore/cdwithmultitypes/123",
+                               "resources/expected_get_cdjson.txt",
+                               "application/json", 200);
+        getAndCompareAsStrings("http://localhost:9080/bookstore/cdwithmultitypes/123",
+                               "resources/expected_get_cdjson.txt",
+                               "application/xml;q=0.9,application/json", 200);
     }
     
     @Test

Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceCreatedSpringProviderTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceCreatedSpringProviderTest.java?rev=748193&r1=748192&r2=748193&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceCreatedSpringProviderTest.java
(original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceCreatedSpringProviderTest.java
Thu Feb 26 16:14:17 2009
@@ -37,7 +37,7 @@
     @BeforeClass
     public static void startServers() throws Exception {
         assertTrue("server did not launch correctly",
-                   launchServer(BookServerResourceCreatedSpringProviders.class));
+                   launchServer(BookServerResourceCreatedSpringProviders.class, true));
     }
     
     @Test
@@ -65,10 +65,10 @@
     public void testGetBookNotFound() throws Exception {
         
         String endpointAddress =
-            "http://localhost:9080/webapp/bookstore/books/12345"; 
+            "http://localhost:9081/webapp/bookstore/books/12345"; 
         URL url = new URL(endpointAddress);
         HttpURLConnection connect = (HttpURLConnection)url.openConnection();
-        connect.addRequestProperty("Accept", "text/plain");
+        connect.addRequestProperty("Accept", "text/plain,application/xml");
         assertEquals(500, connect.getResponseCode());
         InputStream in = connect.getErrorStream();
         assertNotNull(in);           

Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/resources/expected_get_cds124.txt
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/resources/expected_get_cds124.txt?rev=748193&r1=748192&r2=748193&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/resources/expected_get_cds124.txt
(original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/resources/expected_get_cds124.txt
Thu Feb 26 16:14:17 2009
@@ -1 +1 @@
-<CD><id>124</id><name>BICYCLE RACE</name></CD>
\ No newline at end of file
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?><CDs><CD><id>124</id><name>BICYCLE
RACE</name></CD><CD><id>123</id><name>BOHEMIAN RHAPSODY</name></CD></CDs>
\ No newline at end of file



Mime
View raw message