diff options
author | mensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f> | 2008-11-14 15:39:19 +0000 |
---|---|---|
committer | mensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f> | 2008-11-14 15:39:19 +0000 |
commit | 1c5685d68f1b73270fb814fe04cbb490eb90ba5f (patch) | |
tree | 3d3ada08a934b96fc31531f1327690d7edc6f766 /includes/js/dojo/tests/rpc.js | |
parent | 104d59099e048688c4dbac37d72137006e396558 (diff) | |
download | semanticscuttle-1c5685d68f1b73270fb814fe04cbb490eb90ba5f.tar.gz semanticscuttle-1c5685d68f1b73270fb814fe04cbb490eb90ba5f.tar.bz2 |
Minor fix: Remove DOJO library (60Mo) replaced by link to Google CDN (online DOJO library)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@159 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'includes/js/dojo/tests/rpc.js')
-rw-r--r-- | includes/js/dojo/tests/rpc.js | 151 |
1 files changed, 0 insertions, 151 deletions
diff --git a/includes/js/dojo/tests/rpc.js b/includes/js/dojo/tests/rpc.js deleted file mode 100644 index 09c8ef2..0000000 --- a/includes/js/dojo/tests/rpc.js +++ /dev/null @@ -1,151 +0,0 @@ -if(!dojo._hasResource["tests.rpc"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests.rpc"] = true; -dojo.provide("tests.rpc"); - -dojo.require("dojo.rpc.RpcService"); -dojo.require("dojo.rpc.JsonService"); -dojo.require("dojo.rpc.JsonpService"); - -doh.register("tests.rpc", - [ - - { - name: "JsonRPC-EchoTest", - timeout: 2000, - setUp: function(){ - - var testSmd = { - serviceURL:"../../dojo/tests/resources/test_JsonRPCMediator.php", - methods:[ - { - name:"myecho", - parameters:[ - { - name:"somestring", - type:"STRING" - } - ] - } - ] - } - - this.svc = new dojo.rpc.JsonService(testSmd); - }, - runTest: function(){ - var d = new doh.Deferred(); - var td = this.svc.myecho("RPC TEST"); - - if (window.location.protocol=="file:") { - var err= new Error("This Test requires a webserver and PHP and will fail intentionally if loaded from file://"); - d.errback(err); - return d; - } - - td.addCallbacks(function(result) { - if(result=="<P>RPC TEST</P>"){ - return true; - }else{ - return new Error("JsonRpc-EchoTest test failed, resultant content didn't match"); - } - }, function(result){ - return new Error(result); - }); - - td.addBoth(d, "callback"); - - return d; - } - - }, - - { - name: "JsonRPC-EmptyParamTest", - timeout: 2000, - setUp: function(){ - var testSmd={ - serviceURL:"../../dojo/tests/resources/test_JsonRPCMediator.php", - methods:[ { name:"contentB" } ] - } - - this.svc = new dojo.rpc.JsonService(testSmd); - }, - runTest: function(){ - var d = new doh.Deferred(); - var td = this.svc.contentB(); - - if (window.location.protocol=="file:") { - var err= new Error("This Test requires a webserver and PHP and will fail intentionally if loaded from file://"); - d.errback(err); - return d; - } - - td.addCallbacks(function(result){ - if(result=="<P>Content B</P>"){ - return true; - }else{ - return new Error("JsonRpc-EmpytParamTest test failed, resultant content didn't match"); - } - }, function(result){ - return new Error(result); - }); - - td.addBoth(d, "callback"); - - return d; - } - }, - - { - name: "JsonRPC_SMD_Loading_test", - setUp: function(){ - this.svc = new dojo.rpc.JsonService("../../dojo/tests/resources/testClass.smd"); - }, - runTest: function(){ - - if (this.svc.objectName=="testClass") { - return true; - } else { - return new Error("Error loading and/or parsing an smd file"); - } - } - }, - - { - name: "JsonP_test", - timeout: 10000, - setUp: function(){ - this.svc = new dojo.rpc.JsonpService(dojo.moduleUrl("dojo.tests.resources","yahoo_smd_v1.smd"), {appid: "foo"}); - }, - runTest: function(){ - var d = new doh.Deferred(); - - if (window.location.protocol=="file:") { - var err= new Error("This Test requires a webserver and will fail intentionally if loaded from file://"); - d.errback(err); - return d; - } - - var td = this.svc.webSearch({query:"dojotoolkit"}); - - td.addCallbacks(function(result){ - return true; - if (result["ResultSet"]["Result"][0]["DisplayUrl"]=="dojotoolkit.org/") { - return true; - }else{ - return new Error("JsonRpc_SMD_Loading_Test failed, resultant content didn't match"); - } - }, function(result){ - return new Error(result); - }); - - td.addBoth(d, "callback"); - - return d; - } - } - ] -); - - - -} |