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
df154b88
Verified
Commit
df154b88
authored
3 years ago
by
Timm Fitschen
Browse files
Options
Downloads
Patches
Plain Diff
WIP: files
parent
a4b298ac
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!8
F files
Pipeline
#11242
passed
3 years ago
Stage: info
Stage: setup
Stage: build
Stage: test
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
conanfile.txt
+1
-1
1 addition, 1 deletion
conanfile.txt
test/CMakeLists.txt
+1
-0
1 addition, 0 deletions
test/CMakeLists.txt
test/test_file_transmission.cpp
+58
-0
58 additions, 0 deletions
test/test_file_transmission.cpp
with
60 additions
and
1 deletion
conanfile.txt
+
1
−
1
View file @
df154b88
[requires]
caosdb/0.0.
9
caosdb/0.0.
10
gtest/1.11.0
[generators]
...
...
This diff is collapsed.
Click to expand it.
test/CMakeLists.txt
+
1
−
0
View file @
df154b88
...
...
@@ -23,6 +23,7 @@
#######################################################################
set
(
test_cases
test_connection
test_file_transmission
test_transaction
test_ccaosdb
)
...
...
This diff is collapsed.
Click to expand it.
test/test_file_transmission.cpp
0 → 100644
+
58
−
0
View file @
df154b88
/*
* This file is a part of the CaosDB Project.
*
* Copyright (C) 2021 Timm Fitschen <t.fitschen@indiscale.com>
* Copyright (C) 2021 IndiScale GmbH <info@indiscale.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#include
"caosdb/connection.h"
// for Connection, ConnectionManager
#include
"caosdb/entity/v1alpha1/main.pb.h"
#include
"caosdb/transaction.h"
// for Entity, Transaction, UniqueRe...
#include
"gtest/gtest-message.h"
// for Message
#include
"gtest/gtest-test-part.h"
// for TestPartResult, SuiteApiResolver
#include
"gtest/gtest_pred_impl.h"
// for Test, EXPECT_EQ, AssertionResult
#include
<memory>
// for unique_ptr, allocator, __shar...
#include
<string>
// for string
namespace
caosdb
::
transaction
{
using
caosdb
::
entity
::
v1alpha1
::
RegisterFileUploadResponse
;
using
caosdb
::
entity
::
v1alpha1
::
RegistrationStatus
;
class
test_file_transmission
:
public
::
testing
::
Test
{
protected:
void
SetUp
()
override
{}
void
TearDown
()
override
{
// TODO(tf): delete all created entities
}
};
TEST_F
(
test_file_transmission
,
register_file_upload
)
{
const
auto
&
connection
=
caosdb
::
connection
::
ConnectionManager
::
GetDefaultConnection
();
auto
transaction
(
connection
->
CreateTransaction
());
RegisterFileUploadResponse
response
;
EXPECT_EQ
(
response
.
status
(),
RegistrationStatus
::
REGISTRATION_STATUS_UNSPECIFIED
);
transaction
->
RegisterUploadFile
(
&
response
);
EXPECT_EQ
(
response
.
status
(),
RegistrationStatus
::
REGISTRATION_STATUS_ACCEPTED
);
EXPECT_FALSE
(
response
.
registration_id
().
empty
());
}
}
// 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