From: <max...@us...> - 2011-05-06 10:18:37
|
Revision: 4323 http://mxquery.svn.sourceforge.net/mxquery/?rev=4323&view=rev Author: maxspeicher Date: 2011-05-06 10:18:30 +0000 (Fri, 06 May 2011) Log Message: ----------- - minor fixes concerning Android testsuite - added dom-implementation-registry.jar to libs (not natively supported by Android) Modified Paths: -------------- trunk/MXQuery_Testing/build.xml Added Paths: ----------- trunk/MXQuery_Testing/lib/dom-implementation-registry.jar Modified: trunk/MXQuery_Testing/build.xml =================================================================== --- trunk/MXQuery_Testing/build.xml 2011-05-06 09:45:17 UTC (rev 4322) +++ trunk/MXQuery_Testing/build.xml 2011-05-06 10:18:30 UTC (rev 4323) @@ -29,6 +29,10 @@ <pathelement location="${build.dir}"/> <fileset dir="${resources.dir}"> <include name="*.jar"/> + <exclude name="j2meunit.jar"/> + <exclude name="xml-apis.jar"/> + <exclude name="serializer.jar"/> + <exclude name="xalan.jar"/> </fileset> <fileset dir="${sdk.dir}"> <include name="platforms/android-8/android.jar"/> @@ -197,7 +201,6 @@ <delete dir="${androidtmp.dir}/ch/ethz/mxquery/test/dmcq/"/> <delete> <fileset dir="${androidtmp.dir}/ch/ethz/mxquery/test/"> - <include name="TypeTest.java"/> <include name="XQScriptingTest.java"/> <include name="XQUpdateTest.java"/> </fileset> @@ -205,14 +208,12 @@ <delete> <fileset dir="${androidtmp.dir}/ch/ethz/mxquery/testsuite/"> <include name="TestSuiteGUI.java"/> - <include name="TestSuiteUpdate.java"/> </fileset> </delete> <delete> <fileset dir="${androidtmp.dir}/ch/ethz/mxquery/testsuite/internal/"> <include name="CustomIcon.java"/> <include name="CustomListCellRenderer.java"/> - <include name="TestCaseUpdate.java"/> </fileset> </delete> </target> Added: trunk/MXQuery_Testing/lib/dom-implementation-registry.jar =================================================================== (Binary files differ) Property changes on: trunk/MXQuery_Testing/lib/dom-implementation-registry.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pm_...@us...> - 2011-12-20 22:01:00
|
Revision: 4506 http://mxquery.svn.sourceforge.net/mxquery/?rev=4506&view=rev Author: pm_fischer Date: 2011-12-20 22:00:54 +0000 (Tue, 20 Dec 2011) Log Message: ----------- More JSON tests Added Paths: ----------- trunk/MXQuery_Testing/XQTests/ExpectedResults/json/ trunk/MXQuery_Testing/XQTests/ExpectedResults/json/json_array.xml trunk/MXQuery_Testing/XQTests/ExpectedResults/json/json_array_simple.xml trunk/MXQuery_Testing/XQTests/ExpectedResults/json/json_object_simple.xml trunk/MXQuery_Testing/XQTests/ExpectedResults/json/json_object_simple2.xml trunk/MXQuery_Testing/XQTests/ExpectedResults/json/json_snelson.xml trunk/MXQuery_Testing/XQTests/Queries/json/ trunk/MXQuery_Testing/XQTests/Queries/json/json_array.xq trunk/MXQuery_Testing/XQTests/Queries/json/json_array_simple.xq trunk/MXQuery_Testing/XQTests/Queries/json/json_object_simple.xq trunk/MXQuery_Testing/XQTests/Queries/json/json_object_simple2.xq trunk/MXQuery_Testing/XQTests/Queries/json/json_snelson.xq trunk/MXQuery_Testing/src/ch/ethz/mxquery/test/WebService/JSONTest.java Added: trunk/MXQuery_Testing/XQTests/ExpectedResults/json/json_array.xml =================================================================== --- trunk/MXQuery_Testing/XQTests/ExpectedResults/json/json_array.xml (rev 0) +++ trunk/MXQuery_Testing/XQTests/ExpectedResults/json/json_array.xml 2011-12-20 22:00:54 UTC (rev 4506) @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="UTF-8"?> +<json type="array"><pair type="object"><pair name="type" type="string">home</pair><pair name="number" type="string">212 555-1234</pair></pair><item type="null"/><pair type="object"><pair name="type" type="string">fax</pair><pair name="number" type="string">646 555-4567</pair></pair></json> \ No newline at end of file Added: trunk/MXQuery_Testing/XQTests/ExpectedResults/json/json_array_simple.xml =================================================================== --- trunk/MXQuery_Testing/XQTests/ExpectedResults/json/json_array_simple.xml (rev 0) +++ trunk/MXQuery_Testing/XQTests/ExpectedResults/json/json_array_simple.xml 2011-12-20 22:00:54 UTC (rev 4506) @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="UTF-8"?> +<json type="array"><item type="string">Hello</item><item type="string">World</item></json> \ No newline at end of file Added: trunk/MXQuery_Testing/XQTests/ExpectedResults/json/json_object_simple.xml =================================================================== --- trunk/MXQuery_Testing/XQTests/ExpectedResults/json/json_object_simple.xml (rev 0) +++ trunk/MXQuery_Testing/XQTests/ExpectedResults/json/json_object_simple.xml 2011-12-20 22:00:54 UTC (rev 4506) @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="UTF-8"?> +<json type="object"><pair name="type" type="string">home</pair></json> \ No newline at end of file Added: trunk/MXQuery_Testing/XQTests/ExpectedResults/json/json_object_simple2.xml =================================================================== --- trunk/MXQuery_Testing/XQTests/ExpectedResults/json/json_object_simple2.xml (rev 0) +++ trunk/MXQuery_Testing/XQTests/ExpectedResults/json/json_object_simple2.xml 2011-12-20 22:00:54 UTC (rev 4506) @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="UTF-8"?> +<json type="object"><pair name="number" type="string">212 555-1234</pair><pair name="type" type="string">home</pair></json> \ No newline at end of file Added: trunk/MXQuery_Testing/XQTests/ExpectedResults/json/json_snelson.xml =================================================================== --- trunk/MXQuery_Testing/XQTests/ExpectedResults/json/json_snelson.xml (rev 0) +++ trunk/MXQuery_Testing/XQTests/ExpectedResults/json/json_snelson.xml 2011-12-20 22:00:54 UTC (rev 4506) @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="UTF-8"?> +<json type="object"><pair name="lastName" type="string">Smith</pair><pair name="address" type="object"><pair name="streetAddress" type="string">21 2nd Street</pair><pair name="postalCode" type="number">10021</pair><pair name="state" type="string">NY</pair><pair name="city" type="string">New York</pair></pair><pair name="phoneNumbers" type="array"><item type="string">212 732-1234</item><item type="string">646 123-4567</item></pair><pair name="firstName" type="string">John</pair></json> \ No newline at end of file Added: trunk/MXQuery_Testing/XQTests/Queries/json/json_array.xq =================================================================== --- trunk/MXQuery_Testing/XQTests/Queries/json/json_array.xq (rev 0) +++ trunk/MXQuery_Testing/XQTests/Queries/json/json_array.xq 2011-12-20 22:00:54 UTC (rev 4506) @@ -0,0 +1,6 @@ +import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; + +let $j_string := ' +[{"type" : "home", "number": "212 555-1234"}, null, + { "type" : "fax", "number": "646 555-4567" } ]' +return json:parse($j_string) Added: trunk/MXQuery_Testing/XQTests/Queries/json/json_array_simple.xq =================================================================== --- trunk/MXQuery_Testing/XQTests/Queries/json/json_array_simple.xq (rev 0) +++ trunk/MXQuery_Testing/XQTests/Queries/json/json_array_simple.xq 2011-12-20 22:00:54 UTC (rev 4506) @@ -0,0 +1,3 @@ +import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; +let $j_string := '["Hello","World"]' +return json:parse($j_string) \ No newline at end of file Added: trunk/MXQuery_Testing/XQTests/Queries/json/json_object_simple.xq =================================================================== --- trunk/MXQuery_Testing/XQTests/Queries/json/json_object_simple.xq (rev 0) +++ trunk/MXQuery_Testing/XQTests/Queries/json/json_object_simple.xq 2011-12-20 22:00:54 UTC (rev 4506) @@ -0,0 +1,4 @@ +import module namespace + json = "http://www.zorba-xquery.com/modules/converters/json"; + +json:parse('{"type" : "home"}') \ No newline at end of file Added: trunk/MXQuery_Testing/XQTests/Queries/json/json_object_simple2.xq =================================================================== --- trunk/MXQuery_Testing/XQTests/Queries/json/json_object_simple2.xq (rev 0) +++ trunk/MXQuery_Testing/XQTests/Queries/json/json_object_simple2.xq 2011-12-20 22:00:54 UTC (rev 4506) @@ -0,0 +1,4 @@ +import module namespace + json = "http://www.zorba-xquery.com/modules/converters/json"; + +json:parse('{"type" : "home", "number": "212 555-1234"}') \ No newline at end of file Added: trunk/MXQuery_Testing/XQTests/Queries/json/json_snelson.xq =================================================================== --- trunk/MXQuery_Testing/XQTests/Queries/json/json_snelson.xq (rev 0) +++ trunk/MXQuery_Testing/XQTests/Queries/json/json_snelson.xq 2011-12-20 22:00:54 UTC (rev 4506) @@ -0,0 +1,15 @@ +import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; +json:parse('{ + "firstName": "John", + "lastName": "Smith", + "address": { + "streetAddress": "21 2nd Street", + "city": "New York", + "state": "NY", + "postalCode": 10021 + }, + "phoneNumbers": [ + "212 732-1234", + "646 123-4567" + ] + }') \ No newline at end of file Added: trunk/MXQuery_Testing/src/ch/ethz/mxquery/test/WebService/JSONTest.java =================================================================== --- trunk/MXQuery_Testing/src/ch/ethz/mxquery/test/WebService/JSONTest.java (rev 0) +++ trunk/MXQuery_Testing/src/ch/ethz/mxquery/test/WebService/JSONTest.java 2011-12-20 22:00:54 UTC (rev 4506) @@ -0,0 +1,54 @@ +package ch.ethz.mxquery.test.WebService; + +import ch.ethz.mxquery.query.PreparedStatement; +import ch.ethz.mxquery.testsuite.XQueryTestBase; + +public class JSONTest extends XQueryTestBase { + + protected static final String JSON_QUERY_PATH = "XQTests/Queries/json/"; + protected static final String JSON_RESULT_PATH = "XQTests/ExpectedResults/json/"; + + public void test_simpleArray() throws Exception{ + String query = UriToString(JSON_QUERY_PATH+"json_array_simple.xq"); + PreparedStatement expr = prepareQuery(query, false, true, false, false, false); + doQuery(expr); + assertXMLEqual(UriToString(JSON_RESULT_PATH+"json_array_simple.xml"),resultBuffer.toString()); + //assertEquals(UriToString(expected_results+"Q01_Google_Spelling_Suggestion.xml"),myBuffer.toString().trim()); + } + + public void test_simpleObject() throws Exception{ + String query = UriToString(JSON_QUERY_PATH+"json_object_simple.xq"); + PreparedStatement expr = prepareQuery(query, false, true, false, false, false); + doQuery(expr); + assertXMLEqual(UriToString(JSON_RESULT_PATH+"json_object_simple.xml"),resultBuffer.toString()); + //assertEquals(UriToString(expected_results+"Q01_Google_Spelling_Suggestion.xml"),myBuffer.toString().trim()); + } + + public void test_simpleObject2() throws Exception{ + String query = UriToString(JSON_QUERY_PATH+"json_object_simple2.xq"); + PreparedStatement expr = prepareQuery(query, false, true, false, false, false); + doQuery(expr); + System.out.println(resultBuffer.toString()); + assertXMLEqual(UriToString(JSON_RESULT_PATH+"json_object_simple2.xml"),resultBuffer.toString()); + //assertEquals(UriToString(expected_results+"Q01_Google_Spelling_Suggestion.xml"),myBuffer.toString().trim()); + } + + public void test_Array() throws Exception{ + String query = UriToString(JSON_QUERY_PATH+"json_array.xq"); + PreparedStatement expr = prepareQuery(query, false, true, false, false, false); + doQuery(expr); + assertXMLEqual(UriToString(JSON_RESULT_PATH+"json_array.xml"),resultBuffer.toString()); + //assertEquals(UriToString(expected_results+"Q01_Google_Spelling_Suggestion.xml"),myBuffer.toString().trim()); + } + + public void test_Snelson() throws Exception{ + String query = UriToString(JSON_QUERY_PATH+"json_snelson.xq"); + PreparedStatement expr = prepareQuery(query, false, true, false, false, false); + doQuery(expr); + //System.out.println(resultBuffer.toString()); + assertXMLEqual(UriToString(JSON_RESULT_PATH+"json_snelson.xml"),resultBuffer.toString()); + //assertEquals(UriToString(expected_results+"Q01_Google_Spelling_Suggestion.xml"),myBuffer.toString().trim()); + } + + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |