private static TabadminControllerEvent ParseError(LogLine logLine, JavaLineMatchResult javaLineMatchResult,
                                                   string eventType)
 {
     return(javaLineMatchResult.IsWarningPriorityOrHigher()
         ? new TabadminControllerEvent(eventType, logLine, javaLineMatchResult)
         : null);
 }
Exemplo n.º 2
0
        public TabadminControllerEvent ParseEvent(LogLine logLine, JavaLineMatchResult javaLineMatchResult)
        {
            if (string.IsNullOrWhiteSpace(javaLineMatchResult.Message))
            {
                _processingNotificationsCollector.ReportError($"Line does not appear to have a message", logLine, nameof(TabadminControllerEventParser));
                return(null);
            }

            if (javaLineMatchResult.IsWarningPriorityOrHigher())
            {
                return(new TabadminControllerEvent("Error - Tabadmin Controller", logLine, javaLineMatchResult, _buildTracker));
            }

            if (javaLineMatchResult.Class.Equals("com.tableausoftware.tabadmin.configuration.builder.AppConfigurationBuilder", StringComparison.InvariantCulture))
            {
                return(ParseVersionInfo(logLine, javaLineMatchResult));
            }

            if (javaLineMatchResult.Class.StartsWith("com.tableausoftware.tabadmin.webapp.asyncjobs.", StringComparison.InvariantCulture))
            {
                return(ParseAsyncJobServiceMessages(logLine, javaLineMatchResult));
            }

            if (javaLineMatchResult.Class.StartsWith("com.tableausoftware.tabadmin.webapp.config."))
            {
                return(ParseConfigChangeRequests(logLine, javaLineMatchResult));
            }

            if (javaLineMatchResult.Class.StartsWith("com.tableausoftware.tabadmin.webapp."))
            {
                return(ParseAuthenticationRequests(logLine, javaLineMatchResult));
            }

            return(null); // Line did not match any known events
        }
Exemplo n.º 3
0
        public void IsWarningPriorityOrHigher(string severityToUse, bool expectedResult)
        {
            var javaLineMatchResult = new JavaLineMatchResult(true)
            {
                Severity = severityToUse
            };

            javaLineMatchResult.IsWarningPriorityOrHigher().Should().Be(expectedResult);
        }