use of com.puppycrawl.tools.checkstyle.api.AuditEvent in project checkstyle by checkstyle.
the class SuppressElementTest method testDecideByFileNameAndModuleMatchingMessageNull.
@Test
public void testDecideByFileNameAndModuleMatchingMessageNull() {
final AuditEvent ev = new AuditEvent(this, "ATest.java", null);
assertTrue(filter.accept(ev));
}
use of com.puppycrawl.tools.checkstyle.api.AuditEvent in project checkstyle by checkstyle.
the class SuppressElementTest method testDecideByFileNameAndModuleMatchingCheckRegExpMatch.
@Test
public void testDecideByFileNameAndModuleMatchingCheckRegExpMatch() {
final LocalizedMessage message = new LocalizedMessage(10, 10, "", "", null, null, getClass(), null);
final AuditEvent ev = new AuditEvent(this, "ATest.java", message);
filter.setChecks(getClass().getCanonicalName());
assertFalse(filter.accept(ev));
}
use of com.puppycrawl.tools.checkstyle.api.AuditEvent in project checkstyle by checkstyle.
the class SuppressElementTest method testDecideLocalizedMessage.
@Test
public void testDecideLocalizedMessage() {
final LocalizedMessage message = new LocalizedMessage(0, 0, "", "", null, null, getClass(), null);
final AuditEvent ev = new AuditEvent(this, "ATest.java", message);
//deny because there are matches on file and check names
assertFalse("Names match", filter.accept(ev));
}
use of com.puppycrawl.tools.checkstyle.api.AuditEvent in project checkstyle by checkstyle.
the class DefaultLoggerTest method testCtorWithTwoParameters.
@Test
public void testCtorWithTwoParameters() {
final OutputStream infoStream = new ByteArrayOutputStream();
final DefaultLogger dl = new DefaultLogger(infoStream, true);
dl.addException(new AuditEvent(5000, "myfile"), new IllegalStateException("upsss"));
dl.auditFinished(new AuditEvent(6000, "myfile"));
}
use of com.puppycrawl.tools.checkstyle.api.AuditEvent in project checkstyle by checkstyle.
the class DefaultLoggerTest method testCtor.
@Test
public void testCtor() {
final OutputStream infoStream = new ByteArrayOutputStream();
final OutputStream errorStream = new ByteArrayOutputStream();
final DefaultLogger dl = new DefaultLogger(infoStream, true, errorStream, true);
dl.addException(new AuditEvent(5000, "myfile"), new IllegalStateException("upsss"));
dl.auditFinished(new AuditEvent(6000, "myfile"));
}
Aggregations