Ejemplo n.º 1
0
        public void ParsePostgresHbaConfFile(string logFile)
        {
            var logPath = TestDataHelper.GetServerLogProcessorResourcePath(logFile);

            IList <JObject> documents = ParserTestHelpers.ParseFile(logPath, new PostgresHostConfigParser(), SampleLogWorkerName);

            documents.Count.Should().Be(1, "Should have parsed exactly one document from one config file!");
        }
Ejemplo n.º 2
0
        public void ParseConnectionsPropertiesFile(string logFile)
        {
            var          logPath            = TestDataHelper.GetServerLogProcessorResourcePath(logFile);
            const string sampleLogWorerName = "worker2";

            IList <JObject> documents = ParserTestHelpers.ParseFile(logPath, new ConnectionsConfigParser(), SampleLogWorkerName);

            documents.Count.Should().Be(1, "Should have parsed exactly one document from one config file!");
        }
        public void ParseBuildVersionLogFile(string logFile)
        {
            var          logPath             = TestDataHelper.GetServerLogProcessorResourcePath(logFile);
            const string sampleLogWorkerName = "worker2";

            IList <JObject> documents = ParserTestHelpers.ParseFile(logPath, new BuildVersionParser(), sampleLogWorkerName);

            documents.Count.Should().Be(1, "Should have one parsed document!");
        }
        public void ParseSearchServerLocalhostFullFile(string logFile)
        {
            var logPath = TestDataHelper.GetServerLogProcessorResourcePath(logFile);

            IList <JObject> documents = ParserTestHelpers.ParseFile(logPath, new SearchServerLocalhostParser());

            var lineCount = File.ReadAllLines(logPath).Length;

            documents.Count.Should().Be(lineCount, "Number of parsed documents should match number of lines in file!");
        }
Ejemplo n.º 5
0
        public void ParseVizqlServerLogFile(string logFile)
        {
            var          logPath             = TestDataHelper.GetServerLogProcessorResourcePath(logFile);
            const string sampleLogWorkerName = "worker2";

            IList <JObject> documents = ParserTestHelpers.ParseFile(logPath, new VizqlServerCppParser(), sampleLogWorkerName);
            var             lineCount = File.ReadAllLines(logPath).Length;

            documents.Count.Should().Be(lineCount, "Number of parsed documents should match number of lines in file!");
        }
Ejemplo n.º 6
0
        private static JObject ParseAndValidateNetstatRootDocument(IParser parser, string logFile)
        {
            var logPath = TestDataHelper.GetServerLogProcessorResourcePath(logFile);

            ICollection <JObject> documents = ParserTestHelpers.ParseFile(logPath, parser);

            documents.Should().HaveCount(1, "Parsing a netstat file should return exactly one root document");

            return(documents.First());
        }
Ejemplo n.º 7
0
        public void ParseTabAdminLog(string logFile)
        {
            var logPath = TestDataHelper.GetServerLogProcessorResourcePath(logFile);

            IList <JObject> documents = ParserTestHelpers.ParseFile(logPath, new TabAdminParser());

            // Count number of actual log events by counting the number of timestamps
            var lineCount = Regex.Matches(File.ReadAllText(logPath), @"\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}.\d{3} [+|-]\d{4}_[A-Z]").Count;

            documents.Count.Should().Be(lineCount, "Number of parsed documents should match number of lines in file!");
        }
Ejemplo n.º 8
0
        private static void ParseFullJavaFile(string logFile, IParser parser, string sampleLogWorkerName = "worker0")
        {
            var logPath = TestDataHelper.GetServerLogProcessorResourcePath(logFile);

            IList <JObject> documents = ParserTestHelpers.ParseFile(logPath, parser, sampleLogWorkerName);

            // Count number of actual log events by counting the number of timestamps
            var lineCount = Regex.Matches(File.ReadAllText(logPath), @"\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}.\d{3} [+|-]\d{4}").Count;

            documents.Count.Should().Be(lineCount, "Number of parsed documents should match number of lines in file!");
        }
Ejemplo n.º 9
0
        public void ParsePostgresLog(string logFile)
        {
            var logPath = TestDataHelper.GetServerLogProcessorResourcePath(logFile);

            IList <JObject> documents = ParserTestHelpers.ParseFile(logPath, new PostgresParser());

            // Count number of actual log events by counting the number of timestamps
            var lineCount = Regex.Matches(File.ReadAllText(logPath), @"^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}.\d{3}\s", RegexOptions.Multiline).Count;

            documents.Count.Should().Be(lineCount, "Number of parsed documents should match number of timestamps in file!");
        }