Author: jliu
Date: Fri Sep 7 02:56:10 2007
New Revision: 573523
URL: http://svn.apache.org/viewvc?rev=573523&view=rev
Log:
Added tests for JAX-RS
Added:
incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/resources/
incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/resources/expected_get_book123.txt
(with props)
incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/resources/expected_get_books.txt
(with props)
Modified:
incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
Modified:
incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java?rev=573523&r1=573522&r2=573523&view=diff
==============================================================================
---
incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
(original)
+++
incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
Fri Sep 7 02:56:10 2007
@@ -21,7 +21,6 @@
import java.io.InputStream;
import java.net.URL;
-import java.util.logging.Logger;
import org.apache.cxf.helpers.IOUtils;
@@ -39,15 +38,30 @@
}
@Test
- public void testGetBookWrapped() throws Exception {
+ public void testGetBooks() throws Exception {
String endpointAddress =
- "http://localhost:9080/xmlwrapped/books/123";
+ "http://localhost:9080/xml/bookstore";
URL url = new URL(endpointAddress);
InputStream in = url.openStream();
assertNotNull(in);
InputStream expected = getClass()
-
.getResourceAsStream("resources/expected_get_book123_xmlwrapped.txt");
+ .getResourceAsStream("resources/expected_get_books.txt");
+
+ //System.out.println("---" + getStringFromInputStream(in));
+ assertEquals(getStringFromInputStream(expected),
getStringFromInputStream(in));
+ }
+
+ @Test
+ public void testGetBook123() throws Exception {
+ String endpointAddress =
+ "http://localhost:9080/xml/bookstore/123";
+ URL url = new URL(endpointAddress);
+ InputStream in = url.openStream();
+ assertNotNull(in);
+
+ InputStream expected = getClass()
+ .getResourceAsStream("resources/expected_get_book123.txt");
//System.out.println("---" + getStringFromInputStream(in));
assertEquals(getStringFromInputStream(expected),
getStringFromInputStream(in));
Added:
incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/resources/expected_get_book123.txt
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/resources/expected_get_book123.txt?rev=573523&view=auto
==============================================================================
---
incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/resources/expected_get_book123.txt
(added)
+++
incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/resources/expected_get_book123.txt
Fri Sep 7 02:56:10 2007
@@ -0,0 +1 @@
+<Book><id>123</id><name>CXF in Action</name></Book>
\ No newline at end of file
Propchange:
incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/resources/expected_get_book123.txt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/resources/expected_get_book123.txt
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added:
incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/resources/expected_get_books.txt
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/resources/expected_get_books.txt?rev=573523&view=auto
==============================================================================
---
incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/resources/expected_get_books.txt
(added)
+++
incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/resources/expected_get_books.txt
Fri Sep 7 02:56:10 2007
@@ -0,0 +1 @@
+<Book><id>123</id><name>CXF in Action</name></Book>
\ No newline at end of file
Propchange:
incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/resources/expected_get_books.txt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/resources/expected_get_books.txt
------------------------------------------------------------------------------
svn:mime-type = text/plain