Package edu.umd.cs.findbugs.filter

Examples of edu.umd.cs.findbugs.filter.Matcher.match()


    @Test
    public void invertMatcherShouldNegateTheOriginalMatchingResult() {
        BugInstance bug = new BugInstance("UUF_UNUSED_FIELD", 0);
        Matcher originalMatcher = FilterFactory.makeMatcher(asList(Sortables.BUGCODE), bug);

        assertTrue("Original matcher should match bug.", originalMatcher.match(bug));

        Matcher notMatcher = FilterFactory.invertMatcher(originalMatcher);
        assertTrue("Should return an instance of NotMatcher.", notMatcher instanceof NotMatcher);
        assertFalse("Inverted matcher should now not match.", notMatcher.match(bug));
    }
View Full Code Here


        assertTrue("Original matcher should match bug.", originalMatcher.match(bug));

        Matcher notMatcher = FilterFactory.invertMatcher(originalMatcher);
        assertTrue("Should return an instance of NotMatcher.", notMatcher instanceof NotMatcher);
        assertFalse("Inverted matcher should now not match.", notMatcher.match(bug));
    }

    @Test
    public void shouldReturnTheOriginalMatcherWhenAskedToInvertANotMatcher() {
        BugInstance bug = new BugInstance("UUF_UNUSED_FIELD", 0);
View Full Code Here

        Matcher originalMatcher = FilterFactory.makeMatcher(asList(Sortables.BUGCODE), bug);
        Matcher notMatcher = FilterFactory.invertMatcher(originalMatcher);
        Matcher notNotMatcher = FilterFactory.invertMatcher(notMatcher);

        assertSame("Should return the originally wrapped matcher.", originalMatcher, notNotMatcher);
        assertTrue("Original matcher should now not match.", notNotMatcher.match(bug));
    }

}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.