Esempio n. 1
0
        public void CheckFlushOrderByThreads()
        {
            ILoggerTarget[] loggerTarget = new ILoggerTarget[2];
            loggerTarget[0] = fileTarget;
            loggerTarget[1] = udpPortTarget;

            Logger logger = new Logger(2, loggerTarget);

            ListenerLogsFromUdpPort listener = new ListenerLogsFromUdpPort(port);

            listener.StartListen();

            LogThreadPool.RunAndWaitLogingThreads(10, 2, logger);
            while (!logger.IsFlushLogThreadPoolClear)
            {
                ;
            }

            LoggerWithFileTargetTest.TestMethod(targetFileName);

            listener.StopListen();
            while (listener.IsRunningListenerThread)
            {
                ;
            }
        }
        public void CheckFlushOrderInFileTargetByThreads()
        {
            ILoggerTarget[] loggerTargets = new ILoggerTarget[1];
            loggerTargets[0] = new FileTarget(targetFileName);
            Logger logger = new Logger(2, loggerTargets);

            LogThreadPool.RunAndWaitLogingThreads(50, 2, logger);

            while (!logger.IsFlushLogThreadPoolClear)
            {
                ;
            }

            TestMethod(targetFileName);
        }
Esempio n. 3
0
        public void CheckFlushOrderInUdpPortTargetByThreads()
        {
            ILoggerTarget[] loggerTargets = new ILoggerTarget[1];
            loggerTargets[0] = udpPortTarget;
            Logger logger = new Logger(2, loggerTargets);

            ListenerLogsFromUdpPort listener = new ListenerLogsFromUdpPort(port);

            listener.StartListen();

            LogThreadPool.RunAndWaitLogingThreads(10, 2, logger);
            while (!logger.IsFlushLogThreadPoolClear)
            {
                ;
            }


            listener.StopListen();
            while (listener.IsRunningListenerThread)
            {
                ;
            }
        }