diff options
author | nash <nash@13f79535-47bb-0310-9956-ffa450edef68> | 2010-11-30 18:04:47 +0000 |
---|---|---|
committer | nash <nash@13f79535-47bb-0310-9956-ffa450edef68> | 2010-11-30 18:04:47 +0000 |
commit | 66ac4e82a503af71fb664f0b2c3d5099e4337066 (patch) | |
tree | 5b36dc6a3ed53cb62560963a42b45a89b62dc4de /sca-java-1.x/trunk/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany | |
parent | d6d8f204299954675c12fb3b6dc249bd908f4c29 (diff) |
TUSCANY-3747: Update result comparison code so that it works on JDK 5 and JDK 6
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1040660 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-1.x/trunk/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany')
-rw-r--r-- | sca-java-1.x/trunk/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/BindingTestCase.java | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/sca-java-1.x/trunk/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/BindingTestCase.java b/sca-java-1.x/trunk/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/BindingTestCase.java index 4de6e4464c..c9d7ea8123 100644 --- a/sca-java-1.x/trunk/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/BindingTestCase.java +++ b/sca-java-1.x/trunk/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/BindingTestCase.java @@ -68,7 +68,9 @@ public class BindingTestCase { JSONObject jsonResp = callService ("http://localhost:8085/HelloWorldComponent/HelloWorldService",
jsonRequest);
Assert.assertNotNull(jsonResp);
- Assert.assertEquals("{\"id\":1,\"result\":\"Hello petra\"}", jsonResp.toString());
+ Assert.assertEquals(new JSONObject(
+ "{\"id\":1,\"result\":\"Hello petra\"}"
+ ).toString(), jsonResp.toString());
} catch(Exception ex){
ex.printStackTrace();
@@ -83,7 +85,9 @@ public class BindingTestCase { JSONObject jsonResp = callService ("http://localhost:8085/HelloWorldComponent/HelloWorldService",
jsonRequest);
Assert.assertNotNull(jsonResp);
- Assert.assertEquals("{\"id\":1,\"result\":\"Hello petra arnold\"}", jsonResp.toString());
+ Assert.assertEquals(new JSONObject(
+ "{\"id\":1,\"result\":\"Hello petra arnold\"}"
+ ).toString(), jsonResp.toString());
} catch(Exception ex){
ex.printStackTrace();
@@ -101,7 +105,12 @@ public class BindingTestCase { Assert.assertNotNull(jsonResp);
//JabSorb sends class hints with complex parameters/types
- Assert.assertEquals("{\"id\":1,\"result\":{\"s\":\"XYZ\",\"b\":true,\"javaClass\":\"helloworld.BeanA\",\"y\":5,\"x\":2}}", jsonResp.toString());
+ String temp = new JSONObject(
+ "{\"x\":2,\"s\":\"XYZ\",\"b\":true,\"y\":5,\"javaClass\":\"helloworld.BeanA\"}"
+ ).toString();
+ Assert.assertEquals(new JSONObject(
+ "{\"id\":1,\"result\":" + temp + "}"
+ ).toString(), jsonResp.toString());
} catch(Exception ex){
ex.printStackTrace();
@@ -117,7 +126,9 @@ public class BindingTestCase { JSONObject jsonResp = callService ("http://localhost:8085/HelloWorldComponent/HelloWorldService",
jsonRequest);
Assert.assertNotNull(jsonResp);
- Assert.assertEquals("{\"id\":1,\"result\":[\"Hello Fred Bloggs\"]}", jsonResp.toString());
+ Assert.assertEquals(new JSONObject(
+ "{\"id\":1,\"result\":[\"Hello Fred Bloggs\"]}"
+ ).toString(), jsonResp.toString());
} catch(Exception ex){
ex.printStackTrace();
|