Search in sources :

Example 1 with EqualsVerifierReport

use of nl.jqno.equalsverifier.EqualsVerifierReport in project checkstyle by checkstyle.

the class IntMatchFilterElementTest method testEqualsAndHashCode.

@Test
public void testEqualsAndHashCode() {
    final EqualsVerifierReport ev = EqualsVerifier.forClass(IntMatchFilterElement.class).report();
    assertWithMessage("Error: " + ev.getMessage()).that(ev.isSuccessful()).isTrue();
}
Also used : EqualsVerifierReport(nl.jqno.equalsverifier.EqualsVerifierReport) Test(org.junit.jupiter.api.Test)

Example 2 with EqualsVerifierReport

use of nl.jqno.equalsverifier.EqualsVerifierReport in project checkstyle by checkstyle.

the class SuppressWithNearbyCommentFilterTest method testEqualsAndHashCodeOfTagClass.

@Test
public void testEqualsAndHashCodeOfTagClass() {
    final SuppressWithNearbyCommentFilter filter = new SuppressWithNearbyCommentFilter();
    final Object tag = getTagsAfterExecution(filter, "filename", "//SUPPRESS CHECKSTYLE ignore").get(0);
    final EqualsVerifierReport ev = EqualsVerifier.forClass(tag.getClass()).usingGetClass().report();
    assertWithMessage("Error: " + ev.getMessage()).that(ev.isSuccessful()).isTrue();
}
Also used : EqualsVerifierReport(nl.jqno.equalsverifier.EqualsVerifierReport) Test(org.junit.jupiter.api.Test)

Example 3 with EqualsVerifierReport

use of nl.jqno.equalsverifier.EqualsVerifierReport in project checkstyle by checkstyle.

the class SuppressionXpathFilterTest method testEqualsAndHashCode.

@Test
public void testEqualsAndHashCode() {
    final EqualsVerifierReport ev = EqualsVerifier.forClass(SuppressionXpathFilter.class).usingGetClass().withIgnoredFields("file", "optional", "configuration").suppress(Warning.NONFINAL_FIELDS).report();
    assertWithMessage("Error: " + ev.getMessage()).that(ev.isSuccessful()).isTrue();
}
Also used : EqualsVerifierReport(nl.jqno.equalsverifier.EqualsVerifierReport) Test(org.junit.jupiter.api.Test)

Example 4 with EqualsVerifierReport

use of nl.jqno.equalsverifier.EqualsVerifierReport in project checkstyle by checkstyle.

the class SuppressFilterElementTest method testEqualsAndHashCode.

@Test
public void testEqualsAndHashCode() {
    final EqualsVerifierReport ev = EqualsVerifier.forClass(SuppressFilterElement.class).usingGetClass().withIgnoredFields("fileRegexp", "checkRegexp", "messageRegexp", "columnFilter", "lineFilter").suppress(Warning.NONFINAL_FIELDS).report();
    assertWithMessage("Error: " + ev.getMessage()).that(ev.isSuccessful()).isTrue();
}
Also used : EqualsVerifierReport(nl.jqno.equalsverifier.EqualsVerifierReport) Test(org.junit.jupiter.api.Test) TreeWalkerTest(com.puppycrawl.tools.checkstyle.TreeWalkerTest)

Example 5 with EqualsVerifierReport

use of nl.jqno.equalsverifier.EqualsVerifierReport in project checkstyle by checkstyle.

the class ViolationTest method testEqualsAndHashCode.

@Test
public void testEqualsAndHashCode() {
    final EqualsVerifierReport ev = EqualsVerifier.forClass(Violation.class).usingGetClass().report();
    assertWithMessage("Error: " + ev.getMessage()).that(ev.isSuccessful()).isTrue();
}
Also used : EqualsVerifierReport(nl.jqno.equalsverifier.EqualsVerifierReport) Test(org.junit.jupiter.api.Test)

Aggregations

EqualsVerifierReport (nl.jqno.equalsverifier.EqualsVerifierReport)11 Test (org.junit.jupiter.api.Test)11 TreeWalkerTest (com.puppycrawl.tools.checkstyle.TreeWalkerTest)1 XPathEvaluator (net.sf.saxon.sxpath.XPathEvaluator)1 XPathExpression (net.sf.saxon.sxpath.XPathExpression)1