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
c3aae0e5
Commit
c3aae0e5
authored
Jan 28, 2013
by
Sven Franck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jiotests: updated indexStorage to new index file
parent
4685889d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
136 additions
and
30 deletions
+136
-30
test/jiotests.js
test/jiotests.js
+136
-30
No files found.
test/jiotests.js
View file @
c3aae0e5
...
...
@@ -2673,8 +2673,19 @@ test ("Post", function () {
// check document
o
.
fakeIndex
=
{
"
_id
"
:
"
ipost_indices.json
"
,
"
indexAB
"
:
{
"
keyword_abc
"
:[
"
some_id
"
],
"
keyword_def
"
:[
"
some_id
"
]},
"
indexA
"
:
{
"
keyword_abc
"
:[
"
some_id
"
]}
"
indexAB
"
:
{
"
findMeA
"
:
{
"
keyword_abc
"
:[
"
some_id
"
]
},
"
findMeB
"
:
{
"
keyword_def
"
:[
"
some_id
"
]
}
},
"
indexA
"
:
{
"
findMeA
"
:
{
"
keyword_abc
"
:[
"
some_id
"
]
}
}
};
o
.
jio
.
get
(
"
ipost_indices.json
"
,
function
(
err
,
response
){
o
.
actualIndex
=
response
;
...
...
@@ -2733,8 +2744,17 @@ test ("Put", function(){
// check index file
o
.
fakeIndex
=
{
"
indexA
"
:
{
"
John Doe
"
:
[
"
put1
"
]},
"
indexAB
"
:
{
"
John Doe
"
:
[
"
put1
"
]},
"
indexA
"
:
{
"
author
"
:
{
"
John Doe
"
:
[
"
put1
"
]
}
},
"
indexAB
"
:
{
"
author
"
:
{
"
John Doe
"
:
[
"
put1
"
]
},
"
year
"
:
{}
},
"
_id
"
:
"
iput_indices.json
"
};
o
.
jio
.
get
(
"
iput_indices.json
"
,
function
(
err
,
response
){
...
...
@@ -2751,8 +2771,17 @@ test ("Put", function(){
// check index file
o
.
fakeIndex
=
{
"
indexA
"
:
{
"
Jane Doe
"
:
[
"
put1
"
]},
"
indexAB
"
:
{
"
Jane Doe
"
:
[
"
put1
"
]},
"
indexA
"
:
{
"
author
"
:
{
"
Jane Doe
"
:
[
"
put1
"
]
}
},
"
indexAB
"
:
{
"
author
"
:
{
"
Jane Doe
"
:
[
"
put1
"
]
},
"
year
"
:
{}
},
"
_id
"
:
"
iput_indices.json
"
};
o
.
jio
.
get
(
"
iput_indices.json
"
,
function
(
err
,
response
){
...
...
@@ -2770,8 +2799,17 @@ test ("Put", function(){
// check index file
o
.
fakeIndex
=
{
"
indexA
"
:
{
"
Jane Doe
"
:
[
"
put1
"
,
"
new_doc
"
]
},
"
indexAB
"
:
{
"
Jane Doe
"
:
[
"
put1
"
,
"
new_doc
"
]},
"
indexA
"
:
{
"
author
"
:
{
"
Jane Doe
"
:
[
"
put1
"
,
"
new_doc
"
]
}
},
"
indexAB
"
:
{
"
author
"
:
{
"
Jane Doe
"
:
[
"
put1
"
,
"
new_doc
"
]
},
"
year
"
:
{}
},
"
_id
"
:
"
iput_indices.json
"
};
o
.
jio
.
get
(
"
iput_indices.json
"
,
function
(
err
,
response
){
...
...
@@ -2790,8 +2828,19 @@ test ("Put", function(){
// check index file
o
.
fakeIndex
=
{
"
indexA
"
:
{
"
Jane Doe
"
:
[
"
put1
"
]
},
"
indexAB
"
:
{
"
Jane Doe
"
:
[
"
put1
"
],
"
1912
"
:
[
"
put1
"
]},
"
indexA
"
:
{
"
author
"
:
{
"
Jane Doe
"
:
[
"
put1
"
]
}
},
"
indexAB
"
:
{
"
author
"
:
{
"
Jane Doe
"
:
[
"
put1
"
]
},
"
year
"
:
{
"
1912
"
:
[
"
put1
"
]
}
},
"
_id
"
:
"
iput_indices.json
"
};
o
.
jio
.
get
(
"
iput_indices.json
"
,
function
(
err
,
response
){
...
...
@@ -2809,8 +2858,19 @@ test ("Put", function(){
// check index file
o
.
fakeIndex
=
{
"
indexA
"
:
{
"
Jane Doe
"
:
[
"
put1
"
]
},
"
indexAB
"
:
{
"
Jane Doe
"
:
[
"
put1
"
],
"
1912
"
:
[
"
put1
"
]},
"
indexA
"
:
{
"
author
"
:
{
"
Jane Doe
"
:
[
"
put1
"
]
}
},
"
indexAB
"
:
{
"
author
"
:
{
"
Jane Doe
"
:
[
"
put1
"
]
},
"
year
"
:
{
"
1912
"
:
[
"
put1
"
]
}
},
"
_id
"
:
"
iput_indices.json
"
};
o
.
jio
.
get
(
"
iput_indices.json
"
,
function
(
err
,
response
){
...
...
@@ -3045,8 +3105,19 @@ test ("Remove", function(){
// check index
o
.
fakeIndex
=
{
"
_id
"
:
"
irem_indices.json
"
,
"
indexA
"
:
{
"
Martin Mustermann
"
:
[
"
removeAlso
"
]},
"
indexAB
"
:
{
"
2525
"
:
[
"
removeAlso
"
],
"
Martin Mustermann
"
:
[
"
removeAlso
"
]}
"
indexA
"
:
{
"
author
"
:
{
"
Martin Mustermann
"
:
[
"
removeAlso
"
]
}
},
"
indexAB
"
:
{
"
year
"
:
{
"
2525
"
:
[
"
removeAlso
"
]
},
"
author
"
:
{
"
Martin Mustermann
"
:
[
"
removeAlso
"
]
}
}
};
o
.
jio
.
get
(
"
irem_indices.json
"
,
function
(
err
,
response
){
o
.
actualIndex
=
response
;
...
...
@@ -3087,14 +3158,20 @@ test ("Remove", function(){
o
.
fakeIndex
=
{
"
_id
"
:
"
irem_indices.json
"
,
"
indexA
"
:
{
"
Martin Mustermann
"
:
[
"
removeAlso
"
],
"
Mrs Sunshine
"
:
[
"
remove3
"
]
"
author
"
:{
"
Martin Mustermann
"
:
[
"
removeAlso
"
],
"
Mrs Sunshine
"
:
[
"
remove3
"
]
}
},
"
indexAB
"
:
{
"
year
"
:
{
"
1234
"
:
[
"
remove3
"
],
"
2525
"
:
[
"
removeAlso
"
],
"
2525
"
:
[
"
removeAlso
"
]
},
"
author
"
:
{
"
Martin Mustermann
"
:
[
"
removeAlso
"
],
"
Mrs Sunshine
"
:
[
"
remove3
"
]
}
}
};
o
.
jio
.
get
(
"
irem_indices.json
"
,
function
(
err
,
response
){
...
...
@@ -3113,11 +3190,17 @@ test ("Remove", function(){
o
.
fakeIndex
=
{
"
_id
"
:
"
irem_indices.json
"
,
"
indexA
"
:
{
"
Martin Mustermann
"
:
[
"
removeAlso
"
]
"
author
"
:
{
"
Martin Mustermann
"
:
[
"
removeAlso
"
]
}
},
"
indexAB
"
:
{
"
2525
"
:
[
"
removeAlso
"
],
"
year
"
:
{
"
2525
"
:
[
"
removeAlso
"
]
},
"
author
"
:
{
"
Martin Mustermann
"
:
[
"
removeAlso
"
]
}
}
};
o
.
jio
.
get
(
"
irem_indices.json
"
,
function
(
err
,
response
){
...
...
@@ -3186,19 +3269,25 @@ test ("AllDocs", function () {
o
.
fakeIndex
=
{
"
_id
"
:
"
iall_indices.json
"
,
"
indexA
"
:
{
"
Dr. No
"
:
[
"
dragon.doc
"
],
"
Dr. Who
"
:
[
"
timemachine
"
],
"
Dr. Snuggles
"
:
[
"
rocket.ppt
"
],
"
Dr. House
"
:[
"
stick.jpg
"
]
"
author
"
:
{
"
Dr. No
"
:
[
"
dragon.doc
"
],
"
Dr. Who
"
:
[
"
timemachine
"
],
"
Dr. Snuggles
"
:
[
"
rocket.ppt
"
],
"
Dr. House
"
:[
"
stick.jpg
"
]
}
},
"
indexAB
"
:
{
"
Dr. No
"
:
[
"
dragon.doc
"
],
"
Dr. Who
"
:
[
"
timemachine
"
],
"
Dr. Snuggles
"
:
[
"
rocket.ppt
"
],
"
Dr. House
"
:[
"
stick.jpg
"
],
"
1968
"
:
[
"
dragon.doc
"
,
"
timemachine
"
],
"
1985
"
:
[
"
rocket.ppt
"
],
"
2005
"
:[
"
stick.jpg
"
]
"
author
"
:
{
"
Dr. No
"
:
[
"
dragon.doc
"
],
"
Dr. Who
"
:
[
"
timemachine
"
],
"
Dr. Snuggles
"
:
[
"
rocket.ppt
"
],
"
Dr. House
"
:[
"
stick.jpg
"
]
},
"
year
"
:
{
"
1968
"
:
[
"
dragon.doc
"
,
"
timemachine
"
],
"
1985
"
:
[
"
rocket.ppt
"
],
"
2005
"
:[
"
stick.jpg
"
]
}
}
};
o
.
jio
.
get
(
"
iall_indices.json
"
,
function
(
err
,
response
){
...
...
@@ -3233,6 +3322,23 @@ test ("AllDocs", function () {
o
.
jio
.
allDocs
({
"
include_docs
"
:
true
},
o
.
f
);
o
.
tick
(
o
);
// complex queries
o
.
thisShouldBeTheAnswer3
=
{
"
nothing here
"
:
"
yet
"
}
o
.
spy
(
o
,
"
value
"
,
o
.
thisShouldBeTheAnswer3
,
"
allDocs (complex queries year >= 1985)
"
);
o
.
jio
.
allDocs
({
"
query
"
:{
"
query
"
:
jIO
.
ComplexQueries
.
parse
(
'
(year: >= "1985" AND author:"D%")
'
),
"
filter
"
:
{
"
limit
"
:[
0
,
2
],
"
sort_on
"
:[[
'
key
'
,
'
descending
'
]],
"
select_list
"
:[
'
author
'
,
'
year
'
]
},
"
wildcard_character
"
:
'
%
'
}
},
o
.
f
);
o
.
tick
(
o
);
o
.
jio
.
stop
();
});
/*
...
...
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