Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-server
Commits
d6efccea
Commit
d6efccea
authored
5 years ago
by
Daniel Hornung
Browse files
Options
Downloads
Patches
Plain Diff
TEST: Test for issue
#31
(file path is split by query keyword).
parent
e571639d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/test/java/caosdb/server/query/TestCQL.java
+26
-0
26 additions, 0 deletions
src/test/java/caosdb/server/query/TestCQL.java
with
26 additions
and
0 deletions
src/test/java/caosdb/server/query/TestCQL.java
+
26
−
0
View file @
d6efccea
...
...
@@ -216,6 +216,7 @@ public class TestCQL {
String
query56b
=
"FIND RECORD WHICH REFERENCES AN ename2"
;
String
query56c
=
"FIND RECORD WHICH REFERENCES atom"
;
String
query56d
=
"FIND RECORD WHICH REFERENCES A tom"
;
String
queryIssue31
=
"FIND FILE WHICH IS STORED AT /data/in0.foo"
;
// File paths ///////////////////////////////////////////////////////////////
String
filepath_verb01
=
"/foo/"
;
...
...
@@ -6269,4 +6270,29 @@ public class TestCQL {
EntityFilterInterface
pov
=
sfq
.
filter
;
assertEquals
(
"POV(prop,=,)"
,
pov
.
toString
());
}
/** String queryIssue31 = "FIND FILE WHICH IS STORED AT /data/in0.foo"; */
@Test
public
void
testIssue31
()
{
CQLLexer
lexer
;
lexer
=
new
CQLLexer
(
CharStreams
.
fromString
(
this
.
queryIssue31
));
final
CommonTokenStream
tokens
=
new
CommonTokenStream
(
lexer
);
final
CQLParser
parser
=
new
CQLParser
(
tokens
);
final
CqContext
sfq
=
parser
.
cq
();
System
.
out
.
println
(
sfq
.
toStringTree
(
parser
));
// 4 children: FIND, role, WHICHCLAUSE, EOF
assertEquals
(
4
,
sfq
.
getChildCount
());
assertEquals
(
"WHICHIS STORED AT/data/in0.foo"
,
sfq
.
getChild
(
2
).
getText
());
assertEquals
(
"FILE"
,
sfq
.
r
.
toString
());
assertNull
(
sfq
.
e
);
assertEquals
(
"StoredAt"
,
sfq
.
filter
.
getClass
().
getSimpleName
());
final
ParseTree
whichclause
=
sfq
.
getChild
(
2
);
final
ParseTree
transactionFilter
=
whichclause
.
getChild
(
1
).
getChild
(
0
);
assertEquals
(
"/data/in0.foo"
,
transactionFilter
.
getChild
(
1
).
getText
());
final
StoredAt
storedAt
=
(
StoredAt
)
sfq
.
filter
;
assertEquals
(
"SAT(/data/in0.foo)"
,
storedAt
.
toString
());
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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