Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jio
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
Sven Franck
jio
Commits
d7efabc2
Commit
d7efabc2
authored
Jan 08, 2013
by
Sebastien Robin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename secondstorage to sub_storage
parent
6b2cdf90
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
56 additions
and
56 deletions
+56
-56
src/jio.storage/conflictmanagerstorage.js
src/jio.storage/conflictmanagerstorage.js
+10
-10
src/jio.storage/cryptstorage.js
src/jio.storage/cryptstorage.js
+7
-7
src/jio.storage/indexstorage.js
src/jio.storage/indexstorage.js
+12
-12
src/jio.storage/revisionstorage.js
src/jio.storage/revisionstorage.js
+2
-2
src/jio.waitstorage.js
src/jio.waitstorage.js
+5
-5
test/jiotests.js
test/jiotests.js
+20
-20
No files found.
src/jio.storage/conflictmanagerstorage.js
View file @
d7efabc2
...
@@ -3,18 +3,18 @@ var newConflictManagerStorage = function ( spec, my ) {
...
@@ -3,18 +3,18 @@ var newConflictManagerStorage = function ( spec, my ) {
var
that
=
my
.
basicStorage
(
spec
,
my
),
priv
=
{};
var
that
=
my
.
basicStorage
(
spec
,
my
),
priv
=
{};
var
storage_exists
=
(
spec
.
storage
?
true
:
false
);
var
storage_exists
=
(
spec
.
storage
?
true
:
false
);
priv
.
s
econd
storage_spec
=
spec
.
storage
||
{
type
:
'
base
'
};
priv
.
s
ub_
storage_spec
=
spec
.
storage
||
{
type
:
'
base
'
};
priv
.
s
econdstorage_string
=
JSON
.
stringify
(
priv
.
second
storage_spec
);
priv
.
s
ub_storage_string
=
JSON
.
stringify
(
priv
.
sub_
storage_spec
);
var
local_namespace
=
'
jio/conflictmanager/
'
+
var
local_namespace
=
'
jio/conflictmanager/
'
+
priv
.
s
econd
storage_string
+
'
/
'
;
priv
.
s
ub_
storage_string
+
'
/
'
;
var
empty_fun
=
function
(){};
var
empty_fun
=
function
(){};
var
super_serialized
=
that
.
serialized
;
var
super_serialized
=
that
.
serialized
;
that
.
serialized
=
function
()
{
that
.
serialized
=
function
()
{
var
o
=
super_serialized
();
var
o
=
super_serialized
();
o
.
storage
=
priv
.
s
econd
storage_spec
;
o
.
storage
=
priv
.
s
ub_
storage_spec
;
return
o
;
return
o
;
};
};
...
@@ -28,29 +28,29 @@ var newConflictManagerStorage = function ( spec, my ) {
...
@@ -28,29 +28,29 @@ var newConflictManagerStorage = function ( spec, my ) {
priv
.
getDistantMetadata
=
function
(
command
,
path
,
success
,
error
)
{
priv
.
getDistantMetadata
=
function
(
command
,
path
,
success
,
error
)
{
var
cloned_option
=
command
.
cloneOption
();
var
cloned_option
=
command
.
cloneOption
();
cloned_option
.
metadata_only
=
false
;
cloned_option
.
metadata_only
=
false
;
that
.
addJob
(
'
get
'
,
priv
.
s
econd
storage_spec
,
path
,
cloned_option
,
that
.
addJob
(
'
get
'
,
priv
.
s
ub_
storage_spec
,
path
,
cloned_option
,
success
,
error
);
success
,
error
);
};
};
priv
.
saveMetadataToDistant
=
function
(
command
,
path
,
content
,
success
,
error
)
{
priv
.
saveMetadataToDistant
=
function
(
command
,
path
,
content
,
success
,
error
)
{
that
.
addJob
(
'
put
'
,
priv
.
s
econd
storage_spec
,
that
.
addJob
(
'
put
'
,
priv
.
s
ub_
storage_spec
,
{
_id
:
path
,
content
:
JSON
.
stringify
(
content
)},
{
_id
:
path
,
content
:
JSON
.
stringify
(
content
)},
command
.
cloneOption
(),
success
,
error
);
command
.
cloneOption
(),
success
,
error
);
};
};
priv
.
saveNewRevision
=
function
(
command
,
path
,
content
,
success
,
error
)
{
priv
.
saveNewRevision
=
function
(
command
,
path
,
content
,
success
,
error
)
{
that
.
addJob
(
'
post
'
,
priv
.
s
econd
storage_spec
,{
_id
:
path
,
content
:
content
},
that
.
addJob
(
'
post
'
,
priv
.
s
ub_
storage_spec
,{
_id
:
path
,
content
:
content
},
command
.
cloneOption
(),
success
,
error
);
command
.
cloneOption
(),
success
,
error
);
};
};
priv
.
loadRevision
=
function
(
command
,
path
,
success
,
error
)
{
priv
.
loadRevision
=
function
(
command
,
path
,
success
,
error
)
{
that
.
addJob
(
'
get
'
,
priv
.
s
econd
storage_spec
,
path
,
command
.
cloneOption
(),
that
.
addJob
(
'
get
'
,
priv
.
s
ub_
storage_spec
,
path
,
command
.
cloneOption
(),
success
,
error
);
success
,
error
);
};
};
priv
.
deleteAFile
=
function
(
command
,
path
,
success
,
error
)
{
priv
.
deleteAFile
=
function
(
command
,
path
,
success
,
error
)
{
var
cloned_option
=
command
.
cloneOption
();
var
cloned_option
=
command
.
cloneOption
();
that
.
addJob
(
'
remove
'
,
priv
.
s
econd
storage_spec
,{
_id
:
path
},
that
.
addJob
(
'
remove
'
,
priv
.
s
ub_
storage_spec
,{
_id
:
path
},
command
.
cloneOption
(),
success
,
error
);
command
.
cloneOption
(),
success
,
error
);
};
};
...
@@ -654,7 +654,7 @@ var newConflictManagerStorage = function ( spec, my ) {
...
@@ -654,7 +654,7 @@ var newConflictManagerStorage = function ( spec, my ) {
am
.
call
(
o
,
'
error
'
,[
error
]);
am
.
call
(
o
,
'
error
'
,[
error
]);
};
};
cloned_option
.
metadata_only
=
true
;
cloned_option
.
metadata_only
=
true
;
that
.
addJob
(
'
allDocs
'
,
priv
.
s
econd
storage_spec
,
null
,
cloned_option
,
that
.
addJob
(
'
allDocs
'
,
priv
.
s
ub_
storage_spec
,
null
,
cloned_option
,
success
,
error
);
success
,
error
);
};
};
o
.
filterTheList
=
function
(
result
)
{
o
.
filterTheList
=
function
(
result
)
{
...
...
src/jio.storage/cryptstorage.js
View file @
d7efabc2
...
@@ -6,15 +6,15 @@ var newCryptedStorage = function ( spec, my ) {
...
@@ -6,15 +6,15 @@ var newCryptedStorage = function ( spec, my ) {
priv
.
username
=
spec
.
username
||
''
;
priv
.
username
=
spec
.
username
||
''
;
priv
.
password
=
spec
.
password
||
''
;
priv
.
password
=
spec
.
password
||
''
;
priv
.
s
econd
storage_spec
=
spec
.
storage
||
{
type
:
'
base
'
};
priv
.
s
ub_
storage_spec
=
spec
.
storage
||
{
type
:
'
base
'
};
priv
.
s
econdstorage_string
=
JSON
.
stringify
(
priv
.
second
storage_string
);
priv
.
s
ub_storage_string
=
JSON
.
stringify
(
priv
.
sub_
storage_string
);
var
super_serialized
=
that
.
serialized
;
var
super_serialized
=
that
.
serialized
;
that
.
serialized
=
function
()
{
that
.
serialized
=
function
()
{
var
o
=
super_serialized
();
var
o
=
super_serialized
();
o
.
username
=
priv
.
username
;
o
.
username
=
priv
.
username
;
o
.
password
=
priv
.
password
;
// TODO : unsecured !!!
o
.
password
=
priv
.
password
;
// TODO : unsecured !!!
o
.
storage
=
priv
.
s
econd
storage_string
;
o
.
storage
=
priv
.
s
ub_
storage_string
;
return
o
;
return
o
;
};
};
...
@@ -129,7 +129,7 @@ var newCryptedStorage = function ( spec, my ) {
...
@@ -129,7 +129,7 @@ var newCryptedStorage = function ( spec, my ) {
cloned_doc
=
command
.
cloneDoc
();
cloned_doc
=
command
.
cloneDoc
();
cloned_doc
.
_id
=
new_file_name
;
cloned_doc
.
_id
=
new_file_name
;
cloned_doc
.
content
=
new_file_content
;
cloned_doc
.
content
=
new_file_content
;
that
.
addJob
(
'
put
'
,
priv
.
s
econd
storage_spec
,
cloned_doc
,
that
.
addJob
(
'
put
'
,
priv
.
s
ub_
storage_spec
,
cloned_doc
,
command
.
cloneOption
(),
success
,
error
);
command
.
cloneOption
(),
success
,
error
);
};
};
am
.
wait
(
o
,
'
save
'
,
1
);
am
.
wait
(
o
,
'
save
'
,
1
);
...
@@ -150,7 +150,7 @@ var newCryptedStorage = function ( spec, my ) {
...
@@ -150,7 +150,7 @@ var newCryptedStorage = function ( spec, my ) {
});
});
};
};
o
.
get
=
function
()
{
o
.
get
=
function
()
{
that
.
addJob
(
'
get
'
,
priv
.
s
econd
storage_spec
,
new_file_name
,
that
.
addJob
(
'
get
'
,
priv
.
s
ub_
storage_spec
,
new_file_name
,
command
.
cloneOption
(),
o
.
success
,
o
.
error
);
command
.
cloneOption
(),
o
.
success
,
o
.
error
);
};
};
o
.
success
=
function
(
val
)
{
o
.
success
=
function
(
val
)
{
...
@@ -181,7 +181,7 @@ var newCryptedStorage = function ( spec, my ) {
...
@@ -181,7 +181,7 @@ var newCryptedStorage = function ( spec, my ) {
that
.
allDocs
=
function
(
command
)
{
that
.
allDocs
=
function
(
command
)
{
var
result_array
=
[],
am
=
priv
.
newAsyncModule
(),
o
=
{};
var
result_array
=
[],
am
=
priv
.
newAsyncModule
(),
o
=
{};
o
.
allDocs
=
function
()
{
o
.
allDocs
=
function
()
{
that
.
addJob
(
'
allDocs
'
,
priv
.
s
econd
storage_spec
,
null
,
that
.
addJob
(
'
allDocs
'
,
priv
.
s
ub_
storage_spec
,
null
,
command
.
cloneOption
(),
o
.
onSuccess
,
o
.
error
);
command
.
cloneOption
(),
o
.
onSuccess
,
o
.
error
);
};
};
o
.
onSuccess
=
function
(
val
)
{
o
.
onSuccess
=
function
(
val
)
{
...
@@ -247,7 +247,7 @@ var newCryptedStorage = function ( spec, my ) {
...
@@ -247,7 +247,7 @@ var newCryptedStorage = function ( spec, my ) {
o
.
removeDocument
=
function
()
{
o
.
removeDocument
=
function
()
{
var
cloned_doc
=
command
.
cloneDoc
();
var
cloned_doc
=
command
.
cloneDoc
();
cloned_doc
.
_id
=
new_file_name
;
cloned_doc
.
_id
=
new_file_name
;
that
.
addJob
(
'
remove
'
,
priv
.
s
econd
storage_spec
,
cloned_doc
,
that
.
addJob
(
'
remove
'
,
priv
.
s
ub_
storage_spec
,
cloned_doc
,
command
.
cloneOption
(),
o
.
success
,
that
.
error
);
command
.
cloneOption
(),
o
.
success
,
that
.
error
);
};
};
o
.
success
=
function
(
val
)
{
o
.
success
=
function
(
val
)
{
...
...
src/jio.storage/indexstorage.js
View file @
d7efabc2
...
@@ -2,23 +2,23 @@ var newIndexStorage = function ( spec, my ) {
...
@@ -2,23 +2,23 @@ var newIndexStorage = function ( spec, my ) {
spec
=
spec
||
{};
spec
=
spec
||
{};
var
that
=
my
.
basicStorage
(
spec
,
my
),
priv
=
{};
var
that
=
my
.
basicStorage
(
spec
,
my
),
priv
=
{};
var
validatestate_s
econd
storage
=
spec
.
storage
||
false
;
var
validatestate_s
ub_
storage
=
spec
.
storage
||
false
;
priv
.
s
econd
storage_spec
=
spec
.
storage
||
{
type
:
'
base
'
};
priv
.
s
ub_
storage_spec
=
spec
.
storage
||
{
type
:
'
base
'
};
priv
.
s
econdstorage_string
=
JSON
.
stringify
(
priv
.
second
storage_spec
);
priv
.
s
ub_storage_string
=
JSON
.
stringify
(
priv
.
sub_
storage_spec
);
var
storage_object_name
=
'
jio/indexed_storage_object
'
;
var
storage_object_name
=
'
jio/indexed_storage_object
'
;
var
storage_file_object_name
=
'
jio/indexed_file_object/
'
+
var
storage_file_object_name
=
'
jio/indexed_file_object/
'
+
priv
.
s
econd
storage_string
;
priv
.
s
ub_
storage_string
;
var
super_serialized
=
that
.
serialized
;
var
super_serialized
=
that
.
serialized
;
that
.
serialized
=
function
()
{
that
.
serialized
=
function
()
{
var
o
=
super_serialized
();
var
o
=
super_serialized
();
o
.
storage
=
priv
.
s
econd
storage_spec
;
o
.
storage
=
priv
.
s
ub_
storage_spec
;
return
o
;
return
o
;
};
};
that
.
validateState
=
function
()
{
that
.
validateState
=
function
()
{
if
(
!
validatestate_s
econd
storage
)
{
if
(
!
validatestate_s
ub_
storage
)
{
return
'
Need at least one parameter: "storage"
'
+
return
'
Need at least one parameter: "storage"
'
+
'
containing storage specifications.
'
;
'
containing storage specifications.
'
;
}
}
...
@@ -38,7 +38,7 @@ var newIndexStorage = function ( spec, my ) {
...
@@ -38,7 +38,7 @@ var newIndexStorage = function ( spec, my ) {
priv
.
indexStorage
=
function
()
{
priv
.
indexStorage
=
function
()
{
var
obj
=
localStorage
.
getItem
(
storage_object_name
)
||
{};
var
obj
=
localStorage
.
getItem
(
storage_object_name
)
||
{};
obj
[
priv
.
s
econd
storage_spec
]
=
new
Date
().
getTime
();
obj
[
priv
.
s
ub_
storage_spec
]
=
new
Date
().
getTime
();
localStorage
.
setItem
(
storage_object_name
,
obj
);
localStorage
.
setItem
(
storage_object_name
,
obj
);
};
};
...
@@ -99,7 +99,7 @@ var newIndexStorage = function ( spec, my ) {
...
@@ -99,7 +99,7 @@ var newIndexStorage = function ( spec, my ) {
var
success
=
function
(
val
)
{
var
success
=
function
(
val
)
{
priv
.
setFileArray
(
val
.
rows
);
priv
.
setFileArray
(
val
.
rows
);
};
};
that
.
addJob
(
'
allDocs
'
,
priv
.
s
econd
storage_spec
,
null
,
that
.
addJob
(
'
allDocs
'
,
priv
.
s
ub_
storage_spec
,
null
,
{
max_retry
:
3
},
success
,
function
(){});
{
max_retry
:
3
},
success
,
function
(){});
};
};
...
@@ -122,7 +122,7 @@ var newIndexStorage = function ( spec, my ) {
...
@@ -122,7 +122,7 @@ var newIndexStorage = function ( spec, my ) {
that
.
error
(
err
);
that
.
error
(
err
);
};
};
priv
.
indexStorage
();
priv
.
indexStorage
();
that
.
addJob
(
'
put
'
,
priv
.
s
econd
storage_spec
,
cloned_doc
,
that
.
addJob
(
'
put
'
,
priv
.
s
ub_
storage_spec
,
cloned_doc
,
cloned_option
,
success
,
error
);
cloned_option
,
success
,
error
);
};
// end put
};
// end put
...
@@ -140,7 +140,7 @@ var newIndexStorage = function ( spec, my ) {
...
@@ -140,7 +140,7 @@ var newIndexStorage = function ( spec, my ) {
},
},
get
=
function
()
{
get
=
function
()
{
var
cloned_option
=
command
.
cloneOption
();
var
cloned_option
=
command
.
cloneOption
();
that
.
addJob
(
'
get
'
,
priv
.
s
econd
storage_spec
,
command
.
cloneDoc
(),
that
.
addJob
(
'
get
'
,
priv
.
s
ub_
storage_spec
,
command
.
cloneDoc
(),
cloned_option
,
success
,
error
);
cloned_option
,
success
,
error
);
that
.
end
();
that
.
end
();
};
};
...
@@ -181,7 +181,7 @@ var newIndexStorage = function ( spec, my ) {
...
@@ -181,7 +181,7 @@ var newIndexStorage = function ( spec, my ) {
error
=
function
(
err
)
{
error
=
function
(
err
)
{
that
.
error
(
err
);
that
.
error
(
err
);
};
};
that
.
addJob
(
'
allDocs
'
,
priv
.
s
econd
storage_spec
,
null
,
that
.
addJob
(
'
allDocs
'
,
priv
.
s
ub_
storage_spec
,
null
,
command
.
cloneOption
(),
success
,
error
);
command
.
cloneOption
(),
success
,
error
);
}
}
};
// end allDocs
};
// end allDocs
...
@@ -199,7 +199,7 @@ var newIndexStorage = function ( spec, my ) {
...
@@ -199,7 +199,7 @@ var newIndexStorage = function ( spec, my ) {
error
=
function
(
err
)
{
error
=
function
(
err
)
{
that
.
error
(
err
);
that
.
error
(
err
);
};
};
that
.
addJob
(
'
remove
'
,
priv
.
s
econd
storage_spec
,
command
.
cloneDoc
(),
that
.
addJob
(
'
remove
'
,
priv
.
s
ub_
storage_spec
,
command
.
cloneDoc
(),
command
.
cloneOption
(),
success
,
error
);
command
.
cloneOption
(),
success
,
error
);
};
// end remove
};
// end remove
...
...
src/jio.storage/revisionstorage.js
View file @
d7efabc2
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
* Description:
* Description:
* {
* {
* "type": "revision",
* "type": "revision",
* "s
econd
storage": <sub storage description>
* "s
ub_
storage": <sub storage description>
* }
* }
*/
*/
jIO
.
addStorageType
(
'
revision
'
,
function
(
spec
,
my
)
{
jIO
.
addStorageType
(
'
revision
'
,
function
(
spec
,
my
)
{
...
@@ -13,7 +13,7 @@ jIO.addStorageType('revision', function (spec, my) {
...
@@ -13,7 +13,7 @@ jIO.addStorageType('revision', function (spec, my) {
spec
=
spec
||
{};
spec
=
spec
||
{};
that
=
my
.
basicStorage
(
spec
,
my
);
that
=
my
.
basicStorage
(
spec
,
my
);
priv
.
substorage_key
=
"
s
econd
storage
"
;
priv
.
substorage_key
=
"
s
ub_
storage
"
;
priv
.
doctree_suffix
=
"
.revision_tree.json
"
;
priv
.
doctree_suffix
=
"
.revision_tree.json
"
;
priv
.
substorage
=
spec
[
priv
.
substorage_key
];
priv
.
substorage
=
spec
[
priv
.
substorage_key
];
...
...
src/jio.waitstorage.js
View file @
d7efabc2
...
@@ -3,8 +3,8 @@
...
@@ -3,8 +3,8 @@
var
newWaitStorage
=
function
(
spec
,
my
)
{
var
newWaitStorage
=
function
(
spec
,
my
)
{
var
that
=
my
.
basicStorage
(
spec
,
my
),
priv
=
{};
var
that
=
my
.
basicStorage
(
spec
,
my
),
priv
=
{};
var
validatestate_s
econd
storage
=
spec
.
storage
||
false
;
var
validatestate_s
ub_
storage
=
spec
.
storage
||
false
;
priv
.
s
econd
storage_spec
=
spec
.
storage
||
{
type
:
'
base
'
};
priv
.
s
ub_
storage_spec
=
spec
.
storage
||
{
type
:
'
base
'
};
priv
.
delay
=
spec
.
delay
||
5000
;
priv
.
delay
=
spec
.
delay
||
5000
;
priv
.
save
=
spec
.
save
||
true
;
priv
.
save
=
spec
.
save
||
true
;
priv
.
load
=
spec
.
load
||
false
;
priv
.
load
=
spec
.
load
||
false
;
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
priv
.
remove
=
spec
.
remove
||
false
;
priv
.
remove
=
spec
.
remove
||
false
;
that
.
validateState
=
function
()
{
that
.
validateState
=
function
()
{
if
(
!
validatestate_s
econd
storage
)
{
if
(
!
validatestate_s
ub_
storage
)
{
return
'
Need at least one parameter: "storage"
'
+
return
'
Need at least one parameter: "storage"
'
+
'
containing storage specifications.
'
;
'
containing storage specifications.
'
;
}
}
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
that
.
specToStore
=
function
()
{
that
.
specToStore
=
function
()
{
var
o
=
{};
var
o
=
{};
o
.
delay
=
priv
.
delay
;
o
.
delay
=
priv
.
delay
;
o
.
storage
=
priv
.
s
econd
storage_spec
;
o
.
storage
=
priv
.
s
ub_
storage_spec
;
o
.
save
=
priv
.
save
;
o
.
save
=
priv
.
save
;
o
.
load
=
priv
.
load
;
o
.
load
=
priv
.
load
;
o
.
getlist
=
priv
.
getlist
;
o
.
getlist
=
priv
.
getlist
;
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
delay
=
priv
.
delay
;
delay
=
priv
.
delay
;
}
}
setTimeout
(
function
()
{
setTimeout
(
function
()
{
that
.
addJob
(
that
.
newStorage
(
priv
.
s
econd
storage_spec
),
that
.
addJob
(
that
.
newStorage
(
priv
.
s
ub_
storage_spec
),
command
);
command
);
that
.
end
();
that
.
end
();
},
delay
);
},
delay
);
...
...
test/jiotests.js
View file @
d7efabc2
...
@@ -1084,7 +1084,7 @@ test ("Post", function(){
...
@@ -1084,7 +1084,7 @@ test ("Post", function(){
o
.
jio
=
JIO
.
newJio
({
o
.
jio
=
JIO
.
newJio
({
"
type
"
:
"
revision
"
,
"
type
"
:
"
revision
"
,
"
s
econd
storage
"
:
{
"
s
ub_
storage
"
:
{
"
type
"
:
"
local
"
,
"
type
"
:
"
local
"
,
"
username
"
:
"
urevpost
"
,
"
username
"
:
"
urevpost
"
,
"
applicationname
"
:
"
arevpost
"
"
applicationname
"
:
"
arevpost
"
...
@@ -1156,7 +1156,7 @@ test ("Put", function(){
...
@@ -1156,7 +1156,7 @@ test ("Put", function(){
o
.
jio
=
JIO
.
newJio
({
o
.
jio
=
JIO
.
newJio
({
"
type
"
:
"
revision
"
,
"
type
"
:
"
revision
"
,
"
s
econd
storage
"
:
{
"
s
ub_
storage
"
:
{
"
type
"
:
"
local
"
,
"
type
"
:
"
local
"
,
"
username
"
:
"
urevput
"
,
"
username
"
:
"
urevput
"
,
"
applicationname
"
:
"
arevput
"
"
applicationname
"
:
"
arevput
"
...
@@ -1215,7 +1215,7 @@ test ("Get", function(){
...
@@ -1215,7 +1215,7 @@ test ("Get", function(){
o
.
jio
=
JIO
.
newJio
({
o
.
jio
=
JIO
.
newJio
({
"
type
"
:
"
revision
"
,
"
type
"
:
"
revision
"
,
"
s
econd
storage
"
:
{
"
s
ub_
storage
"
:
{
"
type
"
:
"
local
"
,
"
type
"
:
"
local
"
,
"
username
"
:
"
urevget
"
,
"
username
"
:
"
urevget
"
,
"
applicationname
"
:
"
arevget
"
"
applicationname
"
:
"
arevget
"
...
@@ -1369,7 +1369,7 @@ test ("Remove", function(){
...
@@ -1369,7 +1369,7 @@ test ("Remove", function(){
o
.
jio
=
JIO
.
newJio
({
o
.
jio
=
JIO
.
newJio
({
"
type
"
:
"
revision
"
,
"
type
"
:
"
revision
"
,
"
s
econd
storage
"
:
{
"
s
ub_
storage
"
:
{
"
type
"
:
"
local
"
,
"
type
"
:
"
local
"
,
"
username
"
:
"
urevrem
"
,
"
username
"
:
"
urevrem
"
,
"
applicationname
"
:
"
arevrem
"
"
applicationname
"
:
"
arevrem
"
...
@@ -1572,7 +1572,7 @@ test ("Scenario", function(){
...
@@ -1572,7 +1572,7 @@ test ("Scenario", function(){
o
.
jio
=
JIO
.
newJio
({
o
.
jio
=
JIO
.
newJio
({
"
type
"
:
"
revision
"
,
"
type
"
:
"
revision
"
,
"
s
econd
storage
"
:
{
"
s
ub_
storage
"
:
{
"
type
"
:
"
local
"
,
"
type
"
:
"
local
"
,
"
username
"
:
"
usam1
"
,
"
username
"
:
"
usam1
"
,
"
applicationname
"
:
"
asam1
"
"
applicationname
"
:
"
asam1
"
...
@@ -1598,7 +1598,7 @@ test ("Scenario", function(){
...
@@ -1598,7 +1598,7 @@ test ("Scenario", function(){
// open new tab (JIO)
// open new tab (JIO)
o
.
jio2
=
JIO
.
newJio
({
o
.
jio2
=
JIO
.
newJio
({
"
type
"
:
"
revision
"
,
"
type
"
:
"
revision
"
,
"
s
econd
storage
"
:
{
"
s
ub_
storage
"
:
{
"
type
"
:
"
local
"
,
"
type
"
:
"
local
"
,
"
username
"
:
"
usam1
"
,
"
username
"
:
"
usam1
"
,
"
applicationname
"
:
"
asam1
"
"
applicationname
"
:
"
asam1
"
...
@@ -1655,7 +1655,7 @@ test ("Scenario", function(){
...
@@ -1655,7 +1655,7 @@ test ("Scenario", function(){
// Reopen JIO
// Reopen JIO
o
.
jio
=
JIO
.
newJio
({
o
.
jio
=
JIO
.
newJio
({
"
type
"
:
"
revision
"
,
"
type
"
:
"
revision
"
,
"
s
econd
storage
"
:
{
"
s
ub_
storage
"
:
{
"
type
"
:
"
local
"
,
"
type
"
:
"
local
"
,
"
username
"
:
"
usam1
"
,
"
username
"
:
"
usam1
"
,
"
applicationname
"
:
"
asam1
"
"
applicationname
"
:
"
asam1
"
...
@@ -2213,11 +2213,11 @@ test ('Get document list', function () {
...
@@ -2213,11 +2213,11 @@ test ('Get document list', function () {
test ('Remove document', function () {
test ('Remove document', function () {
var o = {}; o.clock = this.sandbox.useFakeTimers();
var o = {}; o.clock = this.sandbox.useFakeTimers();
o.clock.tick(base_tick);
o.clock.tick(base_tick);
o.s
econd
storage = {type:'dummyall3tries',username:'indexremove'}
o.s
ub_
storage = {type:'dummyall3tries',username:'indexremove'}
o.storage_file_object_name = 'jio/indexed_file_object/'+
o.storage_file_object_name = 'jio/indexed_file_object/'+
JSON.stringify (o.s
econd
storage);
JSON.stringify (o.s
ub_
storage);
o.jio = JIO.newJio({type:'indexed',storage:o.s
econd
storage});
o.jio = JIO.newJio({type:'indexed',storage:o.s
ub_
storage});
o.f = function (err,val) {
o.f = function (err,val) {
if (err) {
if (err) {
err = err.status;
err = err.status;
...
@@ -2586,12 +2586,12 @@ test ('Revision Conflict', function() {
...
@@ -2586,12 +2586,12 @@ test ('Revision Conflict', function() {
ok (!LocalOrCookieStorage.getItem(o.localNamespace + string),
ok (!LocalOrCookieStorage.getItem(o.localNamespace + string),
message || '"' + string + '" does not exists.');
message || '"' + string + '" does not exists.');
};
};
o.s
econd
storage_spec = {type:'local',
o.s
ub_
storage_spec = {type:'local',
username:'revisionconflict',
username:'revisionconflict',
applicationname:'jiotests'}
applicationname:'jiotests'}
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
o.jio = JIO.newJio({type:'conflictmanager',
o.jio = JIO.newJio({type:'conflictmanager',
storage:o.s
econd
storage_spec});
storage:o.s
ub_
storage_spec});
// create a new file
// create a new file
o.spy(o,'value',
o.spy(o,'value',
{ok:true,id:'file.doc',rev:'1',conflicts:{total_rows:0,rows:[]},
{ok:true,id:'file.doc',rev:'1',conflicts:{total_rows:0,rows:[]},
...
@@ -2750,12 +2750,12 @@ test ('Conflict in a conflict solving', function () {
...
@@ -2750,12 +2750,12 @@ test ('Conflict in a conflict solving', function () {
ok (!LocalOrCookieStorage.getItem(o.localNamespace + string),
ok (!LocalOrCookieStorage.getItem(o.localNamespace + string),
message || '"' + string + '" does not exists.');
message || '"' + string + '" does not exists.');
};
};
o.s
econd
storage_spec = {type:'local',
o.s
ub_
storage_spec = {type:'local',
username:'conflictconflict',
username:'conflictconflict',
applicationname:'jiotests'}
applicationname:'jiotests'}
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
o.jio = JIO.newJio({type:'conflictmanager',
o.jio = JIO.newJio({type:'conflictmanager',
storage:o.s
econd
storage_spec});
storage:o.s
ub_
storage_spec});
// create a new file
// create a new file
o.test_message = 'new file "file.doc", revision: "0".'
o.test_message = 'new file "file.doc", revision: "0".'
o.f = o.t.spy();
o.f = o.t.spy();
...
@@ -2937,12 +2937,12 @@ test ('Remove revision conflict', function () {
...
@@ -2937,12 +2937,12 @@ test ('Remove revision conflict', function () {
ok (!LocalOrCookieStorage.getItem(o.localNamespace + string),
ok (!LocalOrCookieStorage.getItem(o.localNamespace + string),
message || '"' + string + '" does not exists.');
message || '"' + string + '" does not exists.');
};
};
o.s
econd
storage_spec = {type:'local',
o.s
ub_
storage_spec = {type:'local',
username:'removeconflict',
username:'removeconflict',
applicationname:'jiotests'}
applicationname:'jiotests'}
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
o.jio = JIO.newJio({type:'conflictmanager',
o.jio = JIO.newJio({type:'conflictmanager',
storage:o.s
econd
storage_spec});
storage:o.s
ub_
storage_spec});
o.test_message = 'new file "file.doc", revision: "0".';
o.test_message = 'new file "file.doc", revision: "0".';
o.f = o.t.spy();
o.f = o.t.spy();
...
@@ -3167,12 +3167,12 @@ test ('Load Revisions', function () {
...
@@ -3167,12 +3167,12 @@ test ('Load Revisions', function () {
o.clock.tick (base_tick);
o.clock.tick (base_tick);
o.spy = basic_spy_function;
o.spy = basic_spy_function;
o.tick = basic_tick_function;
o.tick = basic_tick_function;
o.s
econd
storage_spec = {type:'local',
o.s
ub_
storage_spec = {type:'local',
username:'loadrevisions',
username:'loadrevisions',
applicationname:'jiotests'}
applicationname:'jiotests'}
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
o.jio = JIO.newJio({type:'conflictmanager',
o.jio = JIO.newJio({type:'conflictmanager',
storage:o.s
econd
storage_spec});
storage:o.s
ub_
storage_spec});
o.spy(o,'status',404,'load file rev:1,','f'); // 12 === Replaced
o.spy(o,'status',404,'load file rev:1,','f'); // 12 === Replaced
o.spy(o,'status',404,'load file rev:2','g');
o.spy(o,'status',404,'load file rev:2','g');
o.spy(o,'status',404,'and load file rev:3 at the same time','h');
o.spy(o,'status',404,'and load file rev:3 at the same time','h');
...
@@ -3188,13 +3188,13 @@ test ('Get revision List', function () {
...
@@ -3188,13 +3188,13 @@ test ('Get revision List', function () {
o.clock.tick (base_tick);
o.clock.tick (base_tick);
o.spy = basic_spy_function;
o.spy = basic_spy_function;
o.tick = basic_tick_function;
o.tick = basic_tick_function;
o.s
econd
storage_spec = {type:'local',
o.s
ub_
storage_spec = {type:'local',
username:'getrevisionlist',
username:'getrevisionlist',
applicationname:'jiotests'}
applicationname:'jiotests'}
o.rev = {};
o.rev = {};
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
o.jio = JIO.newJio({type:'conflictmanager',
o.jio = JIO.newJio({type:'conflictmanager',
storage:o.s
econd
storage_spec});
storage:o.s
ub_
storage_spec});
o.spy(o,'value',{total_rows:0,rows:[]},'Get revision list');
o.spy(o,'value',{total_rows:0,rows:[]},'Get revision list');
o.jio.allDocs(o.f);
o.jio.allDocs(o.f);
o.tick(o);
o.tick(o);
...
...
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