Ejemplo n.º 1
0
        public void GroupNodesTest()
        {
            var cfg1 = new GridionConfiguration("node1", GridionEndpoint.GetDefault().Host, GridionEndpoint.GetDefault().Port);
            var cfg2 = new GridionConfiguration("node2", GridionEndpoint.GetDefault().Host, GridionEndpoint.GetDefault().Port + 1);

            using (var gridion = GridionFactory.Start(cfg1))
            {
                Assert.AreEqual(1, gridion.Cluster.Nodes.Count);
                using (var gridion2 = GridionFactory.Start(cfg2))
                {
                    Assert.AreEqual(2, gridion.Cluster.Nodes.Count);
                    Assert.AreEqual(2, gridion2.Cluster.Nodes.Count);
                }

                Assert.AreEqual(1, gridion.Cluster.Nodes.Count);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        ///     Gets the default instance of <see cref="Configuration" /> class.
        /// </summary>
        /// <returns>
        ///     an initialized instance of <see cref="Configuration" /> class.
        /// </returns>
        internal static Configuration GetDefault()
        {
            var gridionEndpoint = GridionEndpoint.GetDefault();

            return(new Configuration(gridionEndpoint.Host, gridionEndpoint.Port));
        }