Commit 3aed3a8c authored by Tristan Cavelier's avatar Tristan Cavelier

Update dummy storages + jio tests

parent 028cbd19
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
// Dummy Storage 1 : all ok // Dummy Storage 1 : all ok
var newDummyStorageAllOk = function ( spec, my ) { var newDummyStorageAllOk = function ( spec, my ) {
var that = Jio.storage( spec, my, 'base' ); var that = my.basicStorage( spec, my );
var super_serialized = that.serialized; var super_serialized = that.serialized;
that.serialized = function () { that.serialized = function () {
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
// Dummy Storage 2 : all fail // Dummy Storage 2 : all fail
newDummyStorageAllFail = function ( spec, my ) { newDummyStorageAllFail = function ( spec, my ) {
var that = Jio.storage( spec, my, 'base' ), priv = {}; var that = my.basicStorage( spec, my ), priv = {};
priv.error = function () { priv.error = function () {
setTimeout (function () { setTimeout (function () {
...@@ -130,7 +130,7 @@ ...@@ -130,7 +130,7 @@
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
// Dummy Storage 3 : all not found // Dummy Storage 3 : all not found
newDummyStorageAllNotFound = function ( spec, my ) { newDummyStorageAllNotFound = function ( spec, my ) {
var that = Jio.storage( spec, my, 'base' ); var that = my.basicStorage( spec, my );
that.post = function (command) { that.post = function (command) {
setTimeout (function () { setTimeout (function () {
...@@ -187,7 +187,7 @@ ...@@ -187,7 +187,7 @@
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
// Dummy Storage 4 : all 3 tries // Dummy Storage 4 : all 3 tries
newDummyStorageAll3Tries = function ( spec, my ) { newDummyStorageAll3Tries = function ( spec, my ) {
var that = Jio.storage( spec, my, 'base' ), priv = {}; var that = my.basicStorage( spec, my ), priv = {};
// this serialized method is used to make simple difference between // this serialized method is used to make simple difference between
// two dummyall3tries storages: // two dummyall3tries storages:
......
...@@ -691,11 +691,13 @@ test ('Document load', function () { ...@@ -691,11 +691,13 @@ test ('Document load', function () {
o.mytest = function (message,doc,errprop,errget) { o.mytest = function (message,doc,errprop,errget) {
var server = o.t.sandbox.useFakeServer(); var server = o.t.sandbox.useFakeServer();
server.respondWith ( server.respondWith (
"PROPFIND","https://ca-davstorage:8080/davload/jiotests/file", "PROPFIND",
/https:\/\/ca-davstorage:8080\/davload\/jiotests\/file(\?.*|$)/,
[errprop,{'Content-Type':'text/xml; charset="utf-8"'}, [errprop,{'Content-Type':'text/xml; charset="utf-8"'},
o.davload]); o.davload]);
server.respondWith ( server.respondWith (
"GET","https://ca-davstorage:8080/davload/jiotests/file", "GET",
/https:\/\/ca-davstorage:8080\/davload\/jiotests\/file(\?.*|$)/,
[errget,{},'content']); [errget,{},'content']);
o.f = function (err,val) { o.f = function (err,val) {
if (err) { if (err) {
...@@ -747,16 +749,18 @@ test ('Document save', function () { ...@@ -747,16 +749,18 @@ test ('Document save', function () {
var server = o.t.sandbox.useFakeServer(); var server = o.t.sandbox.useFakeServer();
server.respondWith ( server.respondWith (
// lastmodified = 7000, creationdate = 5000 // lastmodified = 7000, creationdate = 5000
"PROPFIND","https://ca-davstorage:8080/davsave/jiotests/file", "PROPFIND",
/https:\/\/ca-davstorage:8080\/davsave\/jiotests\/file(\?.*|$)/,
[errnoprop,{'Content-Type':'text/xml; charset="utf-8"'}, [errnoprop,{'Content-Type':'text/xml; charset="utf-8"'},
o.davsave]); o.davsave]);
server.respondWith ( server.respondWith (
"PUT", "PUT",
"https://ca-davstorage:8080/davsave/jiotests/file", /https:\/\/ca-davstorage:8080\/davsave\/jiotests\/file(\?.*|$)/,
[errnoput, {'Content-Type':'x-www-form-urlencoded'}, [errnoput, {'Content-Type':'x-www-form-urlencoded'},
'content']); 'content']);
server.respondWith ( server.respondWith (
"GET","https://ca-davstorage:8080/davsave/jiotests/file", "GET",
/https:\/\/ca-davstorage:8080\/davsave\/jiotests\/file(\?.*|$)/,
[errnoprop===207?200:errnoprop,{},'content']); [errnoprop===207?200:errnoprop,{},'content']);
// server.respondWith ("MKCOL","https://ca-davstorage:8080/dav", // server.respondWith ("MKCOL","https://ca-davstorage:8080/dav",
// [200,{},'']); // [200,{},'']);
...@@ -811,14 +815,17 @@ test ('Get Document List', function () { ...@@ -811,14 +815,17 @@ test ('Get Document List', function () {
o.mytest = function (message,metadata_only,value,errnoprop) { o.mytest = function (message,metadata_only,value,errnoprop) {
var server = o.t.sandbox.useFakeServer(); var server = o.t.sandbox.useFakeServer();
server.respondWith ( server.respondWith (
"PROPFIND",'https://ca-davstorage:8080/davlist/jiotests/', "PROPFIND",
/https:\/\/ca-davstorage:8080\/davlist\/jiotests\/(\?.*|$)/,
[errnoprop,{'Content-Type':'text/xml; charset="utf-8"'}, [errnoprop,{'Content-Type':'text/xml; charset="utf-8"'},
o.davlist]); o.davlist]);
server.respondWith ( server.respondWith (
"GET","https://ca-davstorage:8080/davlist/jiotests/file", "GET",
/https:\/\/ca-davstorage:8080\/davlist\/jiotests\/file(\?.*|$)/,
[200,{},'content']); [200,{},'content']);
server.respondWith ( server.respondWith (
"GET","https://ca-davstorage:8080/davlist/jiotests/memo", "GET",
/https:\/\/ca-davstorage:8080\/davlist\/jiotests\/memo(\?.*|$)/,
[200,{},'content2']); [200,{},'content2']);
o.f = function (err,val) { o.f = function (err,val) {
if (err) { if (err) {
...@@ -886,7 +893,8 @@ test ('Remove document', function () { ...@@ -886,7 +893,8 @@ test ('Remove document', function () {
o.mytest = function (message,value,errnodel) { o.mytest = function (message,value,errnodel) {
var server = o.t.sandbox.useFakeServer(); var server = o.t.sandbox.useFakeServer();
server.respondWith ( server.respondWith (
"DELETE","https://ca-davstorage:8080/davremove/jiotests/file", "DELETE",
/https:\/\/ca-davstorage:8080\/davremove\/jiotests\/file(\?.*|$)/,
[errnodel,{},'']); [errnodel,{},'']);
o.f = function (err,val) { o.f = function (err,val) {
if (err) { if (err) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment