From acebed8058311087b127743daf4b3bea753a128f Mon Sep 17 00:00:00 2001 From: Timm Fitschen <t.fitschen@indiscale.com> Date: Mon, 8 Nov 2021 14:22:32 +0100 Subject: [PATCH] Update protobuf repo/fix breaking changes --- CMakeLists.txt | 6 +- FEATURES.md | 38 ++++++ conanfile.py | 2 +- include/caosdb/connection.h | 30 ++-- include/caosdb/data_type.h | 20 +-- include/caosdb/entity.h | 29 ++-- .../download_request_handler.h | 10 +- .../register_file_upload_handler.h | 12 +- .../upload_request_handler.h | 10 +- include/caosdb/info.h | 8 +- include/caosdb/message_code.h | 128 ++++++++++++++++-- include/caosdb/transaction.h | 33 +++-- include/caosdb/transaction_handler.h | 10 +- include/caosdb/value.h | 26 ++-- proto | 2 +- src/caosdb/connection.cpp | 14 +- src/caosdb/entity.cpp | 26 ++-- src/caosdb/transaction.cpp | 21 ++- test/test_data_type.cpp | 10 +- test/test_entity.cpp | 52 +++---- test/test_info.cpp | 14 +- test/test_list_properties.cpp | 30 ++-- test/test_protobuf.cpp | 18 +-- test/test_transaction.cpp | 14 +- test/test_value.cpp | 32 ++--- 25 files changed, 367 insertions(+), 228 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0176a56..912a376 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ cmake_minimum_required(VERSION 3.13) -set(libcaosdb_VERSION 0.0.20) +set(libcaosdb_VERSION 0.0.21) set(libcaosdb_COMPATIBLE_SERVER_VERSION_MAJOR 0) set(libcaosdb_COMPATIBLE_SERVER_VERSION_MINOR 5) set(libcaosdb_COMPATIBLE_SERVER_VERSION_PATCH 0) @@ -79,8 +79,8 @@ add_subdirectory(doc) # Protobuf/Grpc source files set(PROTO_FILES - ${PROJECT_SOURCE_DIR}/proto/proto/caosdb/info/v1alpha1/main.proto - ${PROJECT_SOURCE_DIR}/proto/proto/caosdb/entity/v1alpha1/main.proto + ${PROJECT_SOURCE_DIR}/proto/proto/caosdb/info/v1/main.proto + ${PROJECT_SOURCE_DIR}/proto/proto/caosdb/entity/v1/main.proto ) set(PROTO_PATH ${PROJECT_SOURCE_DIR}/proto/proto) diff --git a/FEATURES.md b/FEATURES.md index 8b13789..8ca4a13 100644 --- a/FEATURES.md +++ b/FEATURES.md @@ -1 +1,39 @@ +# Features +This library provides a client for communication with a CaosDB server over the +CaosDB GRPC-APIs. The client supports + +* Transaction of entities and file transmission. +* Authentication via Username/Password. +* Secure communication via TLS. +* Multiple connections with different servers. +* Logging. +* File-based configuration. + +The core is written in C++ and makes heavy use of object-oriented patterns. It +results in a c++ library -- libcaosdb. + +For using the library in a plain C context, a thin wrapper is included +-- libccaosdb. It wrapps the C++ classes into structs and the member methods +into functions which operate on the wrapped C++ instances. + +Minimal testing executables in C++ and C are included as well, but they only +serve as just that -- minimal testing. + +## CaosDB Entitiy API + +This library implements a subset of the CaosDB Entitiy API (caosdb.entity.v1) as a client. + +Current limitations: The implementation does not support mixing retrievals with write-transactions. + +## CaosDB Info API + +This library implements the CaosDB Info API (caosdb.info.v1) as a client without limitations. + +## Thread-safety and Concurrency + +Currently, the library should not be considered thread-safe. + +The `caosdb::transaction::Transaction` class is designed with an with an +interface ready for concurrent and asyncronous transactions. However, the +functions are actually implemented in a blocking, synchronous way. diff --git a/conanfile.py b/conanfile.py index 04d2b1f..000b18c 100644 --- a/conanfile.py +++ b/conanfile.py @@ -3,7 +3,7 @@ from conans import ConanFile, CMake, tools class CaosdbConan(ConanFile): name = "caosdb" - version = "0.0.20" + version = "0.0.21" license = "AGPL-3.0-or-later" author = "Timm C. Fitschen <t.fitschen@indiscale.com>" url = "https://gitlab.indiscale.com/caosdb/src/caosdb-cpplib.git" diff --git a/include/caosdb/connection.h b/include/caosdb/connection.h index d3ed094..55a92fa 100644 --- a/include/caosdb/connection.h +++ b/include/caosdb/connection.h @@ -27,27 +27,27 @@ * @date 2021-05-18 * @brief Configuration and setup of the connection. */ -#include <map> // for map -#include <memory> // for shared_ptr, unique_ptr -#include <string> // for string, basic_string -#include "boost/filesystem/path.hpp" // for path -#include "caosdb/authentication.h" // for Authenticator -#include "caosdb/configuration.h" // for ConnectionConfigura... -#include "caosdb/entity/v1alpha1/main.grpc.pb.h" // for EntityTransactionSe... -#include "caosdb/info.h" // for VersionInfo -#include "caosdb/info/v1alpha1/main.grpc.pb.h" // for GeneralInfoService:... -#include "caosdb/transaction.h" // for Transaction -#include "caosdb/transaction_status.h" // for TransactionStatus -#include "grpcpp/channel.h" // for Channel +#include <map> // for map +#include <memory> // for shared_ptr, unique_ptr +#include <string> // for string, basic_string +#include "boost/filesystem/path.hpp" // for path +#include "caosdb/authentication.h" // for Authenticator +#include "caosdb/configuration.h" // for ConnectionConfigura... +#include "caosdb/entity/v1/main.grpc.pb.h" // for EntityTransactionSe... +#include "caosdb/info.h" // for VersionInfo +#include "caosdb/info/v1/main.grpc.pb.h" // for GeneralInfoService:... +#include "caosdb/transaction.h" // for Transaction +#include "caosdb/transaction_status.h" // for TransactionStatus +#include "grpcpp/channel.h" // for Channel namespace caosdb::connection { using boost::filesystem::path; using caosdb::authentication::Authenticator; using caosdb::configuration::ConnectionConfiguration; -using caosdb::entity::v1alpha1::EntityTransactionService; -using caosdb::entity::v1alpha1::FileTransmissionService; +using caosdb::entity::v1::EntityTransactionService; +using caosdb::entity::v1::FileTransmissionService; using caosdb::info::VersionInfo; -using caosdb::info::v1alpha1::GeneralInfoService; +using caosdb::info::v1::GeneralInfoService; using caosdb::transaction::Transaction; using caosdb::transaction::TransactionStatus; diff --git a/include/caosdb/data_type.h b/include/caosdb/data_type.h index 771ca8c..11909c0 100644 --- a/include/caosdb/data_type.h +++ b/include/caosdb/data_type.h @@ -28,17 +28,17 @@ #ifndef CAOSDB_DATA_TYPE_H #define CAOSDB_DATA_TYPE_H -#include "caosdb/protobuf_helper.h" // for ProtoMessageWrapper -#include "caosdb/entity/v1alpha1/main.pb.h" // for RepeatedPtrField, Message -#include <memory> // for unique_ptr -#include <string> // for string +#include "caosdb/protobuf_helper.h" // for ProtoMessageWrapper +#include "caosdb/entity/v1/main.pb.h" // for RepeatedPtrField, Message +#include <memory> // for unique_ptr +#include <string> // for string namespace caosdb::entity { -using ProtoAtomicDataType = caosdb::entity::v1alpha1::AtomicDataType; -using ProtoDataType = caosdb::entity::v1alpha1::DataType; -using ProtoListDataType = caosdb::entity::v1alpha1::ListDataType; -using ProtoReferenceDataType = caosdb::entity::v1alpha1::ReferenceDataType; -using DataTypeCase = caosdb::entity::v1alpha1::DataType::DataTypeCase; -using ListDataTypeCase = caosdb::entity::v1alpha1::ListDataType::ListDataTypeCase; +using ProtoAtomicDataType = caosdb::entity::v1::AtomicDataType; +using ProtoDataType = caosdb::entity::v1::DataType; +using ProtoListDataType = caosdb::entity::v1::ListDataType; +using ProtoReferenceDataType = caosdb::entity::v1::ReferenceDataType; +using DataTypeCase = caosdb::entity::v1::DataType::DataTypeCase; +using ListDataTypeCase = caosdb::entity::v1::ListDataType::ListDataTypeCase; using caosdb::utility::ProtoMessageWrapper; using caosdb::utility::ScalarProtoMessageWrapper; diff --git a/include/caosdb/entity.h b/include/caosdb/entity.h index 0e34e43..f109734 100644 --- a/include/caosdb/entity.h +++ b/include/caosdb/entity.h @@ -30,7 +30,7 @@ #define CAOSDB_ENTITY_H #include "caosdb/data_type.h" // for DataType -#include "caosdb/entity/v1alpha1/main.pb.h" // for RepeatedPtrField +#include "caosdb/entity/v1/main.pb.h" // for RepeatedPtrField #include "caosdb/logging.h" // for CAOSDB_LOG_WARN #include "caosdb/message_code.h" // for get_message_code #include "caosdb/protobuf_helper.h" // for get_arena @@ -57,19 +57,19 @@ namespace caosdb::entity { using boost::filesystem::exists; using boost::filesystem::is_directory; -using caosdb::entity::v1alpha1::IdResponse; -using ProtoParent = caosdb::entity::v1alpha1::Parent; -using ProtoProperty = caosdb::entity::v1alpha1::Property; -using ProtoEntity = caosdb::entity::v1alpha1::Entity; -using ProtoFileDescriptor = caosdb::entity::v1alpha1::FileDescriptor; -using ProtoMessage = caosdb::entity::v1alpha1::Message; -using ProtoValue = caosdb::entity::v1alpha1::Value; -using ProtoDataType = caosdb::entity::v1alpha1::DataType; -using caosdb::entity::v1alpha1::EntityRole; -using ProtoImportance = caosdb::entity::v1alpha1::Importance; +using caosdb::entity::v1::IdResponse; +using ProtoParent = caosdb::entity::v1::Parent; +using ProtoProperty = caosdb::entity::v1::Property; +using ProtoEntity = caosdb::entity::v1::Entity; +using ProtoFileDescriptor = caosdb::entity::v1::FileDescriptor; +using ProtoMessage = caosdb::entity::v1::Message; +using ProtoValue = caosdb::entity::v1::Value; +using ProtoDataType = caosdb::entity::v1::DataType; +using caosdb::entity::v1::EntityRole; +using ProtoImportance = caosdb::entity::v1::Importance; using caosdb::StatusCode; -using caosdb::entity::v1alpha1::EntityResponse; -using caosdb::entity::v1alpha1::FileTransmissionId; +using caosdb::entity::v1::EntityResponse; +using caosdb::entity::v1::FileTransmissionId; using caosdb::utility::get_arena; using caosdb::utility::ProtoMessageWrapper; using ::google::protobuf::RepeatedPtrField; @@ -485,8 +485,7 @@ public: private: inline Parents() : RepeatedPtrFieldWrapper<Parent, ProtoParent>(){}; - explicit inline Parents( - ::google::protobuf::RepeatedPtrField<caosdb::entity::v1alpha1::Parent> *wrapped) + explicit inline Parents(::google::protobuf::RepeatedPtrField<caosdb::entity::v1::Parent> *wrapped) : RepeatedPtrFieldWrapper<Parent, ProtoParent>(wrapped){}; }; diff --git a/include/caosdb/file_transmission/download_request_handler.h b/include/caosdb/file_transmission/download_request_handler.h index 3af72cc..0a8e13a 100644 --- a/include/caosdb/file_transmission/download_request_handler.h +++ b/include/caosdb/file_transmission/download_request_handler.h @@ -50,8 +50,8 @@ #define CAOSDB_FILE_TRANSMISSION_DOWNLOAD_REQUEST_HANDLER_H #include "caosdb/entity.h" // for FileDescriptor -#include "caosdb/entity/v1alpha1/main.grpc.pb.h" // for FileTransmissionS... -#include "caosdb/entity/v1alpha1/main.pb.h" // for FileDownloadResponse +#include "caosdb/entity/v1/main.grpc.pb.h" // for FileTransmissionS... +#include "caosdb/entity/v1/main.pb.h" // for FileDownloadResponse #include "caosdb/file_transmission/file_writer.h" // for FileWriter #include "caosdb/handler_interface.h" // for HandlerTag, Handl... #include <grpcpp/impl/codegen/async_stream.h> // for ClientAsyncReader @@ -62,9 +62,9 @@ namespace caosdb::transaction { using caosdb::entity::FileDescriptor; -using caosdb::entity::v1alpha1::FileDownloadRequest; -using caosdb::entity::v1alpha1::FileDownloadResponse; -using caosdb::entity::v1alpha1::FileTransmissionService; +using caosdb::entity::v1::FileDownloadRequest; +using caosdb::entity::v1::FileDownloadResponse; +using caosdb::entity::v1::FileTransmissionService; using caosdb::transaction::HandlerInterface; using caosdb::transaction::HandlerTag; diff --git a/include/caosdb/file_transmission/register_file_upload_handler.h b/include/caosdb/file_transmission/register_file_upload_handler.h index f458622..37df2db 100644 --- a/include/caosdb/file_transmission/register_file_upload_handler.h +++ b/include/caosdb/file_transmission/register_file_upload_handler.h @@ -49,9 +49,9 @@ #ifndef CAOSDB_FILE_TRANSMISSION_REGISTER_FILE_UPLOAD_H #define CAOSDB_FILE_TRANSMISSION_REGISTER_FILE_UPLOAD_H -#include "caosdb/entity/v1alpha1/main.grpc.pb.h" // for FileTransmissionS... -#include "caosdb/entity/v1alpha1/main.pb.h" // for FileDownloadResponse -#include "caosdb/handler_interface.h" // for HandlerTag, Handl... +#include "caosdb/entity/v1/main.grpc.pb.h" // for FileTransmissionS... +#include "caosdb/entity/v1/main.pb.h" // for FileDownloadResponse +#include "caosdb/handler_interface.h" // for HandlerTag, Handl... #include "caosdb/unary_rpc_handler.h" #include <grpcpp/impl/codegen/async_unary_call.h> // for ClientAsyncRespons... #include <grpcpp/impl/codegen/completion_queue.h> // for CompletionQueue @@ -59,9 +59,9 @@ namespace caosdb::transaction { -using caosdb::entity::v1alpha1::FileTransmissionService; -using caosdb::entity::v1alpha1::RegisterFileUploadRequest; -using caosdb::entity::v1alpha1::RegisterFileUploadResponse; +using caosdb::entity::v1::FileTransmissionService; +using caosdb::entity::v1::RegisterFileUploadRequest; +using caosdb::entity::v1::RegisterFileUploadResponse; class RegisterFileUploadHandler final : public UnaryRpcHandler { public: diff --git a/include/caosdb/file_transmission/upload_request_handler.h b/include/caosdb/file_transmission/upload_request_handler.h index 9965d54..cb9748f 100644 --- a/include/caosdb/file_transmission/upload_request_handler.h +++ b/include/caosdb/file_transmission/upload_request_handler.h @@ -50,8 +50,8 @@ #define CAOSDB_FILE_TRANSMISSION_UPLOAD_REQUEST_HANDLER_H #include "caosdb/entity.h" // for FileDescriptor -#include "caosdb/entity/v1alpha1/main.grpc.pb.h" // for FileTransmissionS... -#include "caosdb/entity/v1alpha1/main.pb.h" // for FileUploadRequest +#include "caosdb/entity/v1/main.grpc.pb.h" // for FileTransmissionS... +#include "caosdb/entity/v1/main.pb.h" // for FileUploadRequest #include "caosdb/file_transmission/file_reader.h" // for FileReader #include "caosdb/handler_interface.h" // for HandlerTag, Handl... #include <cstdint> // for uint64_t @@ -63,9 +63,9 @@ namespace caosdb::transaction { using caosdb::entity::FileDescriptor; -using caosdb::entity::v1alpha1::FileTransmissionService; -using caosdb::entity::v1alpha1::FileUploadRequest; -using caosdb::entity::v1alpha1::FileUploadResponse; +using caosdb::entity::v1::FileTransmissionService; +using caosdb::entity::v1::FileUploadRequest; +using caosdb::entity::v1::FileUploadResponse; using caosdb::transaction::HandlerInterface; using caosdb::transaction::HandlerTag; diff --git a/include/caosdb/info.h b/include/caosdb/info.h index cf2c879..0c4132f 100644 --- a/include/caosdb/info.h +++ b/include/caosdb/info.h @@ -27,13 +27,13 @@ * @date 2021-07-02 * @brief General information about the CaosDBServer. */ -#include "caosdb/info/v1alpha1/main.pb.h" // for VersionInfo -#include <cstdint> // for uint32_t -#include <string> // for string +#include "caosdb/info/v1/main.pb.h" // for VersionInfo +#include <cstdint> // for uint32_t +#include <string> // for string namespace caosdb::info { -using ProtoVersionInfo = caosdb::info::v1alpha1::VersionInfo; +using ProtoVersionInfo = caosdb::info::v1::VersionInfo; /** * A read-only version object which represents the version of the server. diff --git a/include/caosdb/message_code.h b/include/caosdb/message_code.h index a277656..f595995 100644 --- a/include/caosdb/message_code.h +++ b/include/caosdb/message_code.h @@ -22,7 +22,7 @@ #ifndef CAOSDB_MESSAGE_CODE_H #define CAOSDB_MESSAGE_CODE_H -#include "caosdb/entity/v1alpha1/main.pb.h" // for Entity, RepeatedField +#include "caosdb/entity/v1/main.pb.h" // for Entity, RepeatedField /** * MessageCodes for entity messages. @@ -38,16 +38,68 @@ namespace caosdb::entity { +#define _MAP_MESSAGE_CODE(name)\ + name = caosdb::entity::v1::MessageCode::MESSAGE_CODE_## name + enum MessageCode { - UNSPECIFIED = caosdb::entity::v1alpha1::MessageCode::MESSAGE_CODE_UNSPECIFIED, - UNKNOWN = caosdb::entity::v1alpha1::MessageCode::MESSAGE_CODE_UNKNOWN, - ENTITY_DOES_NOT_EXIST = caosdb::entity::v1alpha1::MessageCode::MESSAGE_CODE_ENTITY_DOES_NOT_EXIST, - ENTITY_HAS_NO_PROPERTIES = - caosdb::entity::v1alpha1::MessageCode::MESSAGE_CODE_ENTITY_HAS_NO_PROPERTIES, - INTEGER_VALUE_OUT_OF_RANGE = - caosdb::entity::v1alpha1::MessageCode::MESSAGE_CODE_INTEGER_VALUE_OUT_OF_RANGE, - ENTITY_HAS_BEEN_DELETED_SUCCESSFULLY = - caosdb::entity::v1alpha1::MessageCode::MESSAGE_CODE_ENTITY_HAS_BEEN_DELETED_SUCCESSFULLY, + _MAP_MESSAGE_CODE(UNSPECIFIED), + _MAP_MESSAGE_CODE(UNKNOWN), + _MAP_MESSAGE_CODE(ENTITY_DOES_NOT_EXIST), + _MAP_MESSAGE_CODE(ENTITY_HAS_NO_PROPERTIES), + _MAP_MESSAGE_CODE(ENTITY_HAS_BEEN_DELETED_SUCCESSFULLY), + _MAP_MESSAGE_CODE(ENTITY_HAS_UNQUALIFIED_PROPERTIES), + _MAP_MESSAGE_CODE(ENTITY_HAS_UNQUALIFIED_PARENTS), + _MAP_MESSAGE_CODE(ENTITY_HAS_NO_ID), + _MAP_MESSAGE_CODE(REQUIRED_BY_PERSISTENT_ENTITY), + _MAP_MESSAGE_CODE(PROPERTY_HAS_NO_DATA_TYPE), + _MAP_MESSAGE_CODE(ENTITY_HAS_NO_DESCRIPTION), + _MAP_MESSAGE_CODE(ENTITY_HAS_NO_NAME), + _MAP_MESSAGE_CODE(OBLIGATORY_PROPERTY_MISSING), + _MAP_MESSAGE_CODE(ENTITY_HAS_NO_PARENTS), + _MAP_MESSAGE_CODE(FILE_HAS_NO_TARGET_PATH), + _MAP_MESSAGE_CODE(TARGET_PATH_NOT_ALLOWED), + _MAP_MESSAGE_CODE(TARGET_PATH_EXISTS), + _MAP_MESSAGE_CODE(PROPERTY_HAS_NO_UNIT), + _MAP_MESSAGE_CODE(CANNOT_PARSE_VALUE), + _MAP_MESSAGE_CODE(CHECKSUM_TEST_FAILED), + _MAP_MESSAGE_CODE(SIZE_TEST_FAILED), + _MAP_MESSAGE_CODE(CANNOT_CREATE_PARENT_FOLDER), + _MAP_MESSAGE_CODE(FILE_HAS_NOT_BEEN_UPLOAED), + _MAP_MESSAGE_CODE(CANNOT_MOVE_FILE_TO_TARGET_PATH), + _MAP_MESSAGE_CODE(CANNOT_PARSE_DATETIME_VALUE), + _MAP_MESSAGE_CODE(CANNOT_PARSE_DOUBLE_VALUE), + _MAP_MESSAGE_CODE(CANNOT_PARSE_INT_VALUE), + _MAP_MESSAGE_CODE(CANNOT_PARSE_BOOL_VALUE), + _MAP_MESSAGE_CODE(FILE_NOT_FOUND), + _MAP_MESSAGE_CODE(WARNING_OCCURED), + _MAP_MESSAGE_CODE(ENTITY_NAME_IS_NOT_UNIQUE), + _MAP_MESSAGE_CODE(QUERY_EXCEPTION), + _MAP_MESSAGE_CODE(TRANSACTION_ROLL_BACK), + _MAP_MESSAGE_CODE(UNKNOWN_UNIT), + _MAP_MESSAGE_CODE(AUTHORIZATION_ERROR), + _MAP_MESSAGE_CODE(REFERENCE_IS_NOT_ALLOWED_BY_DATA_TYPE), + _MAP_MESSAGE_CODE(ENTITY_NAME_DUPLICATES), + _MAP_MESSAGE_CODE(DATA_TYPE_NAME_DUPLICATES), + _MAP_MESSAGE_CODE(ENTITY_HAS_NO_NAME_OR_ID), + _MAP_MESSAGE_CODE(AFFILIATION_ERROR), + _MAP_MESSAGE_CODE(QUERY_PARSING_ERROR), + _MAP_MESSAGE_CODE(NAME_PROPERTIES_MUST_BE_TEXT), + _MAP_MESSAGE_CODE(PARENT_DUPLICATES_WARNING), + _MAP_MESSAGE_CODE(PARENT_DUPLICATES_ERROR), + _MAP_MESSAGE_CODE(ATOMICITY_ERROR), + _MAP_MESSAGE_CODE(NO_SUCH_ENTITY_ROLE), + _MAP_MESSAGE_CODE(REQUIRED_BY_UNQUALIFIED), + _MAP_MESSAGE_CODE(ENTITY_HAS_UNQUALIFIED_REFERENCE), + _MAP_MESSAGE_CODE(REFERENCED_ENTITY_DOES_NOT_EXIST), + _MAP_MESSAGE_CODE(REFERENCE_NAME_DUPLICATES), + _MAP_MESSAGE_CODE(DATA_TYPE_INHERITANCE_AMBIGUOUS), + _MAP_MESSAGE_CODE(DATA_TYPE_DOES_NOT_ACCEPT_COLLECTION_VALUES), + _MAP_MESSAGE_CODE(CANNOT_PARSE_UNIT), + _MAP_MESSAGE_CODE(ADDITIONAL_PROPERTY), + _MAP_MESSAGE_CODE(PROPERTY_WITH_DATA_TYPE_OVERRIDE), + _MAP_MESSAGE_CODE(PROPERTY_WITH_DESCRIPTION_OVERRIDE), + _MAP_MESSAGE_CODE(PROPERTY_WITH_NAME_OVERRIDE), + _MAP_MESSAGE_CODE(INTEGER_VALUE_OUT_OF_RANGE), }; [[nodiscard]] inline auto get_message_code(int code) noexcept -> MessageCode { @@ -57,12 +109,64 @@ enum MessageCode { MessageCode::UNKNOWN, MessageCode::ENTITY_DOES_NOT_EXIST, MessageCode::ENTITY_HAS_NO_PROPERTIES, - MessageCode::INTEGER_VALUE_OUT_OF_RANGE, MessageCode::ENTITY_HAS_BEEN_DELETED_SUCCESSFULLY, + MessageCode::ENTITY_HAS_UNQUALIFIED_PROPERTIES, + MessageCode::ENTITY_HAS_UNQUALIFIED_PARENTS, + MessageCode::ENTITY_HAS_NO_ID, + MessageCode::REQUIRED_BY_PERSISTENT_ENTITY, + MessageCode::PROPERTY_HAS_NO_DATA_TYPE, + MessageCode::ENTITY_HAS_NO_DESCRIPTION, + MessageCode::ENTITY_HAS_NO_NAME, + MessageCode::OBLIGATORY_PROPERTY_MISSING, + MessageCode::ENTITY_HAS_NO_PARENTS, + MessageCode::FILE_HAS_NO_TARGET_PATH, + MessageCode::TARGET_PATH_NOT_ALLOWED, + MessageCode::TARGET_PATH_EXISTS, + MessageCode::PROPERTY_HAS_NO_UNIT, + MessageCode::CANNOT_PARSE_VALUE, + MessageCode::CHECKSUM_TEST_FAILED, + MessageCode::SIZE_TEST_FAILED, + MessageCode::CANNOT_CREATE_PARENT_FOLDER, + MessageCode::FILE_HAS_NOT_BEEN_UPLOAED, + MessageCode::CANNOT_MOVE_FILE_TO_TARGET_PATH, + MessageCode::CANNOT_PARSE_DATETIME_VALUE, + MessageCode::CANNOT_PARSE_DOUBLE_VALUE, + MessageCode::CANNOT_PARSE_INT_VALUE, + MessageCode::CANNOT_PARSE_BOOL_VALUE, + MessageCode::FILE_NOT_FOUND, + MessageCode::WARNING_OCCURED, + MessageCode::ENTITY_NAME_IS_NOT_UNIQUE, + MessageCode::QUERY_EXCEPTION, + MessageCode::TRANSACTION_ROLL_BACK, + MessageCode::UNKNOWN_UNIT, + MessageCode::AUTHORIZATION_ERROR, + MessageCode::REFERENCE_IS_NOT_ALLOWED_BY_DATA_TYPE, + MessageCode::ENTITY_NAME_DUPLICATES, + MessageCode::DATA_TYPE_NAME_DUPLICATES, + MessageCode::ENTITY_HAS_NO_NAME_OR_ID, + MessageCode::AFFILIATION_ERROR, + MessageCode::QUERY_PARSING_ERROR, + MessageCode::NAME_PROPERTIES_MUST_BE_TEXT, + MessageCode::PARENT_DUPLICATES_WARNING, + MessageCode::PARENT_DUPLICATES_ERROR, + MessageCode::ATOMICITY_ERROR, + MessageCode::NO_SUCH_ENTITY_ROLE, + MessageCode::REQUIRED_BY_UNQUALIFIED, + MessageCode::ENTITY_HAS_UNQUALIFIED_REFERENCE, + MessageCode::REFERENCED_ENTITY_DOES_NOT_EXIST, + MessageCode::REFERENCE_NAME_DUPLICATES, + MessageCode::DATA_TYPE_INHERITANCE_AMBIGUOUS, + MessageCode::DATA_TYPE_DOES_NOT_ACCEPT_COLLECTION_VALUES, + MessageCode::CANNOT_PARSE_UNIT, + MessageCode::ADDITIONAL_PROPERTY, + MessageCode::PROPERTY_WITH_DATA_TYPE_OVERRIDE, + MessageCode::PROPERTY_WITH_DESCRIPTION_OVERRIDE, + MessageCode::PROPERTY_WITH_NAME_OVERRIDE, + MessageCode::INTEGER_VALUE_OUT_OF_RANGE, }; for (MessageCode known_code : all_codes) { - if (known_code == code) { + if (static_cast<int>(known_code) == code) { return known_code; } } diff --git a/include/caosdb/transaction.h b/include/caosdb/transaction.h index 634c7a0..b93be12 100644 --- a/include/caosdb/transaction.h +++ b/include/caosdb/transaction.h @@ -22,8 +22,8 @@ #define CAOSDB_TRANSACTION_H #include "caosdb/entity.h" // for Entity, FileDe... -#include "caosdb/entity/v1alpha1/main.grpc.pb.h" // for EntityTransact... -#include "caosdb/entity/v1alpha1/main.pb.h" // for MultiTransacti... +#include "caosdb/entity/v1/main.grpc.pb.h" // for EntityTransact... +#include "caosdb/entity/v1/main.pb.h" // for MultiTransacti... #include "caosdb/handler_interface.h" // for HandlerInterface #include "caosdb/transaction_handler.h" // for EntityTransactionHandler #include "caosdb/logging.h" // for CAOSDB_LOG_ERR... @@ -163,22 +163,21 @@ namespace caosdb::transaction { using caosdb::entity::Entity; using caosdb::entity::FileDescriptor; -using caosdb::entity::v1alpha1::EntityResponse; -using caosdb::entity::v1alpha1::EntityTransactionService; -using caosdb::entity::v1alpha1::FileDownloadRequest; -using caosdb::entity::v1alpha1::FileDownloadResponse; -using caosdb::entity::v1alpha1::FileTransmissionId; -using caosdb::entity::v1alpha1::FileTransmissionService; -using caosdb::entity::v1alpha1::FileUploadRequest; -using caosdb::entity::v1alpha1::FileUploadResponse; -using caosdb::entity::v1alpha1::IdResponse; -using caosdb::entity::v1alpha1::MultiTransactionRequest; -using caosdb::entity::v1alpha1::MultiTransactionResponse; -using caosdb::entity::v1alpha1::RegisterFileUploadRequest; -using caosdb::entity::v1alpha1::RegisterFileUploadResponse; +using caosdb::entity::v1::EntityResponse; +using caosdb::entity::v1::EntityTransactionService; +using caosdb::entity::v1::FileDownloadRequest; +using caosdb::entity::v1::FileDownloadResponse; +using caosdb::entity::v1::FileTransmissionId; +using caosdb::entity::v1::FileTransmissionService; +using caosdb::entity::v1::FileUploadRequest; +using caosdb::entity::v1::FileUploadResponse; +using caosdb::entity::v1::IdResponse; +using caosdb::entity::v1::MultiTransactionRequest; +using caosdb::entity::v1::MultiTransactionResponse; +using caosdb::entity::v1::RegisterFileUploadRequest; +using caosdb::entity::v1::RegisterFileUploadResponse; using caosdb::transaction::TransactionStatus; -using TransactionResponseCase = - caosdb::entity::v1alpha1::TransactionResponse::TransactionResponseCase; +using TransactionResponseCase = caosdb::entity::v1::TransactionResponse::TransactionResponseCase; using caosdb::utility::get_arena; using google::protobuf::Arena; diff --git a/include/caosdb/transaction_handler.h b/include/caosdb/transaction_handler.h index 18cb5fc..6fa386b 100644 --- a/include/caosdb/transaction_handler.h +++ b/include/caosdb/transaction_handler.h @@ -1,6 +1,6 @@ #pragma once -#include "caosdb/entity/v1alpha1/main.grpc.pb.h" // for FileTransmissionS... -#include "caosdb/entity/v1alpha1/main.pb.h" // for FileDownloadResponse +#include "caosdb/entity/v1/main.grpc.pb.h" // for FileTransmissionS... +#include "caosdb/entity/v1/main.pb.h" // for FileDownloadResponse #include "caosdb/handler_interface.h" // for HandlerTag #include "caosdb/unary_rpc_handler.h" // for HandlerTag, Handl... #include <grpcpp/impl/codegen/async_unary_call.h> // for ClientAsyncRespons... @@ -9,9 +9,9 @@ namespace caosdb::transaction { -using caosdb::entity::v1alpha1::EntityTransactionService; -using caosdb::entity::v1alpha1::MultiTransactionRequest; -using caosdb::entity::v1alpha1::MultiTransactionResponse; +using caosdb::entity::v1::EntityTransactionService; +using caosdb::entity::v1::MultiTransactionRequest; +using caosdb::entity::v1::MultiTransactionResponse; class EntityTransactionHandler final : public UnaryRpcHandler { public: diff --git a/include/caosdb/value.h b/include/caosdb/value.h index 8296be3..a92847a 100644 --- a/include/caosdb/value.h +++ b/include/caosdb/value.h @@ -21,14 +21,14 @@ #ifndef CAOSDB_VALUE_H #define CAOSDB_VALUE_H -#include "caosdb/protobuf_helper.h" // for ProtoMessageWrapper -#include "caosdb/entity/v1alpha1/main.pb.h" // for RepeatedPtrField, Message -#include <cstdint> // for int64_t -#include <google/protobuf/arena.h> // for Arena -#include <memory> // for unique_ptr -#include <string> // for string, operator== -#include <utility> // for move -#include <vector> // for vector +#include "caosdb/protobuf_helper.h" // for ProtoMessageWrapper +#include "caosdb/entity/v1/main.pb.h" // for RepeatedPtrField, Message +#include <cstdint> // for int64_t +#include <google/protobuf/arena.h> // for Arena +#include <memory> // for unique_ptr +#include <string> // for string, operator== +#include <utility> // for move +#include <vector> // for vector #define LIST_VALUE_CONSTRUCTOR(TYPE, SETTER) \ explicit inline Value(const std::vector<TYPE> &values) \ @@ -43,11 +43,11 @@ using caosdb::utility::get_arena; using caosdb::utility::ProtoMessageWrapper; using caosdb::utility::ScalarProtoMessageWrapper; using google::protobuf::Arena; -using ProtoSpecialValue = caosdb::entity::v1alpha1::SpecialValue; -using ProtoValue = caosdb::entity::v1alpha1::Value; -using ProtoScalarValue = caosdb::entity::v1alpha1::ScalarValue; -using ValueCase = caosdb::entity::v1alpha1::Value::ValueCase; -using ScalarValueCase = caosdb::entity::v1alpha1::ScalarValue::ScalarValueCase; +using ProtoSpecialValue = caosdb::entity::v1::SpecialValue; +using ProtoValue = caosdb::entity::v1::Value; +using ProtoScalarValue = caosdb::entity::v1::ScalarValue; +using ValueCase = caosdb::entity::v1::Value::ValueCase; +using ScalarValueCase = caosdb::entity::v1::ScalarValue::ScalarValueCase; class ScalarValue; class Value; diff --git a/proto b/proto index 73d85fb..063b094 160000 --- a/proto +++ b/proto @@ -1 +1 @@ -Subproject commit 73d85fb20bb16902c0a89dda697eed17994712bc +Subproject commit 063b09421ad064e13fa858076fcb4de616cfe6cb diff --git a/src/caosdb/connection.cpp b/src/caosdb/connection.cpp index d1b80d0..02c190e 100644 --- a/src/caosdb/connection.cpp +++ b/src/caosdb/connection.cpp @@ -23,8 +23,8 @@ #include "caosdb/configuration.h" // for ConnectionConfigur... #include "caosdb/exceptions.h" // for ConfigurationError #include "caosdb/info.h" // for VersionInfo -#include "caosdb/info/v1alpha1/main.grpc.pb.h" // for GeneralInfoService -#include "caosdb/info/v1alpha1/main.pb.h" // for GetVersionInfoRequest +#include "caosdb/info/v1/main.grpc.pb.h" // for GeneralInfoService +#include "caosdb/info/v1/main.pb.h" // for GetVersionInfoRequest #include "caosdb/transaction.h" // for Transaction #include "caosdb/transaction_status.h" // for TransactionStatus #include "grpcpp/impl/codegen/status_code_enum.h" // for StatusCode, UNAUTH... @@ -36,12 +36,12 @@ namespace caosdb::connection { using caosdb::configuration::ConfigurationManager; using caosdb::configuration::ConnectionConfiguration; -using caosdb::entity::v1alpha1::EntityTransactionService; -using caosdb::entity::v1alpha1::FileTransmissionService; +using caosdb::entity::v1::EntityTransactionService; +using caosdb::entity::v1::FileTransmissionService; using caosdb::info::VersionInfo; -using caosdb::info::v1alpha1::GeneralInfoService; -using caosdb::info::v1alpha1::GetVersionInfoRequest; -using caosdb::info::v1alpha1::GetVersionInfoResponse; +using caosdb::info::v1::GeneralInfoService; +using caosdb::info::v1::GetVersionInfoRequest; +using caosdb::info::v1::GetVersionInfoResponse; using caosdb::transaction::Transaction; using caosdb::transaction::TransactionStatus; diff --git a/src/caosdb/entity.cpp b/src/caosdb/entity.cpp index a3872e4..127d5b4 100644 --- a/src/caosdb/entity.cpp +++ b/src/caosdb/entity.cpp @@ -20,21 +20,21 @@ * */ #include "caosdb/entity.h" -#include "caosdb/data_type.h" // for DataType -#include "caosdb/entity/v1alpha1/main.pb.h" // for Messages -#include "caosdb/protobuf_helper.h" // for get_arena -#include "caosdb/value.h" // for Value -#include <google/protobuf/arena.h> // for Arena -#include <new> // for operator new +#include "caosdb/data_type.h" // for DataType +#include "caosdb/entity/v1/main.pb.h" // for Messages +#include "caosdb/protobuf_helper.h" // for get_arena +#include "caosdb/value.h" // for Value +#include <google/protobuf/arena.h> // for Arena +#include <new> // for operator new namespace caosdb::entity { -using ProtoParent = caosdb::entity::v1alpha1::Parent; -using ProtoProperty = caosdb::entity::v1alpha1::Property; -using ProtoEntity = caosdb::entity::v1alpha1::Entity; -using ProtoImportance = caosdb::entity::v1alpha1::Importance; -using caosdb::entity::v1alpha1::EntityRole; -using ProtoMessage = caosdb::entity::v1alpha1::Message; -using ProtoFileDescriptor = caosdb::entity::v1alpha1::FileDescriptor; +using ProtoParent = caosdb::entity::v1::Parent; +using ProtoProperty = caosdb::entity::v1::Property; +using ProtoEntity = caosdb::entity::v1::Entity; +using ProtoImportance = caosdb::entity::v1::Importance; +using caosdb::entity::v1::EntityRole; +using ProtoMessage = caosdb::entity::v1::Message; +using ProtoFileDescriptor = caosdb::entity::v1::FileDescriptor; using caosdb::utility::get_arena; using google::protobuf::Arena; diff --git a/src/caosdb/transaction.cpp b/src/caosdb/transaction.cpp index 002d20d..2bd0fda 100644 --- a/src/caosdb/transaction.cpp +++ b/src/caosdb/transaction.cpp @@ -18,8 +18,8 @@ * */ #include "caosdb/transaction.h" -#include "caosdb/entity/v1alpha1/main.grpc.pb.h" // for EntityTransac... -#include "caosdb/entity/v1alpha1/main.pb.h" // for TransactionRe... +#include "caosdb/entity/v1/main.grpc.pb.h" // for EntityTransac... +#include "caosdb/entity/v1/main.pb.h" // for TransactionRe... #include "caosdb/file_transmission/download_request_handler.h" // Download... #include "caosdb/file_transmission/file_reader.h" // for path #include "caosdb/file_transmission/register_file_upload_handler.h" // for RegisterFileUploadHandler @@ -45,17 +45,16 @@ #include <utility> // for move, pair namespace caosdb::transaction { -using caosdb::entity::v1alpha1::EntityTransactionService; -using caosdb::entity::v1alpha1::FileTransmissionService; -using caosdb::entity::v1alpha1::MultiTransactionRequest; -using caosdb::entity::v1alpha1::MultiTransactionResponse; -using TransactionResponseCase = - caosdb::entity::v1alpha1::TransactionResponse::TransactionResponseCase; -using RetrieveResponseCase = caosdb::entity::v1alpha1::RetrieveResponse::RetrieveResponseCase; -using ProtoEntity = caosdb::entity::v1alpha1::Entity; +using caosdb::entity::v1::EntityTransactionService; +using caosdb::entity::v1::FileTransmissionService; +using caosdb::entity::v1::MultiTransactionRequest; +using caosdb::entity::v1::MultiTransactionResponse; +using TransactionResponseCase = caosdb::entity::v1::TransactionResponse::TransactionResponseCase; +using RetrieveResponseCase = caosdb::entity::v1::RetrieveResponse::RetrieveResponseCase; +using ProtoEntity = caosdb::entity::v1::Entity; using google::protobuf::Arena; using NextStatus = grpc::CompletionQueue::NextStatus; -using RegistrationStatus = caosdb::entity::v1alpha1::RegistrationStatus; +using RegistrationStatus = caosdb::entity::v1::RegistrationStatus; ResultSet::iterator::iterator(const ResultSet *result_set_param, int index) : current_index(index), result_set(result_set_param) {} diff --git a/test/test_data_type.cpp b/test/test_data_type.cpp index b1e714d..c846dce 100644 --- a/test/test_data_type.cpp +++ b/test/test_data_type.cpp @@ -22,7 +22,7 @@ #include "caosdb/data_type.h" // for DataType, AtomicDataType #include "caosdb/entity.h" // for Entity -#include "caosdb/entity/v1alpha1/main.pb.h" // for DataType, Ato... +#include "caosdb/entity/v1/main.pb.h" // for DataType, Ato... #include "caosdb/logging.h" // for CAOSDB_LOG_DEBUG #include "caosdb/protobuf_helper.h" // for CAOSDB_DEBUG_... #include <boost/log/core/record.hpp> // for record @@ -39,10 +39,10 @@ #include <utility> // for pair namespace caosdb::entity { -using ProtoEntity = caosdb::entity::v1alpha1::Entity; -using ProtoParent = caosdb::entity::v1alpha1::Parent; -using ProtoDataType = caosdb::entity::v1alpha1::DataType; -using ProtoAtomicDataType = caosdb::entity::v1alpha1::AtomicDataType; +using ProtoEntity = caosdb::entity::v1::Entity; +using ProtoParent = caosdb::entity::v1::Parent; +using ProtoDataType = caosdb::entity::v1::DataType; +using ProtoAtomicDataType = caosdb::entity::v1::AtomicDataType; TEST(test_data_type, test_atomic) { ProtoDataType proto_data_type; diff --git a/test/test_entity.cpp b/test/test_entity.cpp index f66ee3f..a027ad7 100644 --- a/test/test_entity.cpp +++ b/test/test_entity.cpp @@ -20,35 +20,35 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. * */ -#include "caosdb/data_type.h" // for DataType, AtomicDat... -#include "caosdb/entity.h" // for Entity, Property -#include "caosdb/entity/v1alpha1/main.grpc.pb.h" // for EntityTransactionSe... -#include "caosdb/entity/v1alpha1/main.pb.h" // for IdResponse, Message -#include "caosdb/message_code.h" // for MessageCode, ENTITY... -#include "caosdb/protobuf_helper.h" // for get_arena -#include "caosdb/status_code.h" // for StatusCode, FILE_DO... -#include "caosdb/transaction.h" // for Transaction -#include "caosdb/value.h" // for Value -#include "caosdb_test_utility.h" // for TEST_DATA_DIR -#include <google/protobuf/arena.h> // for Arena -#include <gtest/gtest-message.h> // for Message -#include <gtest/gtest-test-part.h> // for TestPartResult, Sui... -#include <gtest/gtest_pred_impl.h> // for Test, EXPECT_EQ -#include <iostream> // for operator<<, basic_o... -#include <memory> // for allocator, shared_ptr -#include <stdexcept> // for out_of_range -#include <string> // for operator+, to_string -#include <utility> // for move +#include "caosdb/data_type.h" // for DataType, AtomicDat... +#include "caosdb/entity.h" // for Entity, Property +#include "caosdb/entity/v1/main.grpc.pb.h" // for EntityTransactionSe... +#include "caosdb/entity/v1/main.pb.h" // for IdResponse, Message +#include "caosdb/message_code.h" // for MessageCode, ENTITY... +#include "caosdb/protobuf_helper.h" // for get_arena +#include "caosdb/status_code.h" // for StatusCode, FILE_DO... +#include "caosdb/transaction.h" // for Transaction +#include "caosdb/value.h" // for Value +#include "caosdb_test_utility.h" // for TEST_DATA_DIR +#include <google/protobuf/arena.h> // for Arena +#include <gtest/gtest-message.h> // for Message +#include <gtest/gtest-test-part.h> // for TestPartResult, Sui... +#include <gtest/gtest_pred_impl.h> // for Test, EXPECT_EQ +#include <iostream> // for operator<<, basic_o... +#include <memory> // for allocator, shared_ptr +#include <stdexcept> // for out_of_range +#include <string> // for operator+, to_string +#include <utility> // for move namespace caosdb::entity { -using caosdb::entity::v1alpha1::IdResponse; -using ProtoEntity = caosdb::entity::v1alpha1::Entity; -using ProtoParent = caosdb::entity::v1alpha1::Parent; -using ProtoProperty = caosdb::entity::v1alpha1::Property; -using ProtoAtomicDataType = caosdb::entity::v1alpha1::AtomicDataType; -using caosdb::entity::v1alpha1::EntityResponse; +using caosdb::entity::v1::IdResponse; +using ProtoEntity = caosdb::entity::v1::Entity; +using ProtoParent = caosdb::entity::v1::Parent; +using ProtoProperty = caosdb::entity::v1::Property; +using ProtoAtomicDataType = caosdb::entity::v1::AtomicDataType; +using caosdb::entity::v1::EntityResponse; using caosdb::utility::get_arena; -using ProtoEntityRole = caosdb::entity::v1alpha1::EntityRole; +using ProtoEntityRole = caosdb::entity::v1::EntityRole; TEST(test_entity, test_parent_setters) { auto parent = Parent(); diff --git a/test/test_info.cpp b/test/test_info.cpp index a958702..4331219 100644 --- a/test/test_info.cpp +++ b/test/test_info.cpp @@ -20,15 +20,15 @@ * */ -#include "caosdb/info.h" // for VersionInfo -#include "caosdb/info/v1alpha1/main.pb.h" // for VersionInfo -#include <gtest/gtest-message.h> // for Message -#include <gtest/gtest-test-part.h> // for TestPartResult, SuiteApiRe... -#include "gtest/gtest_pred_impl.h" // for Test, EXPECT_EQ, TEST -#include <memory> // for allocator +#include "caosdb/info.h" // for VersionInfo +#include "caosdb/info/v1/main.pb.h" // for VersionInfo +#include <gtest/gtest-message.h> // for Message +#include <gtest/gtest-test-part.h> // for TestPartResult, SuiteApiRe... +#include "gtest/gtest_pred_impl.h" // for Test, EXPECT_EQ, TEST +#include <memory> // for allocator namespace caosdb::info { -using ProtoVersionInfo = caosdb::info::v1alpha1::VersionInfo; +using ProtoVersionInfo = caosdb::info::v1::VersionInfo; TEST(test_info, create_info_from_proto_info) { auto *origial = new ProtoVersionInfo(); diff --git a/test/test_list_properties.cpp b/test/test_list_properties.cpp index bc82896..8e69ba3 100644 --- a/test/test_list_properties.cpp +++ b/test/test_list_properties.cpp @@ -20,23 +20,23 @@ * */ -#include "caosdb/data_type.h" // for DataType, AtomicDataType -#include "caosdb/entity.h" // for Entity -#include "caosdb/entity/v1alpha1/main.pb.h" // for AtomicDataType, DataType -#include "caosdb/value.h" // for Value -#include <cstdint> // for int64_t -#include <gtest/gtest-message.h> // for Message -#include <gtest/gtest-test-part.h> // for TestPartResult, SuiteApi... -#include <gtest/gtest_pred_impl.h> // for AssertionResult, Test -#include <memory> // for allocator_traits<>::valu... -#include <string> // for string -#include <vector> // for vector +#include "caosdb/data_type.h" // for DataType, AtomicDataType +#include "caosdb/entity.h" // for Entity +#include "caosdb/entity/v1/main.pb.h" // for AtomicDataType, DataType +#include "caosdb/value.h" // for Value +#include <cstdint> // for int64_t +#include <gtest/gtest-message.h> // for Message +#include <gtest/gtest-test-part.h> // for TestPartResult, SuiteApi... +#include <gtest/gtest_pred_impl.h> // for AssertionResult, Test +#include <memory> // for allocator_traits<>::valu... +#include <string> // for string +#include <vector> // for vector namespace caosdb::entity { -using ProtoEntity = caosdb::entity::v1alpha1::Entity; -using ProtoParent = caosdb::entity::v1alpha1::Parent; -using ProtoDataType = caosdb::entity::v1alpha1::DataType; -using ProtoAtomicDataType = caosdb::entity::v1alpha1::AtomicDataType; +using ProtoEntity = caosdb::entity::v1::Entity; +using ProtoParent = caosdb::entity::v1::Parent; +using ProtoDataType = caosdb::entity::v1::DataType; +using ProtoAtomicDataType = caosdb::entity::v1::AtomicDataType; TEST(test_list_property, test_list_of_text) { Property list_property; diff --git a/test/test_protobuf.cpp b/test/test_protobuf.cpp index 6f9bda0..8e5c84e 100644 --- a/test/test_protobuf.cpp +++ b/test/test_protobuf.cpp @@ -19,18 +19,18 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. * */ -#include "caosdb/data_type.h" // for DataType, ReferenceDataType -#include "caosdb/entity.h" // for Entity -#include "caosdb/entity/v1alpha1/main.pb.h" // for RepeatedPtrField, Message -#include <gtest/gtest-message.h> // for Message -#include <gtest/gtest-test-part.h> // for SuiteApiResolver, TestPa... -#include <gtest/gtest_pred_impl.h> // for Test, TestInfo, TEST -#include <memory> // for allocator +#include "caosdb/data_type.h" // for DataType, ReferenceDataType +#include "caosdb/entity.h" // for Entity +#include "caosdb/entity/v1/main.pb.h" // for RepeatedPtrField, Message +#include <gtest/gtest-message.h> // for Message +#include <gtest/gtest-test-part.h> // for SuiteApiResolver, TestPa... +#include <gtest/gtest_pred_impl.h> // for Test, TestInfo, TEST +#include <memory> // for allocator namespace caosdb { -using ProtoEntity = caosdb::entity::v1alpha1::Entity; +using ProtoEntity = caosdb::entity::v1::Entity; using caosdb::entity::Entity; -using caosdb::entity::v1alpha1::Message; +using caosdb::entity::v1::Message; TEST(test_protobuf, test_swap_trivial) { Message message_source; diff --git a/test/test_transaction.cpp b/test/test_transaction.cpp index 7c93ac5..535f758 100644 --- a/test/test_transaction.cpp +++ b/test/test_transaction.cpp @@ -17,11 +17,11 @@ * 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/configuration.h" // for InsecureConnectionConfig... -#include "caosdb/connection.h" // for Connection -#include "caosdb/entity.h" // for Entity -#include "caosdb/entity/v1alpha1/main.pb.h" // for Entity -#include "caosdb/exceptions.h" // for ConnectionError +#include "caosdb/configuration.h" // for InsecureConnectionConfig... +#include "caosdb/connection.h" // for Connection +#include "caosdb/entity.h" // for Entity +#include "caosdb/entity/v1/main.pb.h" // for Entity +#include "caosdb/exceptions.h" // for ConnectionError #include "caosdb/status_code.h" #include "caosdb/transaction.h" // for Transaction #include "caosdb/transaction_handler.h" // for MultiTransactionResponse @@ -41,9 +41,9 @@ using caosdb::configuration::InsecureConnectionConfiguration; using caosdb::connection::Connection; using caosdb::entity::Entity; using caosdb::exceptions::ConnectionError; -using ProtoEntity = caosdb::entity::v1alpha1::Entity; +using ProtoEntity = caosdb::entity::v1::Entity; using caosdb::entity::Role; -using caosdb::entity::v1alpha1::RetrieveResponse; +using caosdb::entity::v1::RetrieveResponse; TEST(test_transaction, create_transaction) { const auto *host = "localhost"; diff --git a/test/test_value.cpp b/test/test_value.cpp index ecf87d0..8de10b9 100644 --- a/test/test_value.cpp +++ b/test/test_value.cpp @@ -20,24 +20,24 @@ * */ -#include "caosdb/value.h" // for Value -#include "caosdb/entity/v1alpha1/main.pb.h" // for AtomicDataType, DataType -#include "caosdb/protobuf_helper.h" // for ProtoMessageWrapper -#include <algorithm> // for max -#include <cmath> // for isnan -#include <gtest/gtest-message.h> // for Message -#include <gtest/gtest-test-part.h> // for TestPartResult, SuiteApi... -#include <gtest/gtest_pred_impl.h> // for AssertionResult, Test -#include <initializer_list> // for initializer_list -#include <string> // for string, basic_string -#include <vector> // for vector +#include "caosdb/value.h" // for Value +#include "caosdb/entity/v1/main.pb.h" // for AtomicDataType, DataType +#include "caosdb/protobuf_helper.h" // for ProtoMessageWrapper +#include <algorithm> // for max +#include <cmath> // for isnan +#include <gtest/gtest-message.h> // for Message +#include <gtest/gtest-test-part.h> // for TestPartResult, SuiteApi... +#include <gtest/gtest_pred_impl.h> // for AssertionResult, Test +#include <initializer_list> // for initializer_list +#include <string> // for string, basic_string +#include <vector> // for vector namespace caosdb::entity { -using ProtoValue = caosdb::entity::v1alpha1::Value; -using ProtoEntity = caosdb::entity::v1alpha1::Entity; -using ProtoParent = caosdb::entity::v1alpha1::Parent; -using ProtoDataType = caosdb::entity::v1alpha1::DataType; -using ProtoAtomicDataType = caosdb::entity::v1alpha1::AtomicDataType; +using ProtoValue = caosdb::entity::v1::Value; +using ProtoEntity = caosdb::entity::v1::Entity; +using ProtoParent = caosdb::entity::v1::Parent; +using ProtoDataType = caosdb::entity::v1::DataType; +using ProtoAtomicDataType = caosdb::entity::v1::AtomicDataType; TEST(test_value, test_null) { Value value; -- GitLab