Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-cppinttest
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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-cppinttest
Commits
359c1c5d
Commit
359c1c5d
authored
3 years ago
by
Henrik tom Wörden
Browse files
Options
Downloads
Patches
Plain Diff
TST: extend integration test
parent
026b2417
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!8
F files
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/test_transaction.cpp
+19
-1
19 additions, 1 deletion
test/test_transaction.cpp
with
19 additions
and
1 deletion
test/test_transaction.cpp
+
19
−
1
View file @
359c1c5d
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
*/
*/
#include
"caosdb/connection.h"
// for Connection, ConnectionManager
#include
"caosdb/connection.h"
// for Connection, ConnectionManager
#include
"caosdb/entity.h"
// for Entity, Messages, Message
#include
"caosdb/entity.h"
// for Entity, Messages, Message
#include
"caosdb/file_transmission/file_reader.h"
// for FileReader
#include
"caosdb/file_transmission/file_writer.h"
// for FileWriter
#include
"caosdb/file_transmission/file_writer.h"
// for FileWriter
#include
"caosdb/message_code.h"
// for ENTITY_DOES_NOT_EXIST, Messag...
#include
"caosdb/message_code.h"
// for ENTITY_DOES_NOT_EXIST, Messag...
#include
"caosdb/status_code.h"
// for SUCCESS, StatusCode
#include
"caosdb/status_code.h"
// for SUCCESS, StatusCode
...
@@ -690,9 +691,18 @@ TEST_F(test_transaction, test_file_upload) {
...
@@ -690,9 +691,18 @@ TEST_F(test_transaction, test_file_upload) {
const
auto
&
inserted_file
=
insert_results
.
at
(
0
);
const
auto
&
inserted_file
=
insert_results
.
at
(
0
);
EXPECT_FALSE
(
inserted_file
.
GetId
().
empty
());
EXPECT_FALSE
(
inserted_file
.
GetId
().
empty
());
EXPECT_FALSE
(
inserted_file
.
HasErrors
());
EXPECT_FALSE
(
inserted_file
.
HasErrors
());
// Check file once more
auto
count_query
(
connection
->
CreateTransaction
());
count_query
->
Query
(
"COUNT FILE WHICH IS STORED AT 'test.txt'"
);
count_query
->
ExecuteAsynchronously
();
auto
count_and_retrieve_status
=
count_query
->
WaitForIt
();
ASSERT_TRUE
(
count_and_retrieve_status
.
IsTerminated
());
ASSERT_FALSE
(
count_and_retrieve_status
.
IsError
());
EXPECT_EQ
(
count_query
->
GetCountResult
(),
1
);
}
}
TEST_F
(
test_transaction
,
test_file_download
)
{
TEST_F
(
test_transaction
,
test_file_
up_n_
download
)
{
const
auto
&
connection
=
const
auto
&
connection
=
caosdb
::
connection
::
ConnectionManager
::
GetDefaultConnection
();
caosdb
::
connection
::
ConnectionManager
::
GetDefaultConnection
();
...
@@ -725,6 +735,14 @@ TEST_F(test_transaction, test_file_download) {
...
@@ -725,6 +735,14 @@ TEST_F(test_transaction, test_file_download) {
ASSERT_FALSE
(
downloaded_file
.
HasErrors
());
ASSERT_FALSE
(
downloaded_file
.
HasErrors
());
EXPECT_EQ
(
downloaded_file
.
GetLocalPath
().
string
(),
EXPECT_EQ
(
downloaded_file
.
GetLocalPath
().
string
(),
test_download_file_1
.
string
());
test_download_file_1
.
string
());
FileReader
reader_remote
(
test_upload_file_1
);
std
::
string
buffer_local
(
1024
,
'c'
);
std
::
string
buffer_remote
(
1024
,
'c'
);
for
(
int
i
=
0
;
i
<
8
;
i
++
)
{
reader_remote
.
read
(
buffer_remote
);
EXPECT_EQ
(
buffer_remote
,
buffer_local
);
}
}
}
}
// namespace caosdb::transaction
}
// namespace caosdb::transaction
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