예제 #1
0
        static void Main(string[] args)
        {
            Func4();
            Func1();
            Func6();
            Func6();
            Thread thread1 = new Thread(Func5);

            thread1.Start();
            thread1.Join();
            Thread thread2 = new Thread(Func3);

            thread2.Start();
            thread2.Join();
            Thread.Sleep(rnd.Next(sleepTimeCeiling));
            TotalTraceResult      totalTraceResult = tracer.GetTraceResult();
            ITraceResultFormatter consoleFormatter = new ConsoleTraceResultFormatter();

            consoleFormatter.Format(totalTraceResult);
            ITraceResultFormatter xmlFormatter = new XmlTraceResultFormatter(pathToXml);

            xmlFormatter.Format(totalTraceResult);

            Console.Read();
        }
예제 #2
0
        static void Main(string[] args)
        {
            InitializeFormattersDictionary();
            ITraceResultFormatter formatter;

            try
            {
                formatter = formatters[args[0]];
            }
            catch (Exception)
            {
                formatter = new ConsoleTraceResultFormatter();
            }

            InitializeMethods();

            tracer.StartTrace();
            StartThreads();

            SomeTestMethod5();
            Thread.Sleep(GetRandomTimeInMilliseconds());

            StopThreads();
            tracer.StopTrace();

            TraceResult traceResult = tracer.GetTraceResult();

            formatter.Format(traceResult);

            SayGoodBye();
        }
예제 #3
0
        private static void OutputInfo()
        {
            var xmlFormatter     = new XmlTraceResultFormatter("TraceResult.xml");
            var consoleFormatter = new ConsoleTraceResultFormatter();

            consoleFormatter.Format(Tracer.GetTraceResult());
            xmlFormatter.Format(Tracer.GetTraceResult());
        }
예제 #4
0
        static void Main(string[] args)
        {
            Thread thread = new Thread(() =>
            {
                _tracer.StartTrace();
                Thread.Sleep(69);
                MethodOne(13, new object());
                Thread.Sleep(50);
                MethodFive(12);
                _tracer.StopTrace();
                _tracer.StartTrace();
                Thread.Sleep(100);
                _tracer.StopTrace();
                Tracer.XmlTraceResultFormatter xmlTraceResultFormatter = new XmlTraceResultFormatter("testXML.xml");
                xmlTraceResultFormatter.Format(_tracer.GetTraceResult());
                Tracer.ConsoleTraceResultFormatter consoleTraceResultFormatter = new ConsoleTraceResultFormatter();

                consoleTraceResultFormatter.Format(_tracer.GetTraceResult());
            });

            thread.Start();
            Console.ReadLine();
        }