Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
jio_mebibou
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Alexandra Rogova
jio_mebibou
Commits
7f5f4e44
Commit
7f5f4e44
authored
Jul 17, 2013
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gidstorage added + tests (wip)
parent
a68b440b
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
479 additions
and
0 deletions
+479
-0
examples/jio_dashboard.html
examples/jio_dashboard.html
+2
-0
src/jio.storage/gidstorage.js
src/jio.storage/gidstorage.js
+384
-0
test/jiotests.js
test/jiotests.js
+91
-0
test/jiotests_withoutrequirejs.html
test/jiotests_withoutrequirejs.html
+2
-0
No files found.
examples/jio_dashboard.html
View file @
7f5f4e44
...
...
@@ -164,6 +164,8 @@ var clearlog = function () {
</script>
<script
type=
"text/javascript"
src=
"../src/jio.storage/splitstorage.js"
>
</script>
<script
type=
"text/javascript"
src=
"../src/jio.storage/gidstorage.js"
>
</script>
<script
type=
"text/javascript"
src=
"../lib/sjcl/sjcl.min.js"
></script>
<script
type=
"text/javascript"
>
<!--
...
...
src/jio.storage/gidstorage.js
0 → 100644
View file @
7f5f4e44
This diff is collapsed.
Click to expand it.
test/jiotests.js
View file @
7f5f4e44
...
...
@@ -7963,6 +7963,97 @@ test("AllDocs", function () {
o
.
jio
.
stop
();
});
module
(
"
JIO GID Storage
"
);
test
(
"
Post
"
,
function
()
{
var
o
=
generateTools
(
this
);
o
.
localstorage_spec
=
{
"
type
"
:
"
local
"
,
"
username
"
:
"
one
"
,
"
application_name
"
:
"
gid storage post test
"
};
o
.
local_jio
=
JIO
.
newJio
(
o
.
localstorage_spec
);
o
.
jio
=
JIO
.
newJio
({
"
type
"
:
"
gid
"
,
"
sub_storage
"
:
o
.
localstorage_spec
,
"
constraints
"
:
{
"
default
"
:
{
"
identifier
"
:
"
list
"
}
}
});
o
.
local_jio
.
put
({
"
_id
"
:
"
blue
"
,
"
identifier
"
:
"
a
"
});
o
.
local_jio
.
put
({
"
_id
"
:
"
green
"
,
"
identifier
"
:
[
"
ac
"
,
"
b
"
]});
o
.
clock
.
tick
(
2000
);
o
.
local_jio
.
stop
();
o
.
spy
(
o
,
'
status
'
,
409
,
'
Post document without respecting constraints
'
+
'
-> conflicts
'
);
o
.
jio
.
post
({},
o
.
f
);
o
.
tick
(
o
);
o
.
spy
(
o
,
'
status
'
,
409
,
'
Post existent document -> conflict
'
);
o
.
jio
.
post
({
"
identifier
"
:
"
a
"
},
o
.
f
);
o
.
tick
(
o
);
o
.
spy
(
o
,
'
value
'
,
{
"
id
"
:
"
{
\"
identifier
\"
:[
\"
a%
\"
]}
"
,
"
ok
"
:
true
},
'
Post respecting constraints
'
);
o
.
jio
.
post
({
"
identifier
"
:
"
a%
"
},
o
.
f
);
o
.
tick
(
o
);
o
.
spy
(
o
,
'
status
'
,
409
,
'
Post same document respecting constraints
'
+
'
-> conflicts
'
);
o
.
jio
.
post
({
"
identifier
"
:
"
a%
"
},
o
.
f
);
o
.
tick
(
o
);
o
.
jio
.
stop
();
});
test
(
"
Get
"
,
function
()
{
var
o
=
generateTools
(
this
);
o
.
localstorage_spec
=
{
"
type
"
:
"
local
"
,
"
username
"
:
"
one
"
,
"
application_name
"
:
"
gid storage get test
"
};
o
.
local_jio
=
JIO
.
newJio
(
o
.
localstorage_spec
);
o
.
jio
=
JIO
.
newJio
({
"
type
"
:
"
gid
"
,
"
sub_storage
"
:
o
.
localstorage_spec
,
"
constraints
"
:
{
"
default
"
:
{
"
identifier
"
:
"
list
"
}
}
});
o
.
local_jio
.
put
({
"
_id
"
:
"
blue
"
,
"
identifier
"
:
"
a
"
});
o
.
local_jio
.
put
({
"
_id
"
:
"
green
"
,
"
identifier
"
:
[
"
ac
"
,
"
b
"
]});
o
.
clock
.
tick
(
2000
);
o
.
local_jio
.
stop
();
o
.
spy
(
o
,
'
status
'
,
404
,
'
Get inexistent document
'
);
o
.
jio
.
get
({
"
_id
"
:
"
{
\"
identifier
\"
:[
\"
b
\"
]}
"
},
o
.
f
);
o
.
tick
(
o
);
o
.
spy
(
o
,
'
value
'
,
{
"
_id
"
:
"
blue
"
,
"
identifier
"
:
"
a
"
},
'
Get document
'
);
o
.
jio
.
get
({
"
_id
"
:
"
{
\"
identifier
\"
:[
\"
a
\"
]}
"
},
o
.
f
);
o
.
tick
(
o
);
o
.
jio
.
stop
();
});
};
// end thisfun
if
(
window
.
requirejs
)
{
...
...
test/jiotests_withoutrequirejs.html
View file @
7f5f4e44
...
...
@@ -40,6 +40,8 @@
</script>
<script
type=
"text/javascript"
src=
"../src/jio.storage/splitstorage.js"
>
</script>
<script
type=
"text/javascript"
src=
"../src/jio.storage/gidstorage.js"
>
</script>
<script
type=
"text/javascript"
src=
"./jiotests.js"
></script>
</body>
</html>
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