Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
officejs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
officejs
Commits
3aed3a8c
Commit
3aed3a8c
authored
Aug 21, 2012
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update dummy storages + jio tests
parent
028cbd19
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
13 deletions
+21
-13
OfficeJS/src/jio.dummystorages.js
OfficeJS/src/jio.dummystorages.js
+4
-4
OfficeJS/test/jiotests.js
OfficeJS/test/jiotests.js
+17
-9
No files found.
OfficeJS/src/jio.dummystorages.js
View file @
3aed3a8c
...
@@ -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:
...
...
OfficeJS/test/jiotests.js
View file @
3aed3a8c
...
@@ -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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment