summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/binding-rest-runtime/src/test/java/org/apache/tuscany/sca/binding/rest
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2011-03-29 23:39:48 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2011-03-29 23:39:48 +0000
commit347b86dcc1d4ed63ca4197065b4bf4e60f7f00f6 (patch)
tree4e8aa6a5c902f91332b05aa9dd31d3906f3ec844 /sca-java-2.x/trunk/modules/binding-rest-runtime/src/test/java/org/apache/tuscany/sca/binding/rest
parentaaa866c9f83ecb2a01f87fc91e0a03334e474d3c (diff)
Allow WebApplicationException to pass back to wink so that the correct response code is returned
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1086805 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/binding-rest-runtime/src/test/java/org/apache/tuscany/sca/binding/rest')
-rw-r--r--sca-java-2.x/trunk/modules/binding-rest-runtime/src/test/java/org/apache/tuscany/sca/binding/rest/wireformat/xml/CustomerServiceTestCase.java18
1 files changed, 11 insertions, 7 deletions
diff --git a/sca-java-2.x/trunk/modules/binding-rest-runtime/src/test/java/org/apache/tuscany/sca/binding/rest/wireformat/xml/CustomerServiceTestCase.java b/sca-java-2.x/trunk/modules/binding-rest-runtime/src/test/java/org/apache/tuscany/sca/binding/rest/wireformat/xml/CustomerServiceTestCase.java
index cd69cd0c41..9e1b99c9bc 100644
--- a/sca-java-2.x/trunk/modules/binding-rest-runtime/src/test/java/org/apache/tuscany/sca/binding/rest/wireformat/xml/CustomerServiceTestCase.java
+++ b/sca-java-2.x/trunk/modules/binding-rest-runtime/src/test/java/org/apache/tuscany/sca/binding/rest/wireformat/xml/CustomerServiceTestCase.java
@@ -73,17 +73,11 @@ public class CustomerServiceTestCase {
@Test
public void testGetInvocation() throws Exception {
WebConversation wc = new WebConversation();
- WebRequest request = new GetMethodWebRequest(SERVICE_URL);
+ WebRequest request = new GetMethodWebRequest(SERVICE_URL+"/John");
request.setHeaderField("Content-Type", "application/xml");
WebResponse response = wc.getResource(request);
//for debug purposes
- //list the response headers
- //for(String headerField : response.getHeaderFieldNames()) {
- // System.out.println(">>> Header:" + headerField + " - " + response.getHeaderField(headerField));
- //}
-
- //for debug purposes
System.out.println(">>>" + GET_RESPONSE);
System.out.println(">>>" + response.getText());
@@ -93,6 +87,16 @@ public class CustomerServiceTestCase {
Assert.assertEquals(GET_RESPONSE, response.getText());
}
+
+ @Test
+ public void testGetInvocationNotFound() throws Exception {
+ WebConversation wc = new WebConversation();
+ WebRequest request = new GetMethodWebRequest(SERVICE_URL+"/Foo");
+ request.setHeaderField("Content-Type", "application/xml");
+ WebResponse response = wc.getResource(request);
+
+ Assert.assertEquals(404, response.getResponseCode());
+ }
@Test
public void testPutInvocation() throws Exception {