protected const string testDatabaseName = "OrleansReminderTest";//for relational storage

        protected ReminderTableTestsBase(ConnectionStringFixture fixture)
        {
            TraceLogger.Initialize(new NodeConfiguration());

            logger = TraceLogger.GetLogger(GetType().Name, TraceLogger.LoggerType.Application);
            var serviceId    = Guid.NewGuid();
            var deploymentId = "test-" + serviceId;

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

            lock (fixture.SyncRoot)
            {
                if (fixture.ConnectionString == null)
                {
                    fixture.ConnectionString = GetConnectionString();
                }
            }

            var globalConfiguration = new GlobalConfiguration
            {
                ServiceId                        = serviceId,
                DeploymentId                     = deploymentId,
                AdoInvariantForReminders         = GetAdoInvariant(),
                DataConnectionStringForReminders = fixture.ConnectionString
            };

            var rmndr = CreateRemindersTable();

            rmndr.Init(globalConfiguration, logger).WithTimeout(TimeSpan.FromMinutes(1)).Wait();
            remindersTable = rmndr;
        }
Пример #2
0
        public static void ClassInitialize(TestContext testContext = null)
        {
            TraceLogger.Initialize(new NodeConfiguration());

            // Set shorter init timeout for these tests
            OrleansSiloInstanceManager.initTimeout = TimeSpan.FromSeconds(20);
        }
Пример #3
0
            public Fixture()
            {
                BufferPool.InitGlobalBufferPool(new MessagingConfiguration(false));
                ClientConfiguration cfg = ClientConfiguration.LoadFromFile("ClientConfigurationForTesting.xml");

                TraceLogger.Initialize(cfg);
            }
            public Fixture()
            {
                TraceLogger.Initialize(new NodeConfiguration());

                // Set shorter init timeout for these tests
                OrleansSiloInstanceManager.initTimeout = TimeSpan.FromSeconds(20);
            }
        public void WillCatchAndReportExceptions()
        {
            var logger = new TestLogger();

            TraceLogger.Initialize(logger);

            var token     = new CancellationToken();
            var processor = new CoverageProcessor(_mockPublisher.Object, _mockTelemetryDataCollector.Object);
            var coverage  = new List <FileCoverageInfo>();

            _mockPublisher.Setup(x => x.IsFileCoverageJsonSupported()).Returns(true);
            _mockParser.Setup(x => x.GetFileCoverageInfos()).Throws(new ParsingException("message", new Exception("error")));

            processor.ParseAndPublishCoverage(_config, token, _mockParser.Object).Wait();

            Assert.IsTrue(logger.Log.Contains("error: message System.Exception: error"));

            logger.Log = "";

            _mockParser.Setup(x => x.GetFileCoverageInfos()).Throws(new Exception("error"));

            processor.ParseAndPublishCoverage(_config, token, _mockParser.Object).Wait();

            Assert.IsTrue(logger.Log.Contains("error: An error occured while publishing coverage files. System.Exception: error"));
        }
Пример #6
0
 public AzureQueueAdapterTests(ITestOutputHelper output)
 {
     this.output       = output;
     this.deploymentId = MakeDeploymentId();
     TraceLogger.Initialize(new NodeConfiguration());
     BufferPool.InitGlobalBufferPool(new MessagingConfiguration(false));
     SerializationManager.InitializeForTesting();
 }
Пример #7
0
 public void TestInitialize()
 {
     if (!TraceLogger.IsInitialized)
     {
         TraceLogger.Initialize(ClientConfiguration.StandardLoad());
     }
     BufferPool.InitGlobalBufferPool(new MessagingConfiguration(false));
 }
            public Fixture()
            {
                BufferPool.InitGlobalBufferPool(new MessagingConfiguration(false));
                ClientConfiguration cfg = ClientConfiguration.StandardLoad();

                TraceLogger.Initialize(cfg);
                LocalDataStoreInstance.LocalDataStore = null;
            }
        static ObjectResolverTest()
        {
            var logFactory = new LoggerFactory();

            logFactory.AddNLog();
            TraceLogger.Initialize(logFactory);
            s_logger = TraceLogger.GetLogger <ObjectResolverTest>();
        }
