public class LogVerifier
extends org.junit.rules.Verifier
Rule
annotation which provides a MavenLogger
instance and performs assertions on the log entries written to that logger. By default, it is
expected that no errors are logged. The expectations can be modified (per test) by calling the
expect
methods on this instance.Constructor and Description |
---|
LogVerifier() |
Modifier and Type | Method and Description |
---|---|
void |
expectError(org.hamcrest.Matcher<String> matcher)
Verify that the logged errors match the given matcher.
|
void |
expectError(String string)
Verify that the logged errors contain the given string.
|
void |
expectInfo(org.hamcrest.Matcher<String> matcher)
Verify that the info output match the given matcher.
|
void |
expectInfo(String string)
Verify that the info output contain the given string.
|
void |
expectNoWarnings()
Fails the test if warnings were logged.
|
void |
expectWarning(org.hamcrest.Matcher<String> matcher)
Verify that the logged warnings match the given matcher.
|
void |
expectWarning(String string)
Verify that the logged warnings contain the given string.
|
MavenLogger |
getLogger() |
protected void |
verify() |
public MavenLogger getLogger()
public void expectError(String string)
public void expectError(org.hamcrest.Matcher<String> matcher)
public void expectWarning(String string)
public void expectWarning(org.hamcrest.Matcher<String> matcher)
public void expectNoWarnings()
public void expectInfo(String string)
public void expectInfo(org.hamcrest.Matcher<String> matcher)
Copyright © 2008–2015 Eclipse Foundation. All rights reserved.