cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r745472 - in /cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs: BookExceptionMapper.java JAXRSClientServerBookTest.java JAXRSClientServerResourceCreatedSpringProviderTest.java
Date Wed, 18 Feb 2009 10:38:47 GMT
Author: sergeyb
Date: Wed Feb 18 10:38:47 2009
New Revision: 745472

URL: http://svn.apache.org/viewvc?rev=745472&view=rev
Log:
JAXRS: updating an exception mapper test

Modified:
    cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookExceptionMapper.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

Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookExceptionMapper.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookExceptionMapper.java?rev=745472&r1=745471&r2=745472&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookExceptionMapper.java
(original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookExceptionMapper.java
Wed Feb 18 10:38:47 2009
@@ -18,6 +18,7 @@
  */
 package org.apache.cxf.systest.jaxrs;
 
+import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 import javax.ws.rs.ext.ExceptionMapper;
 
@@ -28,7 +29,7 @@
     public Response toResponse(BookNotFoundFault ex) {
         // status is 200 just to simplify the test client code
         if (toHandle) {
-            return Response.status(200)     
+            return Response.status(500).type(MediaType.TEXT_PLAIN_TYPE)     
                       .entity("No book found at all : " + ex.getFaultInfo().getId()).build();
         }
         return null;

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=745472&r1=745471&r2=745472&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
Wed Feb 18 10:38:47 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

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=745472&r1=745471&r2=745472&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
Wed Feb 18 10:38:47 2009
@@ -65,11 +65,12 @@
     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);
-        URLConnection connect = url.openConnection();
-        connect.addRequestProperty("Accept", "application/json");
-        InputStream in = connect.getInputStream();
+        HttpURLConnection connect = (HttpURLConnection)url.openConnection();
+        connect.addRequestProperty("Accept", "text/plain");
+        assertEquals(500, connect.getResponseCode());
+        InputStream in = connect.getErrorStream();
         assertNotNull(in);           
 
         InputStream expected = getClass()



Mime
View raw message