You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2020/08/27 12:41:53 UTC

[GitHub] [ignite] ptupitsyn commented on a change in pull request #8183: IGNITE-11731: CPP: Add Cluster API

ptupitsyn commented on a change in pull request #8183:
URL: https://github.com/apache/ignite/pull/8183#discussion_r478360956



##########
File path: modules/platforms/cpp/core-test/src/cluster_group_test.cpp
##########
@@ -0,0 +1,563 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <boost/test/unit_test.hpp>
+
+#include <ignite/ignition.h>
+#include <ignite/test_utils.h>
+
+using namespace ignite;
+using namespace ignite::common;
+using namespace ignite::common::concurrent;
+using namespace ignite::cluster;
+
+using namespace boost::unit_test;
+
+/*
+ * Check if cluster node contain the attribute with name provided.
+ */
+class HasAttrName : public IgnitePredicate<ClusterNode>
+{
+public:
+    HasAttrName(std::string name) :
+        name(name)
+    {
+        // No-op.
+    }
+
+    bool operator()(ClusterNode& node)
+    {
+        std::vector<std::string> attrs = node.GetAttributes();
+
+        return std::find(attrs.begin(), attrs.end(), name) != attrs.end();
+    }
+
+private:
+    std::string name;
+};
+
+/*
+ * Check if cluster node contain the attribute with value provided.
+ */
+class HasAttrValue : public IgnitePredicate<ClusterNode>
+{
+public:
+    HasAttrValue(std::string name, std::string val) :
+        name(name), val(val)
+    {
+        // No-op.
+    }
+
+    bool operator()(ClusterNode& node)
+    {
+        try {
+            return node.GetAttribute<std::string>(name) == this->val;
+        }
+        catch (...) {}
+
+        return false;
+    }
+
+private:
+    std::string name;
+    std::string val;
+};
+
+/*
+ * Predicate holder is required to demonstrate
+ * how to pass IgnitePredicate pointer to the stl container.
+ */
+class PredHolder
+{
+public:
+    PredHolder(IgnitePredicate<ClusterNode>* p) :
+        p(p)
+    {
+        // No-op.
+    }
+
+    bool operator()(ClusterNode& node)
+    {
+        return p->operator()(node);
+    }
+
+private:
+    IgnitePredicate<ClusterNode>* p;
+};
+
+/*
+ * Test setup fixture.
+ */
+struct ClusterGroupTestSuiteFixture
+{
+    Ignite server1;
+    Ignite server2;
+    Ignite server3;
+    Ignite client;
+
+    /*
+     * Constructor.
+     */
+    ClusterGroupTestSuiteFixture() :
+#ifdef IGNITE_TESTS_32
+        server1(ignite_test::StartNode("compute-server0-32.xml", "ClusterTestServer0")),
+        server2(ignite_test::StartNode("compute-server1-32.xml", "ClusterTestServer1")),
+        server3(ignite_test::StartNode("compute-server1-32.xml", "ClusterTestServer2")),
+        client(ignite_test::StartNode("compute-client-32.xml", "ClusterTestClient"))
+#else
+        server1(ignite_test::StartNode("compute-server0.xml", "ClusterTestServer0")),
+        server2(ignite_test::StartNode("compute-server1.xml", "ClusterTestServer1")),
+        server3(ignite_test::StartNode("compute-server1.xml", "ClusterTestServer2")),
+        client(ignite_test::StartNode("compute-client.xml", "ClusterTestClient"))
+#endif
+    {
+        // No-op.
+    }
+
+    /*
+     * Destructor.
+     */
+    ~ClusterGroupTestSuiteFixture()
+    {
+        Ignition::Stop(client.GetName(), true);
+        Ignition::StopAll(true);
+    }
+};
+
+/*
+ * Test setup fixture.
+ */
+struct ClusterGroupTestSuiteFixtureIsolated
+{
+    Ignite node;
+
+    /*
+     * Constructor.
+     */
+    ClusterGroupTestSuiteFixtureIsolated() :
+#ifdef IGNITE_TESTS_32
+        node(ignite_test::StartNode("isolated-32.xml", "ClusterTestIsolated"))
+#else
+        node(ignite_test::StartNode("isolated.xml", "ClusterTestIsolated"))
+#endif
+    {
+        // No-op.
+    }
+
+    /*
+     * Destructor.
+     */
+    ~ClusterGroupTestSuiteFixtureIsolated()
+    {
+        Ignition::StopAll(true);
+    }
+};
+
+BOOST_FIXTURE_TEST_SUITE(ClusterGroupTestSuite, ClusterGroupTestSuiteFixture)
+
+BOOST_AUTO_TEST_CASE(IgniteGetCluster)
+{
+    IgniteCluster cluster = server1.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+}
+
+BOOST_AUTO_TEST_CASE(IgniteForAttribute)
+{
+    IgniteCluster cluster = server1.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group1 = cluster.AsClusterGroup().ForAttribute("TestAttribute", "Value0");
+    ClusterGroup group2 = cluster.AsClusterGroup().ForAttribute("TestAttribute", "Value1");
+    ClusterGroup group3 = cluster.AsClusterGroup().ForAttribute("NotExistAttribute", "Value0");
+    ClusterGroup group4 = cluster.AsClusterGroup().ForAttribute("TestAttribute", "NotExistValue");
+
+    BOOST_REQUIRE(group1.GetNodes().size() == 1);
+    BOOST_REQUIRE(group2.GetNodes().size() == 2);
+    BOOST_REQUIRE(group3.GetNodes().size() == 0);
+    BOOST_REQUIRE(group4.GetNodes().size() == 0);
+}
+
+BOOST_AUTO_TEST_CASE(IgniteForCacheNodes)
+{
+    IgniteCluster cluster = server1.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group1 = cluster.AsClusterGroup().ForCacheNodes("CacheName0");
+    ClusterGroup group2 = cluster.AsClusterGroup().ForCacheNodes("CacheName1");
+    ClusterGroup group3 = cluster.AsClusterGroup().ForCacheNodes("CacheName2");
+    ClusterGroup group4 = cluster.AsClusterGroup().ForCacheNodes("InvalidCacheName");
+
+    BOOST_REQUIRE(group1.GetNodes().size() == 3);
+    BOOST_REQUIRE(group2.GetNodes().size() == 3);
+    BOOST_REQUIRE(group3.GetNodes().size() == 4);
+    BOOST_REQUIRE(group4.GetNodes().size() == 0);
+}
+
+BOOST_AUTO_TEST_CASE(IgniteForClientNodes)
+{
+    IgniteCluster cluster = server1.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group1 = cluster.AsClusterGroup().ForClientNodes("CacheName0");
+    ClusterGroup group2 = cluster.AsClusterGroup().ForClientNodes("CacheName2");
+    ClusterGroup group3 = cluster.AsClusterGroup().ForClientNodes("InvalidCacheName");
+
+    BOOST_REQUIRE(group1.GetNodes().size() == 0);
+    BOOST_REQUIRE(group2.GetNodes().size() == 1);
+    BOOST_REQUIRE(group3.GetNodes().size() == 0);
+}
+
+BOOST_AUTO_TEST_CASE(IgniteForClients)
+{
+    IgniteCluster cluster = server1.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group0 = cluster.AsClusterGroup().ForClients();
+
+    BOOST_REQUIRE(group0.GetNodes().size() == 1);
+    BOOST_REQUIRE(group0.GetNodes().front().IsClient());
+}
+
+BOOST_AUTO_TEST_CASE(IgniteForDaemons)
+{
+    IgniteCluster cluster = server1.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group = cluster.AsClusterGroup().ForDaemons();
+
+    std::vector<ClusterNode> nodes = group.GetNodes();
+
+    BOOST_REQUIRE(nodes.size() == 0);
+}
+
+BOOST_AUTO_TEST_CASE(IgniteForDataNodes)
+{
+    IgniteCluster cluster = server1.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group1 = cluster.AsClusterGroup().ForDataNodes("CacheName0");
+    ClusterGroup group2 = cluster.AsClusterGroup().ForDataNodes("CacheName1");
+    ClusterGroup group3 = cluster.AsClusterGroup().ForDataNodes("CacheName2");
+    ClusterGroup group4 = cluster.AsClusterGroup().ForDataNodes("InvalidCacheName");
+
+    BOOST_REQUIRE(group1.GetNodes().size() == 3);
+    BOOST_REQUIRE(group2.GetNodes().size() == 3);
+    BOOST_REQUIRE(group3.GetNodes().size() == 3);
+    BOOST_REQUIRE(group4.GetNodes().size() == 0);
+}
+
+BOOST_AUTO_TEST_CASE(IgniteForHost)
+{
+    IgniteCluster cluster = server1.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group1 = cluster.AsClusterGroup();
+    ClusterGroup group2 = cluster.AsClusterGroup().ForHost(group1.GetNodes().front());
+
+    BOOST_REQUIRE(group1.GetNodes().size() == 4);
+    BOOST_REQUIRE(group2.GetNodes().size() == 4);
+}
+
+BOOST_AUTO_TEST_CASE(IgniteForHostName)
+{
+    IgniteCluster cluster = server1.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    std::string hostName = "someHostName";
+
+    ClusterGroup group0 = cluster.AsClusterGroup().ForHost(hostName);
+
+    BOOST_REQUIRE(group0.GetNodes().size() == 0);
+}
+
+BOOST_AUTO_TEST_CASE(IgniteForHostNames)
+{
+    IgniteCluster cluster = server1.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    std::vector<std::string> hostNames;
+    hostNames.push_back("hostName0");
+    hostNames.push_back("hostName1");
+
+    ClusterGroup group0 = cluster.AsClusterGroup().ForHosts(hostNames);
+
+    BOOST_REQUIRE(group0.GetNodes().size() == 0);
+}
+
+BOOST_AUTO_TEST_CASE(IgniteForNode)
+{
+    IgniteCluster cluster = server1.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group1 = cluster.AsClusterGroup();
+    ClusterGroup group2 = cluster.AsClusterGroup().ForNode(group1.GetNodes().front());
+
+    BOOST_REQUIRE(group1.GetNodes().size() == 4);
+    BOOST_REQUIRE(group2.GetNodes().size() == 1);
+}
+
+BOOST_AUTO_TEST_CASE(IgniteForNodeId)
+{
+    IgniteCluster cluster = server1.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group1 = cluster.AsClusterGroup();
+    ClusterGroup group2 = cluster.AsClusterGroup().ForNodeId(group1.GetNodes().front().GetId());
+    ClusterGroup group3 = cluster.AsClusterGroup().ForNodeId(Guid(100, 500));
+
+    BOOST_REQUIRE(group1.GetNodes().size() == 4);
+    BOOST_REQUIRE(group2.GetNodes().size() == 1);
+    BOOST_REQUIRE(group3.GetNodes().size() == 0);
+}
+
+BOOST_AUTO_TEST_CASE(IgniteForNodeIds)
+{
+    IgniteCluster cluster = server1.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group1 = cluster.AsClusterGroup();
+
+    std::vector<ClusterNode> nodes = group1.GetNodes();
+    std::vector<Guid> ids;
+    ids.push_back(nodes.at(0).GetId());
+    ids.push_back(nodes.at(1).GetId());
+
+    ClusterGroup group2 = cluster.AsClusterGroup().ForNodeIds(ids);
+
+    BOOST_REQUIRE(group1.GetNodes().size() == 4);
+    BOOST_REQUIRE(group2.GetNodes().size() == 2);
+
+    std::vector<Guid> emptyIds;
+    BOOST_CHECK_THROW(cluster.AsClusterGroup().ForNodeIds(emptyIds), IgniteError);
+
+    std::vector<Guid> notExistIds;
+    notExistIds.push_back(Guid(100, 500));
+    ClusterGroup group3 = cluster.AsClusterGroup().ForNodeIds(notExistIds);
+
+    BOOST_REQUIRE(group3.GetNodes().size() == 0);
+}
+
+BOOST_AUTO_TEST_CASE(IgniteForNodes)
+{
+    IgniteCluster cluster = server1.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group1 = cluster.AsClusterGroup();
+    ClusterGroup group2 = cluster.AsClusterGroup().ForServers();
+    ClusterGroup group3 = cluster.AsClusterGroup().ForNodes(group2.GetNodes());
+
+    BOOST_REQUIRE(group1.GetNodes().size() == 4);
+    BOOST_REQUIRE(group2.GetNodes().size() == 3);

Review comment:
       Most of the cluster group tests only check for `size()`, I think this is not reliable enough.
   E.g. here we should check whether `group2` does not contains all server 3 nodes, no client nodes, no duplicates, and so on.

##########
File path: modules/platforms/cpp/binary/src/impl/binary/binary_object_impl.cpp
##########
@@ -37,10 +37,29 @@ namespace ignite
                 mem(&mem),
                 start(start),
                 idRslvr(0),
-                metaMgr(metaMgr)
+                metaMgr(metaMgr),
+                binary(false)
             {
                 if (idRslvr)
                     this->idRslvr = idRslvr->Clone();
+
+                int8_t hdr = BinaryUtils::ReadInt8(mem, this->start);
+
+                if (hdr == IGNITE_TYPE_BINARY)
+                {
+                    binary = true;
+
+                    int32_t portLen = BinaryUtils::ReadInt32(mem, this->start + 1);

Review comment:
       `portLen`, `portOff` - is this short from `portable`?

##########
File path: modules/platforms/cpp/core-test/src/cluster_group_test.cpp
##########
@@ -0,0 +1,563 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <boost/test/unit_test.hpp>
+
+#include <ignite/ignition.h>
+#include <ignite/test_utils.h>
+
+using namespace ignite;
+using namespace ignite::common;
+using namespace ignite::common::concurrent;
+using namespace ignite::cluster;
+
+using namespace boost::unit_test;
+
+/*
+ * Check if cluster node contain the attribute with name provided.
+ */
+class HasAttrName : public IgnitePredicate<ClusterNode>
+{
+public:
+    HasAttrName(std::string name) :
+        name(name)
+    {
+        // No-op.
+    }
+
+    bool operator()(ClusterNode& node)
+    {
+        std::vector<std::string> attrs = node.GetAttributes();
+
+        return std::find(attrs.begin(), attrs.end(), name) != attrs.end();
+    }
+
+private:
+    std::string name;
+};
+
+/*
+ * Check if cluster node contain the attribute with value provided.
+ */
+class HasAttrValue : public IgnitePredicate<ClusterNode>
+{
+public:
+    HasAttrValue(std::string name, std::string val) :
+        name(name), val(val)
+    {
+        // No-op.
+    }
+
+    bool operator()(ClusterNode& node)
+    {
+        try {
+            return node.GetAttribute<std::string>(name) == this->val;
+        }
+        catch (...) {}
+
+        return false;
+    }
+
+private:
+    std::string name;
+    std::string val;
+};
+
+/*
+ * Predicate holder is required to demonstrate
+ * how to pass IgnitePredicate pointer to the stl container.
+ */
+class PredHolder
+{
+public:
+    PredHolder(IgnitePredicate<ClusterNode>* p) :
+        p(p)
+    {
+        // No-op.
+    }
+
+    bool operator()(ClusterNode& node)
+    {
+        return p->operator()(node);
+    }
+
+private:
+    IgnitePredicate<ClusterNode>* p;
+};
+
+/*
+ * Test setup fixture.
+ */
+struct ClusterGroupTestSuiteFixture
+{
+    Ignite server1;
+    Ignite server2;
+    Ignite server3;
+    Ignite client;
+
+    /*
+     * Constructor.
+     */
+    ClusterGroupTestSuiteFixture() :
+#ifdef IGNITE_TESTS_32
+        server1(ignite_test::StartNode("compute-server0-32.xml", "ClusterTestServer0")),
+        server2(ignite_test::StartNode("compute-server1-32.xml", "ClusterTestServer1")),
+        server3(ignite_test::StartNode("compute-server1-32.xml", "ClusterTestServer2")),
+        client(ignite_test::StartNode("compute-client-32.xml", "ClusterTestClient"))
+#else
+        server1(ignite_test::StartNode("compute-server0.xml", "ClusterTestServer0")),
+        server2(ignite_test::StartNode("compute-server1.xml", "ClusterTestServer1")),
+        server3(ignite_test::StartNode("compute-server1.xml", "ClusterTestServer2")),
+        client(ignite_test::StartNode("compute-client.xml", "ClusterTestClient"))
+#endif
+    {
+        // No-op.
+    }
+
+    /*
+     * Destructor.
+     */
+    ~ClusterGroupTestSuiteFixture()
+    {
+        Ignition::Stop(client.GetName(), true);
+        Ignition::StopAll(true);
+    }
+};
+
+/*
+ * Test setup fixture.
+ */
+struct ClusterGroupTestSuiteFixtureIsolated
+{
+    Ignite node;
+
+    /*
+     * Constructor.
+     */
+    ClusterGroupTestSuiteFixtureIsolated() :
+#ifdef IGNITE_TESTS_32
+        node(ignite_test::StartNode("isolated-32.xml", "ClusterTestIsolated"))
+#else
+        node(ignite_test::StartNode("isolated.xml", "ClusterTestIsolated"))
+#endif
+    {
+        // No-op.
+    }
+
+    /*
+     * Destructor.
+     */
+    ~ClusterGroupTestSuiteFixtureIsolated()
+    {
+        Ignition::StopAll(true);
+    }
+};
+
+BOOST_FIXTURE_TEST_SUITE(ClusterGroupTestSuite, ClusterGroupTestSuiteFixture)
+
+BOOST_AUTO_TEST_CASE(IgniteGetCluster)
+{
+    IgniteCluster cluster = server1.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+}
+
+BOOST_AUTO_TEST_CASE(IgniteForAttribute)
+{
+    IgniteCluster cluster = server1.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group1 = cluster.AsClusterGroup().ForAttribute("TestAttribute", "Value0");
+    ClusterGroup group2 = cluster.AsClusterGroup().ForAttribute("TestAttribute", "Value1");
+    ClusterGroup group3 = cluster.AsClusterGroup().ForAttribute("NotExistAttribute", "Value0");
+    ClusterGroup group4 = cluster.AsClusterGroup().ForAttribute("TestAttribute", "NotExistValue");
+
+    BOOST_REQUIRE(group1.GetNodes().size() == 1);
+    BOOST_REQUIRE(group2.GetNodes().size() == 2);
+    BOOST_REQUIRE(group3.GetNodes().size() == 0);
+    BOOST_REQUIRE(group4.GetNodes().size() == 0);
+}
+
+BOOST_AUTO_TEST_CASE(IgniteForCacheNodes)
+{
+    IgniteCluster cluster = server1.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group1 = cluster.AsClusterGroup().ForCacheNodes("CacheName0");
+    ClusterGroup group2 = cluster.AsClusterGroup().ForCacheNodes("CacheName1");
+    ClusterGroup group3 = cluster.AsClusterGroup().ForCacheNodes("CacheName2");
+    ClusterGroup group4 = cluster.AsClusterGroup().ForCacheNodes("InvalidCacheName");
+
+    BOOST_REQUIRE(group1.GetNodes().size() == 3);
+    BOOST_REQUIRE(group2.GetNodes().size() == 3);
+    BOOST_REQUIRE(group3.GetNodes().size() == 4);
+    BOOST_REQUIRE(group4.GetNodes().size() == 0);
+}
+
+BOOST_AUTO_TEST_CASE(IgniteForClientNodes)
+{
+    IgniteCluster cluster = server1.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group1 = cluster.AsClusterGroup().ForClientNodes("CacheName0");
+    ClusterGroup group2 = cluster.AsClusterGroup().ForClientNodes("CacheName2");
+    ClusterGroup group3 = cluster.AsClusterGroup().ForClientNodes("InvalidCacheName");
+
+    BOOST_REQUIRE(group1.GetNodes().size() == 0);
+    BOOST_REQUIRE(group2.GetNodes().size() == 1);
+    BOOST_REQUIRE(group3.GetNodes().size() == 0);
+}
+
+BOOST_AUTO_TEST_CASE(IgniteForClients)
+{
+    IgniteCluster cluster = server1.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group0 = cluster.AsClusterGroup().ForClients();
+
+    BOOST_REQUIRE(group0.GetNodes().size() == 1);
+    BOOST_REQUIRE(group0.GetNodes().front().IsClient());
+}
+
+BOOST_AUTO_TEST_CASE(IgniteForDaemons)
+{
+    IgniteCluster cluster = server1.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group = cluster.AsClusterGroup().ForDaemons();
+
+    std::vector<ClusterNode> nodes = group.GetNodes();
+
+    BOOST_REQUIRE(nodes.size() == 0);
+}
+
+BOOST_AUTO_TEST_CASE(IgniteForDataNodes)
+{
+    IgniteCluster cluster = server1.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group1 = cluster.AsClusterGroup().ForDataNodes("CacheName0");
+    ClusterGroup group2 = cluster.AsClusterGroup().ForDataNodes("CacheName1");
+    ClusterGroup group3 = cluster.AsClusterGroup().ForDataNodes("CacheName2");
+    ClusterGroup group4 = cluster.AsClusterGroup().ForDataNodes("InvalidCacheName");
+
+    BOOST_REQUIRE(group1.GetNodes().size() == 3);
+    BOOST_REQUIRE(group2.GetNodes().size() == 3);
+    BOOST_REQUIRE(group3.GetNodes().size() == 3);
+    BOOST_REQUIRE(group4.GetNodes().size() == 0);
+}
+
+BOOST_AUTO_TEST_CASE(IgniteForHost)
+{
+    IgniteCluster cluster = server1.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group1 = cluster.AsClusterGroup();
+    ClusterGroup group2 = cluster.AsClusterGroup().ForHost(group1.GetNodes().front());
+
+    BOOST_REQUIRE(group1.GetNodes().size() == 4);
+    BOOST_REQUIRE(group2.GetNodes().size() == 4);
+}
+
+BOOST_AUTO_TEST_CASE(IgniteForHostName)
+{
+    IgniteCluster cluster = server1.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    std::string hostName = "someHostName";
+
+    ClusterGroup group0 = cluster.AsClusterGroup().ForHost(hostName);
+
+    BOOST_REQUIRE(group0.GetNodes().size() == 0);
+}
+
+BOOST_AUTO_TEST_CASE(IgniteForHostNames)
+{
+    IgniteCluster cluster = server1.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    std::vector<std::string> hostNames;
+    hostNames.push_back("hostName0");
+    hostNames.push_back("hostName1");
+
+    ClusterGroup group0 = cluster.AsClusterGroup().ForHosts(hostNames);
+
+    BOOST_REQUIRE(group0.GetNodes().size() == 0);
+}
+
+BOOST_AUTO_TEST_CASE(IgniteForNode)
+{
+    IgniteCluster cluster = server1.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group1 = cluster.AsClusterGroup();
+    ClusterGroup group2 = cluster.AsClusterGroup().ForNode(group1.GetNodes().front());
+
+    BOOST_REQUIRE(group1.GetNodes().size() == 4);
+    BOOST_REQUIRE(group2.GetNodes().size() == 1);
+}
+
+BOOST_AUTO_TEST_CASE(IgniteForNodeId)
+{
+    IgniteCluster cluster = server1.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group1 = cluster.AsClusterGroup();
+    ClusterGroup group2 = cluster.AsClusterGroup().ForNodeId(group1.GetNodes().front().GetId());
+    ClusterGroup group3 = cluster.AsClusterGroup().ForNodeId(Guid(100, 500));
+
+    BOOST_REQUIRE(group1.GetNodes().size() == 4);
+    BOOST_REQUIRE(group2.GetNodes().size() == 1);
+    BOOST_REQUIRE(group3.GetNodes().size() == 0);
+}
+
+BOOST_AUTO_TEST_CASE(IgniteForNodeIds)
+{
+    IgniteCluster cluster = server1.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group1 = cluster.AsClusterGroup();
+
+    std::vector<ClusterNode> nodes = group1.GetNodes();
+    std::vector<Guid> ids;
+    ids.push_back(nodes.at(0).GetId());
+    ids.push_back(nodes.at(1).GetId());
+
+    ClusterGroup group2 = cluster.AsClusterGroup().ForNodeIds(ids);
+
+    BOOST_REQUIRE(group1.GetNodes().size() == 4);
+    BOOST_REQUIRE(group2.GetNodes().size() == 2);
+
+    std::vector<Guid> emptyIds;
+    BOOST_CHECK_THROW(cluster.AsClusterGroup().ForNodeIds(emptyIds), IgniteError);
+
+    std::vector<Guid> notExistIds;
+    notExistIds.push_back(Guid(100, 500));
+    ClusterGroup group3 = cluster.AsClusterGroup().ForNodeIds(notExistIds);
+
+    BOOST_REQUIRE(group3.GetNodes().size() == 0);
+}
+
+BOOST_AUTO_TEST_CASE(IgniteForNodes)
+{
+    IgniteCluster cluster = server1.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group1 = cluster.AsClusterGroup();
+    ClusterGroup group2 = cluster.AsClusterGroup().ForServers();
+    ClusterGroup group3 = cluster.AsClusterGroup().ForNodes(group2.GetNodes());
+
+    BOOST_REQUIRE(group1.GetNodes().size() == 4);
+    BOOST_REQUIRE(group2.GetNodes().size() == 3);
+    BOOST_REQUIRE(group3.GetNodes().size() == 3);
+}
+
+BOOST_AUTO_TEST_CASE(IgniteForOldest)
+{
+    IgniteCluster cluster = server1.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group1 = cluster.AsClusterGroup().ForOldest();
+
+    BOOST_REQUIRE(group1.GetNodes().size() == 1);
+}
+
+BOOST_AUTO_TEST_CASE(IgniteForPredicate)
+{
+    IgniteCluster cluster = server1.GetCluster();
+    ClusterGroup group0 = cluster.AsClusterGroup();
+
+    ClusterGroup groupServers = group0.ForServers();
+    ClusterGroup groupClients = group0.ForClients();
+    ClusterGroup group1 = groupServers.ForPredicate(new HasAttrValue("TestAttribute", "Value0"));
+    ClusterGroup group2 = groupServers.ForPredicate(new HasAttrValue("TestAttribute", "Value1"));
+    ClusterGroup group3 = groupServers.ForClients();
+
+    BOOST_REQUIRE(group0.GetNodes().size() == 4);
+    BOOST_REQUIRE(groupServers.GetNodes().size() == 3);
+    BOOST_REQUIRE(groupClients.GetNodes().size() == 1);
+    BOOST_REQUIRE(group1.GetNodes().size() == 1);
+    BOOST_REQUIRE(group2.GetNodes().size() == 2);
+    BOOST_REQUIRE(group3.GetNodes().size() == 0);
+
+    ClusterGroup group4 = group0.ForPredicate(new HasAttrName("TestAttribute"));
+    ClusterGroup group5 = group4.ForPredicate(new HasAttrValue("TestAttribute", "Value0"));
+    ClusterGroup group6 = group4.ForPredicate(new HasAttrValue("TestAttribute", "Value1"));
+    ClusterGroup group7 = group4.ForPredicate(new HasAttrValue("TestAttribute", "ValueInvalid"));
+
+    BOOST_REQUIRE(group4.GetNodes().size() == 3);
+    BOOST_REQUIRE(group5.GetNodes().size() == 1);
+    BOOST_REQUIRE(group6.GetNodes().size() == 2);
+    BOOST_REQUIRE(group7.GetNodes().size() == 0);
+}
+
+BOOST_AUTO_TEST_CASE(IgniteForRandom)
+{
+    IgniteCluster cluster = server1.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group1 = cluster.AsClusterGroup().ForRandom();
+
+    BOOST_REQUIRE(group1.GetNodes().size() == 1);
+}
+
+BOOST_AUTO_TEST_CASE(IgniteForRemotes)
+{
+    IgniteCluster cluster = server1.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group1 = cluster.AsClusterGroup().ForRemotes();
+
+    BOOST_REQUIRE(group1.GetNodes().size() == 3);
+}
+
+BOOST_AUTO_TEST_CASE(IgniteForServers)
+{
+    IgniteCluster cluster = server1.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group1 = cluster.AsClusterGroup().ForServers();
+    ClusterGroup group2 = cluster.AsClusterGroup().ForServers().ForAttribute("TestAttribute", "Value0");
+    ClusterGroup group3 = cluster.AsClusterGroup().ForServers().ForAttribute("TestAttribute", "Value1");
+
+    BOOST_REQUIRE(group1.GetNodes().size() == 3);
+    BOOST_REQUIRE(group2.GetNodes().size() == 1);
+    BOOST_REQUIRE(group3.GetNodes().size() == 2);
+}
+
+BOOST_AUTO_TEST_CASE(IgniteForYoungest)
+{
+    IgniteCluster cluster = server1.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group = cluster.AsClusterGroup().ForYoungest();
+
+    BOOST_REQUIRE(group.GetNodes().size() == 1);
+}
+
+BOOST_AUTO_TEST_CASE(IgniteForCpp)
+{
+    IgniteCluster cluster = server1.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group = cluster.AsClusterGroup().ForCpp();
+
+    BOOST_REQUIRE(group.GetNodes().size() == 4);
+}
+
+BOOST_AUTO_TEST_CASE(IgniteForLocal)
+{
+    IgniteCluster cluster = server1.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group = cluster.ForLocal();
+
+    BOOST_REQUIRE(group.GetNodes().size() == 1);
+    BOOST_REQUIRE(group.GetNodes().front().IsLocal());
+}
+
+BOOST_AUTO_TEST_CASE(IgniteGetLocalNode)
+{
+    IgniteCluster cluster = server1.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterNode node = cluster.GetLocalNode();
+
+    BOOST_REQUIRE(node.IsLocal());
+}
+
+BOOST_AUTO_TEST_CASE(IgniteGetNode)
+{
+    IgniteCluster cluster = server1.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group = cluster.AsClusterGroup();
+
+    ClusterNode node1 = group.GetNode();
+    ClusterNode node2 = group.GetNodes().at(0);
+    ClusterNode node3 = group.GetNode(node1.GetId());
+
+    BOOST_REQUIRE(node1.GetId() == node2.GetId());
+    BOOST_REQUIRE(node2.GetId() == node3.GetId());
+}
+
+BOOST_AUTO_TEST_CASE(IgniteGetNodes)
+{
+    IgniteCluster cluster = server1.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group = cluster.AsClusterGroup();
+
+    std::vector<ClusterNode> nodes = group.GetNodes();
+
+    BOOST_REQUIRE(nodes.size() == 4);

Review comment:
       `BOOST_CHECK_EQUAL`, here and some other places with equality check

##########
File path: modules/platforms/cpp/core-test/src/cluster_test.cpp
##########
@@ -85,27 +97,293 @@ struct ClusterTestSuiteFixtureIsolated
 
 BOOST_FIXTURE_TEST_SUITE(ClusterTestSuite, ClusterTestSuiteFixture)
 
-BOOST_AUTO_TEST_CASE(IgniteImplProjection)
+BOOST_AUTO_TEST_CASE(IgniteGetCluster)
+{
+    IgniteCluster cluster = server1.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+}
+
+BOOST_AUTO_TEST_CASE(IgniteForAttribute)
 {
-    impl::IgniteImpl* impl = impl::IgniteImpl::GetFromProxy(node);
+    IgniteCluster cluster = server1.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
 
-    BOOST_REQUIRE(impl != 0);
-    BOOST_REQUIRE(impl->GetProjection().IsValid());
+    ClusterGroup group1 = cluster.AsClusterGroup().ForAttribute("TestAttribute", "Value0");
+    ClusterGroup group2 = cluster.AsClusterGroup().ForAttribute("TestAttribute", "Value1");
+    ClusterGroup group3 = cluster.AsClusterGroup().ForAttribute("NotExistAttribute", "Value0");
+    ClusterGroup group4 = cluster.AsClusterGroup().ForAttribute("TestAttribute", "NotExistValue");
+
+    BOOST_REQUIRE(group1.GetNodes().size() == 1);
+    BOOST_REQUIRE(group2.GetNodes().size() == 2);
+    BOOST_REQUIRE(group3.GetNodes().size() == 0);
+    BOOST_REQUIRE(group4.GetNodes().size() == 0);
 }
 
-BOOST_AUTO_TEST_CASE(IgniteImplForServers)
+BOOST_AUTO_TEST_CASE(IgniteForCacheNodes)
 {
-    impl::IgniteImpl* impl = impl::IgniteImpl::GetFromProxy(node);
+    IgniteCluster cluster = server1.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
 
-    BOOST_REQUIRE(impl != 0);
+    ClusterGroup group1 = cluster.AsClusterGroup().ForCacheNodes("CacheName0");
+    ClusterGroup group2 = cluster.AsClusterGroup().ForCacheNodes("CacheName1");
+    ClusterGroup group3 = cluster.AsClusterGroup().ForCacheNodes("CacheName2");
+    ClusterGroup group4 = cluster.AsClusterGroup().ForCacheNodes("InvalidCacheName");
 
-    SharedPointer<impl::cluster::ClusterGroupImpl> clusterGroup = impl->GetProjection();
+    BOOST_REQUIRE(group1.GetNodes().size() == 3);
+    BOOST_REQUIRE(group2.GetNodes().size() == 3);
+    BOOST_REQUIRE(group3.GetNodes().size() == 4);
+    BOOST_REQUIRE(group4.GetNodes().size() == 0);
+}
+
+BOOST_AUTO_TEST_CASE(IgniteForClientNodes)
+{
+    IgniteCluster cluster = server1.GetCluster();
 
-    BOOST_REQUIRE(clusterGroup.IsValid());
+    BOOST_REQUIRE(cluster.IsActive());
 
-    IgniteError err;
+    ClusterGroup group1 = cluster.AsClusterGroup().ForClientNodes("CacheName0");
+    ClusterGroup group2 = cluster.AsClusterGroup().ForClientNodes("CacheName2");
+    ClusterGroup group3 = cluster.AsClusterGroup().ForClientNodes("InvalidCacheName");
 
-    BOOST_REQUIRE(clusterGroup.Get()->ForServers().IsValid());
+    BOOST_REQUIRE(group1.GetNodes().size() == 0);
+    BOOST_REQUIRE(group2.GetNodes().size() == 1);
+    BOOST_REQUIRE(group3.GetNodes().size() == 0);
+}
+
+BOOST_AUTO_TEST_CASE(IgniteForDaemons)
+{
+    IgniteCluster cluster = server1.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group = cluster.AsClusterGroup().ForDaemons();
+
+    std::vector<ClusterNode> nodes = group.GetNodes();
+
+    BOOST_REQUIRE(nodes.size() == 0);
+}
+
+BOOST_AUTO_TEST_CASE(IgniteForDataNodes)
+{
+    IgniteCluster cluster = server1.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group1 = cluster.AsClusterGroup().ForDataNodes("CacheName0");
+    ClusterGroup group2 = cluster.AsClusterGroup().ForDataNodes("CacheName1");
+    ClusterGroup group3 = cluster.AsClusterGroup().ForDataNodes("CacheName2");
+    ClusterGroup group4 = cluster.AsClusterGroup().ForDataNodes("InvalidCacheName");
+
+    BOOST_REQUIRE(group1.GetNodes().size() == 3);
+    BOOST_REQUIRE(group2.GetNodes().size() == 3);
+    BOOST_REQUIRE(group3.GetNodes().size() == 3);
+    BOOST_REQUIRE(group4.GetNodes().size() == 0);
+}
+
+BOOST_AUTO_TEST_CASE(IgniteForHost)
+{
+    IgniteCluster cluster = server1.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group1 = cluster.AsClusterGroup();
+    ClusterGroup group2 = cluster.AsClusterGroup().ForHost(group1.GetNodes().front());
+
+    BOOST_REQUIRE(group1.GetNodes().size() == 4);
+    BOOST_REQUIRE(group2.GetNodes().size() == 4);
+}
+
+BOOST_AUTO_TEST_CASE(IgniteForNode)
+{
+    IgniteCluster cluster = server1.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group1 = cluster.AsClusterGroup();
+    ClusterGroup group2 = cluster.AsClusterGroup().ForNode(group1.GetNodes().front());
+
+    BOOST_REQUIRE(group1.GetNodes().size() == 4);
+    BOOST_REQUIRE(group2.GetNodes().size() == 1);
+}
+
+BOOST_AUTO_TEST_CASE(IgniteForNodeId)
+{
+    IgniteCluster cluster = server1.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group1 = cluster.AsClusterGroup();
+    ClusterGroup group2 = cluster.AsClusterGroup().ForNodeId(group1.GetNodes().front().GetId());
+    ClusterGroup group3 = cluster.AsClusterGroup().ForNodeId(Guid(100, 500));
+
+    BOOST_REQUIRE(group1.GetNodes().size() == 4);
+    BOOST_REQUIRE(group2.GetNodes().size() == 1);
+    BOOST_REQUIRE(group3.GetNodes().size() == 0);
+}
+
+BOOST_AUTO_TEST_CASE(IgniteForNodeIds)
+{
+    IgniteCluster cluster = server1.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());

Review comment:
       This check is in every test case, I think we can have it only once.

##########
File path: modules/platforms/cpp/core-test/src/cluster_node_test.cpp
##########
@@ -0,0 +1,261 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <boost/test/unit_test.hpp>
+
+#include <ignite/ignition.h>
+#include <ignite/test_utils.h>
+
+using namespace ignite;
+using namespace ignite::common;
+using namespace ignite::common::concurrent;
+using namespace ignite::cluster;
+
+using namespace boost::unit_test;
+
+/*
+ * Test setup fixture.
+ */
+struct ClusterNodeTestSuiteFixture
+{
+    Ignite server;
+    Ignite client;
+
+    /*
+     * Constructor.
+     */
+    ClusterNodeTestSuiteFixture() :
+#ifdef IGNITE_TESTS_32
+        server(ignite_test::StartNode("compute-server0-32.xml", "ClusterTestServer0")),
+        client(ignite_test::StartNode("compute-client-32.xml", "ClusterTestClient"))
+#else
+        server(ignite_test::StartNode("compute-server0.xml", "ClusterTestServer0")),
+        client(ignite_test::StartNode("compute-client.xml", "ClusterTestClient"))
+#endif
+    {
+        // No-op.
+    }
+
+    /*
+     * Destructor.
+     */
+    ~ClusterNodeTestSuiteFixture()
+    {
+        Ignition::Stop(client.GetName(), true);
+        Ignition::StopAll(true);

Review comment:
       StopAll stops the client as well, right? Do we need a separate call for the client above?

##########
File path: modules/platforms/cpp/core-test/src/cluster_node_test.cpp
##########
@@ -0,0 +1,261 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <boost/test/unit_test.hpp>
+
+#include <ignite/ignition.h>
+#include <ignite/test_utils.h>
+
+using namespace ignite;
+using namespace ignite::common;
+using namespace ignite::common::concurrent;
+using namespace ignite::cluster;
+
+using namespace boost::unit_test;
+
+/*
+ * Test setup fixture.
+ */
+struct ClusterNodeTestSuiteFixture
+{
+    Ignite server;
+    Ignite client;
+
+    /*
+     * Constructor.
+     */
+    ClusterNodeTestSuiteFixture() :
+#ifdef IGNITE_TESTS_32
+        server(ignite_test::StartNode("compute-server0-32.xml", "ClusterTestServer0")),
+        client(ignite_test::StartNode("compute-client-32.xml", "ClusterTestClient"))
+#else
+        server(ignite_test::StartNode("compute-server0.xml", "ClusterTestServer0")),
+        client(ignite_test::StartNode("compute-client.xml", "ClusterTestClient"))
+#endif
+    {
+        // No-op.
+    }
+
+    /*
+     * Destructor.
+     */
+    ~ClusterNodeTestSuiteFixture()
+    {
+        Ignition::Stop(client.GetName(), true);
+        Ignition::StopAll(true);
+    }
+};
+
+BOOST_FIXTURE_TEST_SUITE(ClusterNodeTestSuite, ClusterNodeTestSuiteFixture)
+
+BOOST_AUTO_TEST_CASE(IgniteGetCluster)
+{
+    IgniteCluster cluster = server.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+}
+
+BOOST_AUTO_TEST_CASE(IgniteGetAddresses)
+{
+    IgniteCluster cluster = server.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group = cluster.AsClusterGroup();
+
+    std::vector<ClusterNode> nodes = group.GetNodes();
+
+    BOOST_REQUIRE(nodes.size() == 2);
+
+    std::vector<std::string> addrs = nodes[0].GetAddresses();
+
+    BOOST_REQUIRE(addrs.size() != 0);

Review comment:
       Can we add any check for the values in `addrs`?

##########
File path: modules/platforms/cpp/core-test/src/cluster_node_test.cpp
##########
@@ -0,0 +1,261 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <boost/test/unit_test.hpp>
+
+#include <ignite/ignition.h>
+#include <ignite/test_utils.h>
+
+using namespace ignite;
+using namespace ignite::common;
+using namespace ignite::common::concurrent;
+using namespace ignite::cluster;
+
+using namespace boost::unit_test;
+
+/*
+ * Test setup fixture.
+ */
+struct ClusterNodeTestSuiteFixture
+{
+    Ignite server;
+    Ignite client;
+
+    /*
+     * Constructor.
+     */
+    ClusterNodeTestSuiteFixture() :
+#ifdef IGNITE_TESTS_32
+        server(ignite_test::StartNode("compute-server0-32.xml", "ClusterTestServer0")),
+        client(ignite_test::StartNode("compute-client-32.xml", "ClusterTestClient"))
+#else
+        server(ignite_test::StartNode("compute-server0.xml", "ClusterTestServer0")),
+        client(ignite_test::StartNode("compute-client.xml", "ClusterTestClient"))
+#endif
+    {
+        // No-op.
+    }
+
+    /*
+     * Destructor.
+     */
+    ~ClusterNodeTestSuiteFixture()
+    {
+        Ignition::Stop(client.GetName(), true);
+        Ignition::StopAll(true);
+    }
+};
+
+BOOST_FIXTURE_TEST_SUITE(ClusterNodeTestSuite, ClusterNodeTestSuiteFixture)
+
+BOOST_AUTO_TEST_CASE(IgniteGetCluster)
+{
+    IgniteCluster cluster = server.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+}
+
+BOOST_AUTO_TEST_CASE(IgniteGetAddresses)
+{
+    IgniteCluster cluster = server.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group = cluster.AsClusterGroup();
+
+    std::vector<ClusterNode> nodes = group.GetNodes();
+
+    BOOST_REQUIRE(nodes.size() == 2);
+
+    std::vector<std::string> addrs = nodes[0].GetAddresses();
+
+    BOOST_REQUIRE(addrs.size() != 0);
+}
+
+BOOST_AUTO_TEST_CASE(IgniteGetAttribute)
+{
+    IgniteCluster cluster = server.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group = cluster.AsClusterGroup();
+
+    std::vector<ClusterNode> nodes = group.GetNodes();
+
+    BOOST_REQUIRE(nodes.size() == 2);
+
+    const std::string ATTR_BUILD_DATE = "org.apache.ignite.build.date";
+    BOOST_REQUIRE(nodes[0].IsAttributeSet(ATTR_BUILD_DATE));
+    std::string date = nodes[0].GetAttribute<std::string>(ATTR_BUILD_DATE);
+    BOOST_REQUIRE(!date.empty());
+
+    const std::string ATTR_BUILD_VER = "org.apache.ignite.build.ver";
+    BOOST_REQUIRE(nodes[0].IsAttributeSet(ATTR_BUILD_VER));
+    std::string ver = nodes[0].GetAttribute<std::string>(ATTR_BUILD_VER);
+    BOOST_REQUIRE(!ver.empty());
+
+    const std::string ATTR_CLIENT_MODE = "org.apache.ignite.cache.client";
+    BOOST_REQUIRE(nodes[0].IsAttributeSet(ATTR_CLIENT_MODE));
+    BOOST_REQUIRE(nodes[1].IsAttributeSet(ATTR_CLIENT_MODE));
+    bool isClient0 = nodes[0].GetAttribute<bool>(ATTR_CLIENT_MODE);
+    bool isClient1 = nodes[1].GetAttribute<bool>(ATTR_CLIENT_MODE);
+    BOOST_REQUIRE(!isClient0 && isClient1);
+
+    const std::string ATTR_GRID_NAME = "org.apache.ignite.ignite.name";
+    BOOST_REQUIRE(nodes[0].IsAttributeSet(ATTR_GRID_NAME));
+    std::string gridName = nodes[0].GetAttribute<std::string>(ATTR_GRID_NAME);
+    BOOST_REQUIRE(!gridName.empty());

Review comment:
       Add a check for the actual value, it is known.

##########
File path: modules/platforms/cpp/core-test/src/cluster_node_test.cpp
##########
@@ -0,0 +1,261 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <boost/test/unit_test.hpp>
+
+#include <ignite/ignition.h>
+#include <ignite/test_utils.h>
+
+using namespace ignite;
+using namespace ignite::common;
+using namespace ignite::common::concurrent;
+using namespace ignite::cluster;
+
+using namespace boost::unit_test;
+
+/*
+ * Test setup fixture.
+ */
+struct ClusterNodeTestSuiteFixture
+{
+    Ignite server;
+    Ignite client;
+
+    /*
+     * Constructor.
+     */
+    ClusterNodeTestSuiteFixture() :
+#ifdef IGNITE_TESTS_32
+        server(ignite_test::StartNode("compute-server0-32.xml", "ClusterTestServer0")),
+        client(ignite_test::StartNode("compute-client-32.xml", "ClusterTestClient"))
+#else
+        server(ignite_test::StartNode("compute-server0.xml", "ClusterTestServer0")),
+        client(ignite_test::StartNode("compute-client.xml", "ClusterTestClient"))
+#endif
+    {
+        // No-op.
+    }
+
+    /*
+     * Destructor.
+     */
+    ~ClusterNodeTestSuiteFixture()
+    {
+        Ignition::Stop(client.GetName(), true);
+        Ignition::StopAll(true);
+    }
+};
+
+BOOST_FIXTURE_TEST_SUITE(ClusterNodeTestSuite, ClusterNodeTestSuiteFixture)
+
+BOOST_AUTO_TEST_CASE(IgniteGetCluster)
+{
+    IgniteCluster cluster = server.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+}
+
+BOOST_AUTO_TEST_CASE(IgniteGetAddresses)
+{
+    IgniteCluster cluster = server.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group = cluster.AsClusterGroup();
+
+    std::vector<ClusterNode> nodes = group.GetNodes();
+
+    BOOST_REQUIRE(nodes.size() == 2);
+
+    std::vector<std::string> addrs = nodes[0].GetAddresses();
+
+    BOOST_REQUIRE(addrs.size() != 0);
+}
+
+BOOST_AUTO_TEST_CASE(IgniteGetAttribute)
+{
+    IgniteCluster cluster = server.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group = cluster.AsClusterGroup();
+
+    std::vector<ClusterNode> nodes = group.GetNodes();
+
+    BOOST_REQUIRE(nodes.size() == 2);
+
+    const std::string ATTR_BUILD_DATE = "org.apache.ignite.build.date";
+    BOOST_REQUIRE(nodes[0].IsAttributeSet(ATTR_BUILD_DATE));
+    std::string date = nodes[0].GetAttribute<std::string>(ATTR_BUILD_DATE);
+    BOOST_REQUIRE(!date.empty());
+
+    const std::string ATTR_BUILD_VER = "org.apache.ignite.build.ver";
+    BOOST_REQUIRE(nodes[0].IsAttributeSet(ATTR_BUILD_VER));
+    std::string ver = nodes[0].GetAttribute<std::string>(ATTR_BUILD_VER);
+    BOOST_REQUIRE(!ver.empty());
+
+    const std::string ATTR_CLIENT_MODE = "org.apache.ignite.cache.client";
+    BOOST_REQUIRE(nodes[0].IsAttributeSet(ATTR_CLIENT_MODE));
+    BOOST_REQUIRE(nodes[1].IsAttributeSet(ATTR_CLIENT_MODE));
+    bool isClient0 = nodes[0].GetAttribute<bool>(ATTR_CLIENT_MODE);
+    bool isClient1 = nodes[1].GetAttribute<bool>(ATTR_CLIENT_MODE);
+    BOOST_REQUIRE(!isClient0 && isClient1);
+
+    const std::string ATTR_GRID_NAME = "org.apache.ignite.ignite.name";
+    BOOST_REQUIRE(nodes[0].IsAttributeSet(ATTR_GRID_NAME));
+    std::string gridName = nodes[0].GetAttribute<std::string>(ATTR_GRID_NAME);
+    BOOST_REQUIRE(!gridName.empty());
+
+
+    const std::string ATTR_PHY_RAM = "org.apache.ignite.phy.ram";
+    BOOST_REQUIRE(nodes[0].IsAttributeSet(ATTR_PHY_RAM));
+    int64_t phyRam = nodes[0].GetAttribute<int64_t>(ATTR_PHY_RAM);
+    BOOST_REQUIRE(phyRam > 0);
+}
+
+BOOST_AUTO_TEST_CASE(IgniteGetAttributes)
+{
+    IgniteCluster cluster = server.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group = cluster.AsClusterGroup();
+
+    std::vector<ClusterNode> nodes = group.GetNodes();
+
+    BOOST_REQUIRE(nodes.size() == 2);
+
+    std::vector<std::string> attrs = nodes[0].GetAttributes();
+
+    BOOST_REQUIRE(!attrs.empty());

Review comment:
       Add a check for some attributes that are known to be present.

##########
File path: modules/platforms/cpp/core-test/src/cluster_node_test.cpp
##########
@@ -0,0 +1,261 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <boost/test/unit_test.hpp>
+
+#include <ignite/ignition.h>
+#include <ignite/test_utils.h>
+
+using namespace ignite;
+using namespace ignite::common;
+using namespace ignite::common::concurrent;
+using namespace ignite::cluster;
+
+using namespace boost::unit_test;
+
+/*
+ * Test setup fixture.
+ */
+struct ClusterNodeTestSuiteFixture
+{
+    Ignite server;
+    Ignite client;
+
+    /*
+     * Constructor.
+     */
+    ClusterNodeTestSuiteFixture() :
+#ifdef IGNITE_TESTS_32
+        server(ignite_test::StartNode("compute-server0-32.xml", "ClusterTestServer0")),
+        client(ignite_test::StartNode("compute-client-32.xml", "ClusterTestClient"))
+#else
+        server(ignite_test::StartNode("compute-server0.xml", "ClusterTestServer0")),
+        client(ignite_test::StartNode("compute-client.xml", "ClusterTestClient"))
+#endif
+    {
+        // No-op.
+    }
+
+    /*
+     * Destructor.
+     */
+    ~ClusterNodeTestSuiteFixture()
+    {
+        Ignition::Stop(client.GetName(), true);
+        Ignition::StopAll(true);
+    }
+};
+
+BOOST_FIXTURE_TEST_SUITE(ClusterNodeTestSuite, ClusterNodeTestSuiteFixture)
+
+BOOST_AUTO_TEST_CASE(IgniteGetCluster)
+{
+    IgniteCluster cluster = server.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+}
+
+BOOST_AUTO_TEST_CASE(IgniteGetAddresses)
+{
+    IgniteCluster cluster = server.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group = cluster.AsClusterGroup();
+
+    std::vector<ClusterNode> nodes = group.GetNodes();
+
+    BOOST_REQUIRE(nodes.size() == 2);
+
+    std::vector<std::string> addrs = nodes[0].GetAddresses();
+
+    BOOST_REQUIRE(addrs.size() != 0);
+}
+
+BOOST_AUTO_TEST_CASE(IgniteGetAttribute)
+{
+    IgniteCluster cluster = server.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group = cluster.AsClusterGroup();
+
+    std::vector<ClusterNode> nodes = group.GetNodes();
+
+    BOOST_REQUIRE(nodes.size() == 2);
+
+    const std::string ATTR_BUILD_DATE = "org.apache.ignite.build.date";
+    BOOST_REQUIRE(nodes[0].IsAttributeSet(ATTR_BUILD_DATE));
+    std::string date = nodes[0].GetAttribute<std::string>(ATTR_BUILD_DATE);
+    BOOST_REQUIRE(!date.empty());
+
+    const std::string ATTR_BUILD_VER = "org.apache.ignite.build.ver";
+    BOOST_REQUIRE(nodes[0].IsAttributeSet(ATTR_BUILD_VER));
+    std::string ver = nodes[0].GetAttribute<std::string>(ATTR_BUILD_VER);
+    BOOST_REQUIRE(!ver.empty());
+
+    const std::string ATTR_CLIENT_MODE = "org.apache.ignite.cache.client";
+    BOOST_REQUIRE(nodes[0].IsAttributeSet(ATTR_CLIENT_MODE));
+    BOOST_REQUIRE(nodes[1].IsAttributeSet(ATTR_CLIENT_MODE));
+    bool isClient0 = nodes[0].GetAttribute<bool>(ATTR_CLIENT_MODE);
+    bool isClient1 = nodes[1].GetAttribute<bool>(ATTR_CLIENT_MODE);
+    BOOST_REQUIRE(!isClient0 && isClient1);
+
+    const std::string ATTR_GRID_NAME = "org.apache.ignite.ignite.name";
+    BOOST_REQUIRE(nodes[0].IsAttributeSet(ATTR_GRID_NAME));
+    std::string gridName = nodes[0].GetAttribute<std::string>(ATTR_GRID_NAME);
+    BOOST_REQUIRE(!gridName.empty());
+
+
+    const std::string ATTR_PHY_RAM = "org.apache.ignite.phy.ram";
+    BOOST_REQUIRE(nodes[0].IsAttributeSet(ATTR_PHY_RAM));
+    int64_t phyRam = nodes[0].GetAttribute<int64_t>(ATTR_PHY_RAM);
+    BOOST_REQUIRE(phyRam > 0);
+}
+
+BOOST_AUTO_TEST_CASE(IgniteGetAttributes)
+{
+    IgniteCluster cluster = server.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group = cluster.AsClusterGroup();
+
+    std::vector<ClusterNode> nodes = group.GetNodes();
+
+    BOOST_REQUIRE(nodes.size() == 2);
+
+    std::vector<std::string> attrs = nodes[0].GetAttributes();
+
+    BOOST_REQUIRE(!attrs.empty());
+}
+
+BOOST_AUTO_TEST_CASE(IgniteGetConsistentId)
+{
+    IgniteCluster cluster = server.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group = cluster.AsClusterGroup();
+
+    std::vector<ClusterNode> nodes = group.GetNodes();
+
+    BOOST_REQUIRE(nodes.size() == 2);
+
+    std::string consistentId0 = nodes[0].GetConsistentId();
+    std::string consistentId1 = nodes[1].GetConsistentId();
+
+    BOOST_REQUIRE(!consistentId0.empty());
+    BOOST_REQUIRE(!consistentId1.empty());
+}
+
+BOOST_AUTO_TEST_CASE(IgniteGetHostNames)
+{
+    IgniteCluster cluster = server.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group = cluster.AsClusterGroup();
+
+    std::vector<ClusterNode> nodes = group.GetNodes();
+
+    BOOST_REQUIRE(nodes.size() == 2);
+
+    std::vector<std::string> hosts = nodes[0].GetHostNames();
+
+    BOOST_REQUIRE(hosts.empty());
+}
+
+BOOST_AUTO_TEST_CASE(IgniteGetId)
+{
+    IgniteCluster cluster = server.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group = cluster.AsClusterGroup();
+
+    std::vector<ClusterNode> nodes = group.GetNodes();
+
+    BOOST_REQUIRE(nodes.size() == 2);
+
+    Guid id1 = nodes[0].GetId();
+    Guid id2 = nodes[1].GetId();
+
+    BOOST_REQUIRE(id1 != Guid() && id2 != Guid() && id1 != id2);
+}
+
+BOOST_AUTO_TEST_CASE(IgniteIsClientDaemonLocal)
+{
+    IgniteCluster cluster = server.GetCluster();
+
+    BOOST_REQUIRE(cluster.IsActive());
+
+    ClusterGroup group = cluster.AsClusterGroup();
+
+    std::vector<ClusterNode> nodes = group.GetNodes();
+
+    BOOST_REQUIRE(nodes.size() == 2);
+
+    bool isClient = nodes[0].IsClient();
+    bool isDaemon = nodes[0].IsDaemon();
+    bool isLocal = nodes[0].IsLocal();
+
+    BOOST_REQUIRE(!isClient && !isDaemon && isLocal);

Review comment:
       It would be better to have separate assertions so we can understand which condition has failed




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org