summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/binding-rest-runtime/src/test/java/org/apache/tuscany/sca/binding
diff options
context:
space:
mode:
authorlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2010-07-09 02:22:29 +0000
committerlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2010-07-09 02:22:29 +0000
commit4c5685db052033f40a69cf17f7d462118af6a8e5 (patch)
treed76763834d06e85363cfb466f0170f324094c63f /sca-java-2.x/trunk/modules/binding-rest-runtime/src/test/java/org/apache/tuscany/sca/binding
parentb3243c64346cda94f30f9c7ab6a25b32a666e09c (diff)
TUSCANY-3618 - Enhancing type mapping for RPC over GET invocation using REST binding
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@962391 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')
-rw-r--r--sca-java-2.x/trunk/modules/binding-rest-runtime/src/test/java/org/apache/tuscany/sca/binding/rest/rpc/EchoServiceTestCase.java34
1 files changed, 30 insertions, 4 deletions
diff --git a/sca-java-2.x/trunk/modules/binding-rest-runtime/src/test/java/org/apache/tuscany/sca/binding/rest/rpc/EchoServiceTestCase.java b/sca-java-2.x/trunk/modules/binding-rest-runtime/src/test/java/org/apache/tuscany/sca/binding/rest/rpc/EchoServiceTestCase.java
index 5a7aaecaf1..a96f8ebb03 100644
--- a/sca-java-2.x/trunk/modules/binding-rest-runtime/src/test/java/org/apache/tuscany/sca/binding/rest/rpc/EchoServiceTestCase.java
+++ b/sca-java-2.x/trunk/modules/binding-rest-runtime/src/test/java/org/apache/tuscany/sca/binding/rest/rpc/EchoServiceTestCase.java
@@ -73,7 +73,7 @@ public class EchoServiceTestCase {
}
@Test
- public void testJSONRPCGetOperation() throws Exception {
+ public void testJSONRPCGetOperationWithString() throws Exception {
String queryString = "?method=echo&msg=Hello RPC";
WebConversation wc = new WebConversation();
@@ -86,7 +86,20 @@ public class EchoServiceTestCase {
}
@Test
- public void testRPCGetArrayOperation() throws Exception {
+ public void testJSONRPCGetOperationWithInt() throws Exception {
+ String queryString = "?method=echoInt&param=1000";
+
+ WebConversation wc = new WebConversation();
+ WebRequest request = new GetMethodWebRequest(SERVICE_URL_JSON + queryString);
+ request.setHeaderField("Content-Type", "application/json");
+ WebResponse response = wc.getResource(request);
+
+ Assert.assertEquals(200, response.getResponseCode());
+ Assert.assertEquals("1000", response.getText());
+ }
+
+ @Test
+ public void testRPCGetArrayOperationWithString() throws Exception {
String queryString = "?method=echoArrayString&msgArray=Hello RPC1&msgArray=Hello RPC2";
WebConversation wc = new WebConversation();
@@ -98,6 +111,19 @@ public class EchoServiceTestCase {
Assert.assertEquals("[\"Hello RPC1\",\"Hello RPC2\"]", response.getText());
}
+ @Test
+ public void testRPCGetArrayOperationWithInt() throws Exception {
+ String queryString = "?method=echoArrayInt&intArray=1000&intArray=2000";
+
+ WebConversation wc = new WebConversation();
+ WebRequest request = new GetMethodWebRequest(SERVICE_URL_JSON + queryString);
+ request.setHeaderField("Content-Type", "application/json");
+ WebResponse response = wc.getResource(request);
+
+ Assert.assertEquals(200, response.getResponseCode());
+ Assert.assertEquals("[1000,2000]", response.getText());
+ }
+
@Test
public void testXMLRPCGetOperation() throws Exception {
@@ -108,8 +134,8 @@ public class EchoServiceTestCase {
request.setHeaderField("Content-Type", "application/xml");
WebResponse response = wc.getResource(request);
- System.out.println("Expected>>" + XML_RESPONSE);
- System.out.println("Received>>" + response.getText());
+ //System.out.println("Expected>>" + XML_RESPONSE);
+ //System.out.println("Received>>" + response.getText());
Assert.assertEquals(200, response.getResponseCode());
Assert.assertEquals(XML_RESPONSE, response.getText());