Search in sources :

Example 1 with ClusterNodeView

use of org.apache.ignite.spi.systemview.view.ClusterNodeView in project ignite by apache.

the class SystemViewSelfTest method testNodes.

/**
 */
@Test
public void testNodes() throws Exception {
    try (IgniteEx g1 = startGrid(0)) {
        SystemView<ClusterNodeView> views = g1.context().systemView().view(NODES_SYS_VIEW);
        assertEquals(1, views.size());
        try (IgniteEx g2 = startGrid(1)) {
            awaitPartitionMapExchange();
            checkViewsState(views, g1.localNode(), g2.localNode());
            checkViewsState(g2.context().systemView().view(NODES_SYS_VIEW), g2.localNode(), g1.localNode());
        }
        assertEquals(1, views.size());
    }
}
Also used : IgniteEx(org.apache.ignite.internal.IgniteEx) ClusterNodeView(org.apache.ignite.spi.systemview.view.ClusterNodeView) Test(org.junit.Test) GridCommonAbstractTest(org.apache.ignite.testframework.junits.common.GridCommonAbstractTest)

Aggregations

IgniteEx (org.apache.ignite.internal.IgniteEx)1 ClusterNodeView (org.apache.ignite.spi.systemview.view.ClusterNodeView)1 GridCommonAbstractTest (org.apache.ignite.testframework.junits.common.GridCommonAbstractTest)1 Test (org.junit.Test)1