Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jio-main
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
Hardik Juneja
jio-main
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
Show 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 () {
...
@@ -2673,8 +2673,19 @@ test ("Post", function () {
// check document
// check document
o
.
fakeIndex
=
{
o
.
fakeIndex
=
{
"
_id
"
:
"
ipost_indices.json
"
,
"
_id
"
:
"
ipost_indices.json
"
,
"
indexAB
"
:
{
"
keyword_abc
"
:[
"
some_id
"
],
"
keyword_def
"
:[
"
some_id
"
]},
"
indexAB
"
:
{
"
indexA
"
:
{
"
keyword_abc
"
:[
"
some_id
"
]}
"
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
.
jio
.
get
(
"
ipost_indices.json
"
,
function
(
err
,
response
){
o
.
actualIndex
=
response
;
o
.
actualIndex
=
response
;
...
@@ -2733,8 +2744,17 @@ test ("Put", function(){
...
@@ -2733,8 +2744,17 @@ test ("Put", function(){
// check index file
// check index file
o
.
fakeIndex
=
{
o
.
fakeIndex
=
{
"
indexA
"
:
{
"
John Doe
"
:
[
"
put1
"
]},
"
indexA
"
:
{
"
indexAB
"
:
{
"
John Doe
"
:
[
"
put1
"
]},
"
author
"
:
{
"
John Doe
"
:
[
"
put1
"
]
}
},
"
indexAB
"
:
{
"
author
"
:
{
"
John Doe
"
:
[
"
put1
"
]
},
"
year
"
:
{}
},
"
_id
"
:
"
iput_indices.json
"
"
_id
"
:
"
iput_indices.json
"
};
};
o
.
jio
.
get
(
"
iput_indices.json
"
,
function
(
err
,
response
){
o
.
jio
.
get
(
"
iput_indices.json
"
,
function
(
err
,
response
){
...
@@ -2751,8 +2771,17 @@ test ("Put", function(){
...
@@ -2751,8 +2771,17 @@ test ("Put", function(){
// check index file
// check index file
o
.
fakeIndex
=
{
o
.
fakeIndex
=
{
"
indexA
"
:
{
"
Jane Doe
"
:
[
"
put1
"
]},
"
indexA
"
:
{
"
indexAB
"
:
{
"
Jane Doe
"
:
[
"
put1
"
]},
"
author
"
:
{
"
Jane Doe
"
:
[
"
put1
"
]
}
},
"
indexAB
"
:
{
"
author
"
:
{
"
Jane Doe
"
:
[
"
put1
"
]
},
"
year
"
:
{}
},
"
_id
"
:
"
iput_indices.json
"
"
_id
"
:
"
iput_indices.json
"
};
};
o
.
jio
.
get
(
"
iput_indices.json
"
,
function
(
err
,
response
){
o
.
jio
.
get
(
"
iput_indices.json
"
,
function
(
err
,
response
){
...
@@ -2770,8 +2799,17 @@ test ("Put", function(){
...
@@ -2770,8 +2799,17 @@ test ("Put", function(){
// check index file
// check index file
o
.
fakeIndex
=
{
o
.
fakeIndex
=
{
"
indexA
"
:
{
"
Jane Doe
"
:
[
"
put1
"
,
"
new_doc
"
]
},
"
indexA
"
:
{
"
indexAB
"
:
{
"
Jane Doe
"
:
[
"
put1
"
,
"
new_doc
"
]},
"
author
"
:
{
"
Jane Doe
"
:
[
"
put1
"
,
"
new_doc
"
]
}
},
"
indexAB
"
:
{
"
author
"
:
{
"
Jane Doe
"
:
[
"
put1
"
,
"
new_doc
"
]
},
"
year
"
:
{}
},
"
_id
"
:
"
iput_indices.json
"
"
_id
"
:
"
iput_indices.json
"
};
};
o
.
jio
.
get
(
"
iput_indices.json
"
,
function
(
err
,
response
){
o
.
jio
.
get
(
"
iput_indices.json
"
,
function
(
err
,
response
){
...
@@ -2790,8 +2828,19 @@ test ("Put", function(){
...
@@ -2790,8 +2828,19 @@ test ("Put", function(){
// check index file
// check index file
o
.
fakeIndex
=
{
o
.
fakeIndex
=
{
"
indexA
"
:
{
"
Jane Doe
"
:
[
"
put1
"
]
},
"
indexA
"
:
{
"
indexAB
"
:
{
"
Jane Doe
"
:
[
"
put1
"
],
"
1912
"
:
[
"
put1
"
]},
"
author
"
:
{
"
Jane Doe
"
:
[
"
put1
"
]
}
},
"
indexAB
"
:
{
"
author
"
:
{
"
Jane Doe
"
:
[
"
put1
"
]
},
"
year
"
:
{
"
1912
"
:
[
"
put1
"
]
}
},
"
_id
"
:
"
iput_indices.json
"
"
_id
"
:
"
iput_indices.json
"
};
};
o
.
jio
.
get
(
"
iput_indices.json
"
,
function
(
err
,
response
){
o
.
jio
.
get
(
"
iput_indices.json
"
,
function
(
err
,
response
){
...
@@ -2809,8 +2858,19 @@ test ("Put", function(){
...
@@ -2809,8 +2858,19 @@ test ("Put", function(){
// check index file
// check index file
o
.
fakeIndex
=
{
o
.
fakeIndex
=
{
"
indexA
"
:
{
"
Jane Doe
"
:
[
"
put1
"
]
},
"
indexA
"
:
{
"
indexAB
"
:
{
"
Jane Doe
"
:
[
"
put1
"
],
"
1912
"
:
[
"
put1
"
]},
"
author
"
:
{
"
Jane Doe
"
:
[
"
put1
"
]
}
},
"
indexAB
"
:
{
"
author
"
:
{
"
Jane Doe
"
:
[
"
put1
"
]
},
"
year
"
:
{
"
1912
"
:
[
"
put1
"
]
}
},
"
_id
"
:
"
iput_indices.json
"
"
_id
"
:
"
iput_indices.json
"
};
};
o
.
jio
.
get
(
"
iput_indices.json
"
,
function
(
err
,
response
){
o
.
jio
.
get
(
"
iput_indices.json
"
,
function
(
err
,
response
){
...
@@ -3045,8 +3105,19 @@ test ("Remove", function(){
...
@@ -3045,8 +3105,19 @@ test ("Remove", function(){
// check index
// check index
o
.
fakeIndex
=
{
o
.
fakeIndex
=
{
"
_id
"
:
"
irem_indices.json
"
,
"
_id
"
:
"
irem_indices.json
"
,
"
indexA
"
:
{
"
Martin Mustermann
"
:
[
"
removeAlso
"
]},
"
indexA
"
:
{
"
indexAB
"
:
{
"
2525
"
:
[
"
removeAlso
"
],
"
Martin Mustermann
"
:
[
"
removeAlso
"
]}
"
author
"
:
{
"
Martin Mustermann
"
:
[
"
removeAlso
"
]
}
},
"
indexAB
"
:
{
"
year
"
:
{
"
2525
"
:
[
"
removeAlso
"
]
},
"
author
"
:
{
"
Martin Mustermann
"
:
[
"
removeAlso
"
]
}
}
};
};
o
.
jio
.
get
(
"
irem_indices.json
"
,
function
(
err
,
response
){
o
.
jio
.
get
(
"
irem_indices.json
"
,
function
(
err
,
response
){
o
.
actualIndex
=
response
;
o
.
actualIndex
=
response
;
...
@@ -3087,15 +3158,21 @@ test ("Remove", function(){
...
@@ -3087,15 +3158,21 @@ test ("Remove", function(){
o
.
fakeIndex
=
{
o
.
fakeIndex
=
{
"
_id
"
:
"
irem_indices.json
"
,
"
_id
"
:
"
irem_indices.json
"
,
"
indexA
"
:
{
"
indexA
"
:
{
"
author
"
:{
"
Martin Mustermann
"
:
[
"
removeAlso
"
],
"
Martin Mustermann
"
:
[
"
removeAlso
"
],
"
Mrs Sunshine
"
:
[
"
remove3
"
]
"
Mrs Sunshine
"
:
[
"
remove3
"
]
}
},
},
"
indexAB
"
:
{
"
indexAB
"
:
{
"
year
"
:
{
"
1234
"
:
[
"
remove3
"
],
"
1234
"
:
[
"
remove3
"
],
"
2525
"
:
[
"
removeAlso
"
],
"
2525
"
:
[
"
removeAlso
"
]
},
"
author
"
:
{
"
Martin Mustermann
"
:
[
"
removeAlso
"
],
"
Martin Mustermann
"
:
[
"
removeAlso
"
],
"
Mrs Sunshine
"
:
[
"
remove3
"
]
"
Mrs Sunshine
"
:
[
"
remove3
"
]
}
}
}
};
};
o
.
jio
.
get
(
"
irem_indices.json
"
,
function
(
err
,
response
){
o
.
jio
.
get
(
"
irem_indices.json
"
,
function
(
err
,
response
){
o
.
actualIndex
=
response
;
o
.
actualIndex
=
response
;
...
@@ -3113,12 +3190,18 @@ test ("Remove", function(){
...
@@ -3113,12 +3190,18 @@ test ("Remove", function(){
o
.
fakeIndex
=
{
o
.
fakeIndex
=
{
"
_id
"
:
"
irem_indices.json
"
,
"
_id
"
:
"
irem_indices.json
"
,
"
indexA
"
:
{
"
indexA
"
:
{
"
author
"
:
{
"
Martin Mustermann
"
:
[
"
removeAlso
"
]
"
Martin Mustermann
"
:
[
"
removeAlso
"
]
}
},
},
"
indexAB
"
:
{
"
indexAB
"
:
{
"
2525
"
:
[
"
removeAlso
"
],
"
year
"
:
{
"
2525
"
:
[
"
removeAlso
"
]
},
"
author
"
:
{
"
Martin Mustermann
"
:
[
"
removeAlso
"
]
"
Martin Mustermann
"
:
[
"
removeAlso
"
]
}
}
}
};
};
o
.
jio
.
get
(
"
irem_indices.json
"
,
function
(
err
,
response
){
o
.
jio
.
get
(
"
irem_indices.json
"
,
function
(
err
,
response
){
o
.
actualIndex
=
response
;
o
.
actualIndex
=
response
;
...
@@ -3186,20 +3269,26 @@ test ("AllDocs", function () {
...
@@ -3186,20 +3269,26 @@ test ("AllDocs", function () {
o
.
fakeIndex
=
{
o
.
fakeIndex
=
{
"
_id
"
:
"
iall_indices.json
"
,
"
_id
"
:
"
iall_indices.json
"
,
"
indexA
"
:
{
"
indexA
"
:
{
"
author
"
:
{
"
Dr. No
"
:
[
"
dragon.doc
"
],
"
Dr. No
"
:
[
"
dragon.doc
"
],
"
Dr. Who
"
:
[
"
timemachine
"
],
"
Dr. Who
"
:
[
"
timemachine
"
],
"
Dr. Snuggles
"
:
[
"
rocket.ppt
"
],
"
Dr. Snuggles
"
:
[
"
rocket.ppt
"
],
"
Dr. House
"
:[
"
stick.jpg
"
]
"
Dr. House
"
:[
"
stick.jpg
"
]
}
},
},
"
indexAB
"
:
{
"
indexAB
"
:
{
"
author
"
:
{
"
Dr. No
"
:
[
"
dragon.doc
"
],
"
Dr. No
"
:
[
"
dragon.doc
"
],
"
Dr. Who
"
:
[
"
timemachine
"
],
"
Dr. Who
"
:
[
"
timemachine
"
],
"
Dr. Snuggles
"
:
[
"
rocket.ppt
"
],
"
Dr. Snuggles
"
:
[
"
rocket.ppt
"
],
"
Dr. House
"
:[
"
stick.jpg
"
],
"
Dr. House
"
:[
"
stick.jpg
"
]
},
"
year
"
:
{
"
1968
"
:
[
"
dragon.doc
"
,
"
timemachine
"
],
"
1968
"
:
[
"
dragon.doc
"
,
"
timemachine
"
],
"
1985
"
:
[
"
rocket.ppt
"
],
"
1985
"
:
[
"
rocket.ppt
"
],
"
2005
"
:[
"
stick.jpg
"
]
"
2005
"
:[
"
stick.jpg
"
]
}
}
}
};
};
o
.
jio
.
get
(
"
iall_indices.json
"
,
function
(
err
,
response
){
o
.
jio
.
get
(
"
iall_indices.json
"
,
function
(
err
,
response
){
o
.
actualIndex
=
response
;
o
.
actualIndex
=
response
;
...
@@ -3233,6 +3322,23 @@ test ("AllDocs", function () {
...
@@ -3233,6 +3322,23 @@ test ("AllDocs", function () {
o
.
jio
.
allDocs
({
"
include_docs
"
:
true
},
o
.
f
);
o
.
jio
.
allDocs
({
"
include_docs
"
:
true
},
o
.
f
);
o
.
tick
(
o
);
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
();
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