Package com.atlassian.bamboo.utils
Class LogVerifier
java.lang.Object
com.atlassian.bamboo.utils.LogVerifier
- All Implemented Interfaces:
AutoCloseable
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic LogVerifier
static LogVerifier
catchLogMessages
(Class<?> classType) static LogVerifier
catchLogMessages
(org.apache.log4j.Logger logger) static LogVerifier
catchLogMessages
(org.apache.logging.log4j.Logger logger) void
close()
static org.hamcrest.Matcher<org.apache.logging.log4j.core.LogEvent>
static org.hamcrest.Matcher<org.apache.logging.log4j.core.LogEvent>
level
(org.hamcrest.Matcher<? super org.apache.logging.log4j.Level> levelMatcher) static org.hamcrest.Matcher<org.apache.logging.log4j.core.LogEvent>
renderedMessage
(org.hamcrest.Matcher<? super String> subMatcher) void
verifyEventCount
(int count) void
verifyEventLogged
(org.hamcrest.Matcher<org.apache.logging.log4j.core.LogEvent> logEventMatcher) void
verifyEventNotLogged
(org.hamcrest.Matcher<org.apache.logging.log4j.core.LogEvent> logEventMatcher) final void
verifyEventsLogged
(org.hamcrest.Matcher<org.apache.logging.log4j.core.LogEvent>... logEventMatchers) final void
verifyEventsNotLogged
(org.hamcrest.Matcher<org.apache.logging.log4j.core.LogEvent>... logEventMatchers) void
-
Constructor Details
-
LogVerifier
public LogVerifier(org.apache.logging.log4j.core.Logger logger)
-
-
Method Details
-
catchLogMessages
-
catchLogMessages
-
catchLogMessages
-
catchLogMessages
-
verifyEventLogged
public void verifyEventLogged(org.hamcrest.Matcher<org.apache.logging.log4j.core.LogEvent> logEventMatcher) -
verifyEventNotLogged
public void verifyEventNotLogged(org.hamcrest.Matcher<org.apache.logging.log4j.core.LogEvent> logEventMatcher) -
verifyEventsLogged
@SafeVarargs public final void verifyEventsLogged(org.hamcrest.Matcher<org.apache.logging.log4j.core.LogEvent>... logEventMatchers) -
verifyEventsNotLogged
@SafeVarargs public final void verifyEventsNotLogged(org.hamcrest.Matcher<org.apache.logging.log4j.core.LogEvent>... logEventMatchers) -
verifyEventCount
public void verifyEventCount(int count) -
verifyNoEventsLogged
public void verifyNoEventsLogged() -
close
- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-
level
public static org.hamcrest.Matcher<org.apache.logging.log4j.core.LogEvent> level(org.hamcrest.Matcher<? super org.apache.logging.log4j.Level> levelMatcher) -
exception
public static org.hamcrest.Matcher<org.apache.logging.log4j.core.LogEvent> exception(org.hamcrest.Matcher<? super Throwable> subMatcher) -
renderedMessage
public static org.hamcrest.Matcher<org.apache.logging.log4j.core.LogEvent> renderedMessage(org.hamcrest.Matcher<? super String> subMatcher)
-