THRIFT-1238 Thrift JS client cannot read map of structures(TestCase)
Patch: Henrique Mendonca
git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1147301 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/js/test/build.xml b/lib/js/test/build.xml
index bd2faf2..32316a1 100644
--- a/lib/js/test/build.xml
+++ b/lib/js/test/build.xml
@@ -59,7 +59,10 @@
<condition>
<not>
<resourcecount count="2">
- <fileset id="fs" dir="${thrift.java.dir}/build" includes="libthrift*.jar"/>
+ <fileset id="fs" dir="${thrift.java.dir}/build">
+ <include name="libthrift*.jar" />
+ <exclude name="libthrift*javadoc.jar" />
+ </fileset>
</resourcecount>
</not>
</condition>
diff --git a/lib/js/test/test.html b/lib/js/test/test.html
index bd124af..5039edb 100644
--- a/lib/js/test/test.html
+++ b/lib/js/test/test.html
@@ -215,9 +215,47 @@
module("Insanity");
test("testInsanity", function() {
- var insanity;
- var res = client.testInsanity(insanity);
- ok(res);
+ var insanity = {
+ "1":{
+ "3":{
+ "userMap":{ "8":8, "5":5 },
+ "xtructs":[{
+ "string_thing":"Goodbye4",
+ "byte_thing":4,
+ "i32_thing":4,
+ "i64_thing":4
+ },
+ {
+ "string_thing":"Hello2",
+ "byte_thing":2,
+ "i32_thing":2,
+ "i64_thing":2
+ }
+ ]
+ },
+ "2":{
+ "userMap":{ "8":8, "5":5 },
+ "xtructs":[{
+ "string_thing":"Goodbye4",
+ "byte_thing":4,
+ "i32_thing":4,
+ "i64_thing":4
+ },
+ {
+ "string_thing":"Hello2",
+ "byte_thing":2,
+ "i32_thing":2,
+ "i64_thing":2
+ }
+ ]
+ }
+ },
+ "2":{ "6":{ "userMap":null, "xtructs":null } }
+ };
+ var res = client.testInsanity("");
+ ok(res, JSON.stringify(res));
+ ok(insanity, JSON.stringify(insanity));
+ equals(JSON.stringify(res), JSON.stringify(insanity)) //TODO: read and compare maps recursively
});