Example #1
0
        public static void MyClassInitialize(TestContext testContext)
        {
            string logSettingName = Assembly.GetExecutingAssembly().Location;

            logSettingName = Path.GetDirectoryName(logSettingName) + @"\log4net.Setting.xml";
            LogInit.InitLog(logSettingName);
            AppenderListener.EventLogListen += LogListener;
        }
Example #2
0
        public static void MyClassInitialize(TestContext testContext)
        {
            string logSettingName = Assembly.GetExecutingAssembly().Location;

            logSettingName = Path.GetDirectoryName(logSettingName) + @"\log4net.Setting.xml";
            LogInit.InitLog(logSettingName);
            AgentSetting.InitialSetting();
        }
Example #3
0
        public void InitLogTest()
        {
            string logSettingName = Assembly.GetExecutingAssembly().Location;

            logSettingName = Path.GetDirectoryName(logSettingName) + @"\log4net.Setting.xml";
            LogInit.InitLog(logSettingName);
            AppenderListener.EventLogListen += LogListener;

            string className = "abcde";
            int    taskId    = 12345;
            string message   = "a message";

            worked = false;
            LogHelper.GetLoggerHandle().Debug(className, taskId, message);
            Thread.Sleep(200);
            Assert.AreEqual(worked, true);
            AppenderListener.EventLogListen -= LogListener;
        }
Example #4
0
        /// <summary>
        /// The on start.
        /// </summary>
        /// <param name="args">
        /// The args.
        /// </param>
        protected override void OnStart(string[] args)
        {
            string logSettingName = System.Reflection.Assembly.GetExecutingAssembly().Location;

            logSettingName = System.IO.Path.GetDirectoryName(logSettingName) + @"\log4net.Setting.xml";
            LogInit.InitLog(logSettingName);
            var taskManager = this.container.Resolve <ITaskManager>();

            ((TaskManager)taskManager).Mode =
                (RequestTaskMode)
                Enum.Parse(typeof(RequestTaskMode), ConfigurationManager.AppSettings["RequestTaskMode"]);

            ((TaskManager)taskManager).InitializeTask();
            var invoker = new Invoker((TaskManager)taskManager);

            invoker.MaxInterval = new TimeSpan(
                int.Parse(ConfigurationManager.AppSettings["MaxInvokerInterval"])
                * TimeSpan.TicksPerSecond);
            invoker.Start();
        }