コード例 #1
0
        public AzureGossipTableTests()
        {
            this.loggerFactory = TestingUtils.CreateDefaultLoggerFactory($"{this.GetType().Name}.log");
            this.logger        = this.loggerFactory.CreateLogger <AzureGossipTableTests>();

            this.globalServiceId = Guid.NewGuid();

            IPAddress ip;

            if (!IPAddress.TryParse("127.0.0.1", out ip))
            {
                this.logger.Error(-1, "Could not parse ip address");
                return;
            }
            IPEndPoint ep1 = new IPEndPoint(ip, 21111);

            this.siloAddress1 = SiloAddress.New(ep1, 0);
            IPEndPoint ep2 = new IPEndPoint(ip, 21112);

            this.siloAddress2 = SiloAddress.New(ep2, 0);

            this.logger.Info("Global ServiceId={0}", this.globalServiceId);

            this.gossipTable = new AzureTableBasedGossipChannel(this.loggerFactory);
            var done = this.gossipTable.Initialize(globalServiceId.ToString(), TestDefaultConfiguration.DataConnectionString);

            if (!done.Wait(Timeout))
            {
                throw new TimeoutException("Could not create/read table.");
            }
        }
コード例 #2
0
        public AzureGossipTableTests()
        {
            loggerFactory = TestingUtils.CreateDefaultLoggerFactory($"{this.GetType().Name}.log");
            logger        = new LoggerWrapper <AzureGossipTableTests>(loggerFactory);

            globalServiceId = Guid.NewGuid();
            deploymentId    = "test-" + globalServiceId;

            IPAddress ip;

            if (!IPAddress.TryParse("127.0.0.1", out ip))
            {
                logger.Error(-1, "Could not parse ip address");
                return;
            }
            IPEndPoint ep1 = new IPEndPoint(ip, 21111);

            siloAddress1 = SiloAddress.New(ep1, 0);
            IPEndPoint ep2 = new IPEndPoint(ip, 21112);

            siloAddress2 = SiloAddress.New(ep2, 0);

            logger.Info("DeploymentId={0}", deploymentId);

            GlobalConfiguration config = new GlobalConfiguration
            {
                ServiceId            = globalServiceId,
                ClusterId            = "0",
                DeploymentId         = deploymentId,
                DataConnectionString = TestDefaultConfiguration.DataConnectionString
            };

            gossipTable = new AzureTableBasedGossipChannel(loggerFactory);
            var done = gossipTable.Initialize(config.ServiceId, config.DataConnectionString);

            if (!done.Wait(timeout))
            {
                throw new TimeoutException("Could not create/read table.");
            }
        }
コード例 #3
0
        private AzureTableBasedGossipChannel gossipTable; // This type is internal

        public AzureGossipTableTests()
        {
            logger = LogManager.GetLogger("AzureGossipTableTests", LoggerType.Application);

            globalServiceId = Guid.NewGuid();
            deploymentId    = "test-" + globalServiceId;

            IPAddress ip;

            if (!IPAddress.TryParse("127.0.0.1", out ip))
            {
                logger.Error(-1, "Could not parse ip address");
                return;
            }
            IPEndPoint ep1 = new IPEndPoint(ip, 21111);

            siloAddress1 = SiloAddress.New(ep1, 0);
            IPEndPoint ep2 = new IPEndPoint(ip, 21112);

            siloAddress2 = SiloAddress.New(ep2, 0);

            logger.Info("DeploymentId={0}", deploymentId);

            GlobalConfiguration config = new GlobalConfiguration
            {
                ServiceId            = globalServiceId,
                ClusterId            = "0",
                DeploymentId         = deploymentId,
                DataConnectionString = StorageTestConstants.DataConnectionString
            };

            gossipTable = new AzureTableBasedGossipChannel();
            var done = gossipTable.Initialize(config.ServiceId, config.DataConnectionString);

            if (!done.Wait(timeout))
            {
                throw new TimeoutException("Could not create/read table.");
            }
        }