cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r763246 - /cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java
Date Wed, 08 Apr 2009 13:49:14 GMT
Author: sergeyb
Date: Wed Apr  8 13:49:14 2009
New Revision: 763246

URL: http://svn.apache.org/viewvc?rev=763246&view=rev
Log:
Fixing NPE caused by JAXRS endpoints

Modified:
    cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java

Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java?rev=763246&r1=763245&r2=763246&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java (original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java Wed
Apr  8 13:49:14 2009
@@ -64,7 +64,7 @@
     @Test
     public void testGetAll() throws Exception {
         
-        InputStream in = getRestInputStream("http://localhost:9092/test/services/rest2/myRestService");
+        InputStream in = getHttpInputStream("http://localhost:9092/test/services/rest2/myRestService");
         assertEquals("0", getStringFromInputStream(in));
                 
     }
@@ -72,7 +72,7 @@
     @Test
     public void testGetBook123() throws Exception {
         
-        InputStream in = getRestInputStream("http://localhost:9092/test/services/rest/bookstore/123");
+        InputStream in = getHttpInputStream("http://localhost:9092/test/services/rest/bookstore/123");
         
         InputStream expected = getClass().getResourceAsStream("resources/expected_get_book123.txt");
         assertEquals(getStringFromInputStream(expected), getStringFromInputStream(in));
@@ -331,6 +331,10 @@
         BookStoreJaxrsJaxws store = service.getBookPort();
         Book book = store.getBook(new Long(123));
         assertEquals("id is wrong", book.getId(), 123);
+        
+        String listings = 
+            getStringFromInputStream(getHttpInputStream("http://localhost:9092/test/services"));
+        assertNotNull(listings);
     }
 
     private String getStringFromInputStream(InputStream in) throws Exception {        
@@ -341,7 +345,7 @@
         return bos.getOut().toString();        
     }
 
-    private InputStream getRestInputStream(String endpointAddress) throws Exception {
+    private InputStream getHttpInputStream(String endpointAddress) throws Exception {
         URL url = new URL(endpointAddress);
         
         URLConnection connect = url.openConnection();



Mime
View raw message