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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-server
Commits
ca8a2fd9
Verified
Commit
ca8a2fd9
authored
1 year ago
by
Timm Fitschen
Browse files
Options
Downloads
Patches
Plain Diff
TST: add regression test
parent
d5892ccf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!103
Release 0.11.0
,
!98
F grpc null values
Pipeline
#39266
passed
1 year ago
Stage: info
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/test/java/org/caosdb/server/grpc/CaosDBToGrpcConvertersTest.java
+51
-0
51 additions, 0 deletions
...va/org/caosdb/server/grpc/CaosDBToGrpcConvertersTest.java
with
51 additions
and
0 deletions
src/test/java/org/caosdb/server/grpc/CaosDBToGrpcConvertersTest.java
+
51
−
0
View file @
ca8a2fd9
...
...
@@ -6,7 +6,9 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
import
java.util.TimeZone
;
import
org.caosdb.api.entity.v1.Value.Builder
;
import
org.caosdb.datetime.DateTimeFactory2
;
import
org.caosdb.server.datatype.CollectionValue
;
import
org.caosdb.server.datatype.GenericValue
;
import
org.caosdb.server.datatype.ReferenceValue
;
import
org.caosdb.server.datatype.Value
;
import
org.caosdb.server.entity.EntityID
;
import
org.caosdb.server.entity.FileProperties
;
...
...
@@ -119,4 +121,53 @@ public class CaosDBToGrpcConvertersTest {
"scalar_value {\n"
+
" special_value: SPECIAL_VALUE_UNSPECIFIED\n"
+
"}\n"
,
value
.
toString
());
}
@Test
public
void
testGetSelectedValueWithListOfReferenceValue
()
{
CollectionValue
col
=
new
CollectionValue
();
Property
p
=
new
Property
(
new
RetrieveEntity
());
p
.
setName
(
"Person"
);
p
.
setDatatype
(
"List<Person>"
);
Property
fullName1
=
new
Property
(
new
RetrieveEntity
());
fullName1
.
setName
(
"full name"
);
fullName1
.
setDatatype
(
"TEXT"
);
fullName1
.
setValue
(
new
GenericValue
(
"Harry Belafonte"
));
RetrieveEntity
person1
=
new
RetrieveEntity
();
person1
.
addProperty
(
fullName1
);
ReferenceValue
val1
=
new
ReferenceValue
(
new
EntityID
(
1234
));
val1
.
setEntity
(
person1
,
false
);
col
.
add
(
val1
);
Property
fullName2
=
new
Property
(
new
RetrieveEntity
());
fullName2
.
setName
(
"full name"
);
fullName2
.
setDatatype
(
"TEXT"
);
fullName2
.
setValue
(
new
GenericValue
(
"Louis Prima"
));
RetrieveEntity
person2
=
new
RetrieveEntity
();
person2
.
addProperty
(
fullName2
);
ReferenceValue
val2
=
new
ReferenceValue
(
new
EntityID
(
1234
));
val2
.
setEntity
(
person2
,
false
);
col
.
add
(
val2
);
p
.
setValue
(
col
);
RetrieveEntity
entity
=
new
RetrieveEntity
();
entity
.
addProperty
(
p
);
CaosDBToGrpcConverters
converters
=
new
CaosDBToGrpcConverters
(
null
);
Builder
value
=
converters
.
getSelectedValue
(
new
Selection
(
"Person"
).
setSubSelection
(
new
Selection
(
"full name"
)),
entity
);
assertEquals
(
"list_values {\n"
+
" values {\n"
+
" string_value: \"Harry Belafonte\"\n"
+
" }\n"
+
" values {\n"
+
" string_value: \"Louis Prima\"\n"
+
" }\n"
+
"}\n"
,
value
.
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