Example #1
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.");
            }
        }
Example #2
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.");
            }
        }