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
8d661832
Commit
8d661832
authored
May 03, 2012
by
Tristan Cavelier
Committed by
Sebastien Robin
May 18, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding Dummy storages to jiotests.
And fixing some bugs inside jio.dummystorages.js
parent
ad4a0869
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
1 deletion
+61
-1
jiotest/index.html
jiotest/index.html
+1
-0
jiotest/jio.dummystorages.js
jiotest/jio.dummystorages.js
+3
-1
jiotest/jiotests.js
jiotest/jiotests.js
+57
-0
No files found.
jiotest/index.html
View file @
8d661832
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
<script
type=
"text/javascript"
src=
"unhosted/localorcookiestorage.js"
></script>
<script
type=
"text/javascript"
src=
"unhosted/localorcookiestorage.js"
></script>
<script
type=
"text/javascript"
src=
"unhosted/jio.js"
></script>
<script
type=
"text/javascript"
src=
"unhosted/jio.js"
></script>
<script
type=
"text/javascript"
src=
"unhosted/base64.js"
></script>
<script
type=
"text/javascript"
src=
"unhosted/base64.js"
></script>
<script
type=
"text/javascript"
src=
"jio.dummystorages.js"
></script>
<script
type=
"text/javascript"
src=
"unhosted/jio.storage.js"
></script>
<script
type=
"text/javascript"
src=
"unhosted/jio.storage.js"
></script>
<script
type=
"text/javascript"
src=
"sinon/sinon-1.3.4.js"
></script>
<script
type=
"text/javascript"
src=
"sinon/sinon-1.3.4.js"
></script>
<script
type=
"text/javascript"
src=
"sinon/sinon-qunit-1.0.0.js"
></script>
<script
type=
"text/javascript"
src=
"sinon/sinon-qunit-1.0.0.js"
></script>
...
...
jiotest/jio.dummystorages.js
View file @
8d661832
...
@@ -110,7 +110,7 @@
...
@@ -110,7 +110,7 @@
{
'
fileName
'
:
'
memo
'
,
{
'
fileName
'
:
'
memo
'
,
'
creationDate
'
:
20000
,
'
creationDate
'
:
20000
,
'
lastModified
'
:
25000
'
lastModified
'
:
25000
}]
)
;
}];
res
.
status
=
job
.
status
=
'
done
'
;
res
.
status
=
job
.
status
=
'
done
'
;
res
.
message
=
'
List received.
'
;
res
.
message
=
'
List received.
'
;
jobendcallback
(
job
);
jobendcallback
(
job
);
...
@@ -224,6 +224,7 @@
...
@@ -224,6 +224,7 @@
// 'lastModified':date,'creationDate':date}
// 'lastModified':date,'creationDate':date}
setTimeout
(
function
()
{
setTimeout
(
function
()
{
var
res
=
{};
res
.
status
=
job
.
status
=
'
fail
'
;
res
.
status
=
job
.
status
=
'
fail
'
;
res
.
message
=
'
Cannot get document list.
'
;
res
.
message
=
'
Cannot get document list.
'
;
res
.
errno
=
0
;
res
.
errno
=
0
;
...
@@ -337,6 +338,7 @@
...
@@ -337,6 +338,7 @@
// 'lastModified':date,'creationDate':date}
// 'lastModified':date,'creationDate':date}
setTimeout
(
function
()
{
setTimeout
(
function
()
{
var
res
=
{};
res
.
status
=
job
.
status
=
'
fail
'
;
res
.
status
=
job
.
status
=
'
fail
'
;
res
.
message
=
'
User collection not found.
'
;
res
.
message
=
'
User collection not found.
'
;
res
.
errno
=
404
;
res
.
errno
=
404
;
...
...
jiotest/jiotests.js
View file @
8d661832
...
@@ -74,6 +74,63 @@ test ( 'Jio Publish/Sububscribe/Unsubscribe methods', function () {
...
@@ -74,6 +74,63 @@ test ( 'Jio Publish/Sububscribe/Unsubscribe methods', function () {
o
.
jio
.
stop
();
o
.
jio
.
stop
();
});
});
module
(
'
Jio Dummy Storages
'
);
test
(
'
All tests
'
,
function
()
{
// Tests all dummy storages from jio.dummystorages.js
// It is simple tests, but they will be used by replicate storage later
// for sync operation.
var
o
=
{};
var
clock
=
this
.
sandbox
.
useFakeTimers
();
var
t
=
this
;
var
mytest
=
function
(
message
,
method
,
retmethod
,
value
){
o
.
f
=
function
(
result
)
{
deepEqual
(
result
[
retmethod
],
value
,
message
);};
t
.
spy
(
o
,
'
f
'
);
o
.
jio
[
method
]({
'
userName
'
:
'
Dummy
'
,
'
fileName
'
:
'
file
'
,
'
fileContent
'
:
'
content
'
,
'
callback
'
:
o
.
f
});
clock
.
tick
(
510
);
if
(
!
o
.
f
.
calledOnce
)
ok
(
false
,
'
no response / too much results
'
);
};
// All Ok Dummy Storage
o
.
jio
=
JIO
.
createNew
({
'
type
'
:
'
dummyallok
'
,
'
userName
'
:
'
Dummy
'
},
{
'
ID
'
:
'
jiotests
'
});
mytest
(
'
check name availability OK
'
,
'
checkNameAvailability
'
,
'
isAvailable
'
,
true
);
mytest
(
'
save document OK
'
,
'
saveDocument
'
,
'
isSaved
'
,
true
);
mytest
(
'
load document OK
'
,
'
loadDocument
'
,
'
document
'
,
{
'
fileName
'
:
'
file
'
,
'
fileContent
'
:
'
content
'
,
'
lastModified
'
:
15000
,
'
creationDate
'
:
10000
});
mytest
(
'
get document list OK
'
,
'
getDocumentList
'
,
'
list
'
,
[{
'
fileName
'
:
'
file
'
,
'
creationDate
'
:
10000
,
'
lastModified
'
:
15000
},
{
'
fileName
'
:
'
memo
'
,
'
creationDate
'
:
20000
,
'
lastModified
'
:
25000
}]);
mytest
(
'
remove document OK
'
,
'
removeDocument
'
,
'
isRemoved
'
,
true
);
o
.
jio
.
stop
();
// All Fail Dummy Storage
o
.
jio
=
JIO
.
createNew
({
'
type
'
:
'
dummyallfail
'
,
'
userName
'
:
'
Dummy
'
},
{
'
ID
'
:
'
jiotests
'
});
mytest
(
'
check name availability FAIL
'
,
'
checkNameAvailability
'
,
'
isAvailable
'
,
false
);
mytest
(
'
save document FAIL
'
,
'
saveDocument
'
,
'
isSaved
'
,
false
);
mytest
(
'
load document FAIL
'
,
'
loadDocument
'
,
'
document
'
,{});
mytest
(
'
get document list FAIL
'
,
'
getDocumentList
'
,
'
list
'
,
undefined
);
mytest
(
'
remove document FAIL
'
,
'
removeDocument
'
,
'
isRemoved
'
,
false
);
o
.
jio
.
stop
();
// All Not Found Dummy Storage
o
.
jio
=
JIO
.
createNew
({
'
type
'
:
'
dummyallnotfound
'
,
'
userName
'
:
'
Dummy
'
},
{
'
ID
'
:
'
jiotests
'
});
mytest
(
'
check name availability NOT FOUND
'
,
'
checkNameAvailability
'
,
'
isAvailable
'
,
true
);
mytest
(
'
save document NOT FOUND
'
,
'
saveDocument
'
,
'
isSaved
'
,
true
);
mytest
(
'
load document NOT FOUND
'
,
'
loadDocument
'
,
'
document
'
,{});
mytest
(
'
get document list NOT FOUND
'
,
'
getDocumentList
'
,
'
list
'
,
undefined
);
mytest
(
'
remove document NOT FOUND
'
,
'
removeDocument
'
,
'
isRemoved
'
,
true
);
o
.
jio
.
stop
();
});
module
(
'
Jio LocalStorage
'
);
module
(
'
Jio LocalStorage
'
);
test
(
'
Check name availability
'
,
function
()
{
test
(
'
Check name availability
'
,
function
()
{
...
...
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