Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ARSnova Backend
Manage
Activity
Members
Labels
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Privacy
Imprint
Contact
Snippets
Groups
Projects
Show more breadcrumbs
Paul-Christian Volkmer
ARSnova Backend
Commits
5946657c
Commit
5946657c
authored
11 years ago
by
Christoph Thelen
Browse files
Options
Downloads
Patches
Plain Diff
Added mehods to directly support arrays
parent
7a6f7327
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/de/thm/arsnova/dao/NovaView.java
+8
-0
8 additions, 0 deletions
src/main/java/de/thm/arsnova/dao/NovaView.java
src/test/java/de/thm/arsnova/dao/NovaViewTest.java
+14
-0
14 additions, 0 deletions
src/test/java/de/thm/arsnova/dao/NovaViewTest.java
with
22 additions
and
0 deletions
src/main/java/de/thm/arsnova/dao/NovaView.java
+
8
−
0
View file @
5946657c
...
...
@@ -34,11 +34,19 @@ public class NovaView extends View {
this
.
startKey
=
quote
(
key
);
}
public
void
setStartKeyArray
(
String
key
)
{
this
.
startKey
=
encode
(
"[\""
+
key
+
"\"]"
);
}
@Override
public
void
setEndKey
(
String
key
)
{
this
.
endKey
=
quote
(
key
);
}
public
void
setEndKeyArray
(
String
key
)
{
this
.
endKey
=
encode
(
"[\""
+
key
+
"\"]"
);
}
public
void
setStartKey
(
String
...
keys
)
{
this
.
startKey
=
toJsonArray
(
keys
);
}
...
...
This diff is collapsed.
Click to expand it.
src/test/java/de/thm/arsnova/dao/NovaViewTest.java
+
14
−
0
View file @
5946657c
...
...
@@ -48,6 +48,20 @@ public class NovaViewTest {
assertEncodedEquals
(
"startkey"
,
"\"foo\""
,
v
.
getQueryString
());
}
@Test
public
void
setStartKeyShouldAcceptSingleArgumentArray
()
{
NovaView
v
=
new
NovaView
(
null
);
v
.
setStartKeyArray
(
"foo"
);
assertEncodedEquals
(
"startkey"
,
"[\"foo\"]"
,
v
.
getQueryString
());
}
@Test
public
void
setEndKeyShouldAcceptSingleArgumentArray
()
{
NovaView
v
=
new
NovaView
(
null
);
v
.
setEndKeyArray
(
"foo"
);
assertEncodedEquals
(
"endkey"
,
"[\"foo\"]"
,
v
.
getQueryString
());
}
@Test
public
void
setEndKeyShouldAcceptSingleArgument
()
{
NovaView
v
=
new
NovaView
(
null
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment