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
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 |
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()
Copyright © 2008–2013 Eclipse Foundation. All rights reserved.