From 9de8a27ad540068b3265120b541bfa09fa469ea5 Mon Sep 17 00:00:00 2001 From: ihsandemir Date: Tue, 27 Oct 2020 16:35:49 +0300 Subject: [PATCH] Added the `version()` API. fixes https://github.com/hazelcast/hazelcast-cpp-client/issues/612 --- .../include/hazelcast/client/HazelcastClient.h | 15 +++++++++++++++ hazelcast/test/src/HazelcastTests1.cpp | 17 ----------------- hazelcast/test/src/HazelcastTests5.cpp | 3 --- hazelcast/test/src/HazelcastTests8.cpp | 5 +++++ 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/hazelcast/include/hazelcast/client/HazelcastClient.h b/hazelcast/include/hazelcast/client/HazelcastClient.h index 5d17955349..260822bf9d 100644 --- a/hazelcast/include/hazelcast/client/HazelcastClient.h +++ b/hazelcast/include/hazelcast/client/HazelcastClient.h @@ -15,6 +15,8 @@ */ #pragma once +#include + #include "hazelcast/client/impl/HazelcastClientInstanceImpl.h" #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) @@ -289,11 +291,24 @@ namespace hazelcast { */ spi::LifecycleService &getLifecycleService(); + /** + * + * @return the CP subsystem that offers a set of in-memory linearizable data structures + */ cp::cp_subsystem &get_cp_subsystem(); + private: std::shared_ptr clientImpl; }; + /** + * + * @return the version of the client + */ + constexpr boost::string_view version() { + return HAZELCAST_VERSION; + } + } } diff --git a/hazelcast/test/src/HazelcastTests1.cpp b/hazelcast/test/src/HazelcastTests1.cpp index b10fed0555..186e186efb 100644 --- a/hazelcast/test/src/HazelcastTests1.cpp +++ b/hazelcast/test/src/HazelcastTests1.cpp @@ -902,11 +902,6 @@ namespace hazelcast { } } - - - - - namespace hazelcast { namespace client { namespace test { @@ -1049,10 +1044,6 @@ namespace hazelcast { } } - - - - namespace hazelcast { namespace client { namespace test { @@ -1117,9 +1108,6 @@ namespace hazelcast { } } - - - namespace hazelcast { namespace client { namespace test { @@ -1146,9 +1134,6 @@ namespace hazelcast { } } - - - namespace hazelcast { namespace client { namespace test { @@ -2793,8 +2778,6 @@ namespace hazelcast { } } - - namespace hazelcast { namespace client { namespace test { diff --git a/hazelcast/test/src/HazelcastTests5.cpp b/hazelcast/test/src/HazelcastTests5.cpp index facc8258ad..6ef77e51cf 100644 --- a/hazelcast/test/src/HazelcastTests5.cpp +++ b/hazelcast/test/src/HazelcastTests5.cpp @@ -340,7 +340,6 @@ namespace hazelcast { } */ - namespace hazelcast { namespace client { @@ -388,7 +387,6 @@ namespace hazelcast { } } - namespace hazelcast { namespace client { @@ -504,7 +502,6 @@ namespace hazelcast { } } - namespace hazelcast { namespace client { diff --git a/hazelcast/test/src/HazelcastTests8.cpp b/hazelcast/test/src/HazelcastTests8.cpp index 931332e896..dfb947fdc5 100644 --- a/hazelcast/test/src/HazelcastTests8.cpp +++ b/hazelcast/test/src/HazelcastTests8.cpp @@ -1632,6 +1632,11 @@ namespace hazelcast { namespace hazelcast { namespace client { namespace test { + class VersionTest: public ClientTestSupport {}; + TEST_F(VersionTest, test_client_version) { + ASSERT_EQ(HAZELCAST_VERSION, version()); + } + class ClientMessageTest: public ClientTestSupport { protected: struct BufferedMessageHandler {