Ejemplo n.º 1
0
        public void TestMethodInfo()
        {
            var parser = new LogParser();
            var m      =
                parser.CheckLogMark(
                    @"2015-01-12 22:40:05,498 [9] INFO  NHibernate.Loader.Loader - SELECT this_.id as id461_0_, ");

            Assert.AreEqual(true, m.Success);
        }
Ejemplo n.º 2
0
        public void TestMethod1()
        {
            var parser = new LogParser();
            var m      =
                parser.CheckLogMark(
                    @"2015-01-12 22:40:08,579 [9] DEBUG NHibernate.Loader.Loader - processing result set");

            Assert.AreEqual(true, m.Success);
        }
Ejemplo n.º 3
0
        public void CheckLogMarkTest2()
        {
            var target = new LogParser();
            var actual = target.CheckLogMark(@"2015-04-09 16:23:21 EEST:                    :     @   :[18582]: [2-1]: FATAL:");

            Assert.AreEqual(true, actual.Success);
            Assert.AreEqual("2015-04-09 16:23:21", actual.Groups["stamp"].ToString());
            Assert.AreEqual("EEST", actual.Groups["timezone"].ToString());
            Assert.AreEqual("", actual.Groups["ip"].ToString());
            Assert.AreEqual("@", actual.Groups["login"].ToString().Trim());
            Assert.AreEqual("18582", actual.Groups["id1"].ToString());
            Assert.AreEqual("2-1", actual.Groups["id2"].ToString());
            Assert.AreEqual("FATAL", actual.Groups["kind"].ToString());
            Assert.AreEqual("", actual.Groups["chunk"].ToString());
        }
Ejemplo n.º 4
0
        public void CheckLogMarkTest()
        {
            var target = new LogParser();
            var actual = target.CheckLogMark(@"2015-04-09 16:00:03 EEST:                    :     @   :[4093] : [25293-1]: LOG:  ");

            Assert.AreEqual(true, actual.Success);
            Assert.AreEqual("2015-04-09 16:00:03", actual.Groups["stamp"].ToString());
            Assert.AreEqual("EEST", actual.Groups["timezone"].ToString());
            Assert.AreEqual("", actual.Groups["ip"].ToString());
            Assert.AreEqual("@", actual.Groups["login"].ToString().Trim());
            Assert.AreEqual("4093", actual.Groups["id1"].ToString());
            Assert.AreEqual("25293-1", actual.Groups["id2"].ToString());
            Assert.AreEqual("LOG", actual.Groups["kind"].ToString());
            Assert.AreEqual("  ", actual.Groups["chunk"].ToString());
        }
Ejemplo n.º 5
0
        public void CheckLogMarkTest3()
        {
            var target = new LogParser();
            var actual = target.CheckLogMark(@"2015-04-09 16:24:54 EEST:192.168.10.16(54238):TaMo@TaMo:[43856]: [1-1]: ERROR: ");

            Assert.AreEqual(true, actual.Success);
            Assert.AreEqual("2015-04-09 16:24:54", actual.Groups["stamp"].ToString());
            Assert.AreEqual("EEST", actual.Groups["timezone"].ToString());
            Assert.AreEqual("192.168.10.16(54238)", actual.Groups["ip"].ToString());
            Assert.AreEqual("TaMo@TaMo", actual.Groups["login"].ToString().Trim());
            Assert.AreEqual("43856", actual.Groups["id1"].ToString());
            Assert.AreEqual("1-1", actual.Groups["id2"].ToString());
            Assert.AreEqual("ERROR", actual.Groups["kind"].ToString());
            Assert.AreEqual(" ", actual.Groups["chunk"].ToString());
        }