Пример #10
0
        public static void ClassInitialize(TestContext testContext)
        {
            TraceLogger.Initialize(new NodeConfiguration());
            TraceLogger.AddTraceLevelOverride("MySqlStatisticsPublisherTests", Severity.Verbose3);

            connectionString =
                RelationalStorageForTesting.SetupInstance(adoInvariant, testDatabaseName)
                .Result.CurrentConnectionString;
        }
Пример #11
0
        public static void ClassInitialize(TestContext testContext)
        {
            Console.WriteLine("ClassInitialize {0}", testContext.TestName);
            testContext.WriteLine("ClassInitialize");
            BufferPool.InitGlobalBufferPool(new MessagingConfiguration(false));
            ClientConfiguration cfg = ClientConfiguration.StandardLoad();

            testContext.WriteLine(cfg.ToString());
            TraceLogger.Initialize(cfg);
            LocalDataStoreInstance.LocalDataStore = null;
        }
Пример #12
0
        /// <summary>
        /// Initialize log infrastrtucture for Orleans runtime sub-components
        /// </summary>
        private static void InitConsoleLogging()
        {
            Trace.Listeners.Clear();
            var cfg = new NodeConfiguration {
                TraceFilePattern = null, TraceToConsole = false
            };

            TraceLogger.Initialize(cfg);
            var logWriter = new LogWriterToConsole(true, true); // Use compact console output & no timestamps / log message metadata

            TraceLogger.LogConsumers.Add(logWriter);
        }
Пример #13
0
        public static void DoClassInitialize()
        {
            Console.WriteLine("ReminderTests ClassInitialize");

            ClientConfiguration cfg = ClientConfiguration.LoadFromFile("ClientConfigurationForTesting.xml");

            TraceLogger.Initialize(cfg);
#if DEBUG
            TraceLogger.AddTraceLevelOverride("Storage", Severity.Verbose3);
            TraceLogger.AddTraceLevelOverride("Reminder", Severity.Verbose3);
#endif
        }
Пример #14
0
        public void DoTestInitialize()
        {
            ClientConfiguration cfg = ClientConfiguration.LoadFromFile("ClientConfigurationForTesting.xml");

            TraceLogger.Initialize(cfg);
#if DEBUG
            TraceLogger.AddTraceLevelOverride("Storage", Severity.Verbose3);
            TraceLogger.AddTraceLevelOverride("Reminder", Severity.Verbose3);
#endif
            log = TraceLogger.GetLogger(this.GetType().Name, TraceLogger.LoggerType.Application);
            Console.WriteLine("base.DoTestInitialize completed");
        }
Пример #15
0
        public static void ClassInitialize(TestContext testContext)
        {
            hostName = Dns.GetHostName();
            logger   = TraceLogger.GetLogger("MembershipTablePluginTests", TraceLogger.LoggerType.Application);

            ClusterConfiguration cfg = new ClusterConfiguration();

            cfg.LoadFromFile("OrleansConfigurationForTesting.xml");
            TraceLogger.Initialize(cfg.GetOrAddConfigurationForNode("Primary"));

            TraceLogger.AddTraceLevelOverride("AzureTableDataManager", Severity.Verbose3);
            TraceLogger.AddTraceLevelOverride("OrleansSiloInstanceManager", Severity.Verbose3);
            TraceLogger.AddTraceLevelOverride("Storage", Severity.Verbose3);
        }
Пример #16
0
        public static void ClassInitialize(TestContext testContext)
        {
            hostName = Dns.GetHostName();

            var cfg = new NodeConfiguration();

            TraceLogger.Initialize(cfg);

            TraceLogger.AddTraceLevelOverride("AzureTableDataManager", Logger.Severity.Verbose3);
            TraceLogger.AddTraceLevelOverride("OrleansSiloInstanceManager", Logger.Severity.Verbose3);
            TraceLogger.AddTraceLevelOverride("Storage", Logger.Severity.Verbose3);

            // Set shorter init timeout for these tests
            OrleansSiloInstanceManager.initTimeout = TimeSpan.FromSeconds(20);
        }