@Test public void testMatches() { NodeMatcher left = mock( NodeMatcher.class ); NodeMatcher right = mock( NodeMatcher.class ); MatcherContext context = mock( MatcherContext.class ); ReportElement node = mock( ReportElement.class ); OrMatcher matcher = new OrMatcher(); assertThat( matcher.matches( context, node ), is( equalTo( false ) ) ); doReturn( false ).when( left ).matches( context, node ); doReturn( true ).when( right ).matches( context, node ); matcher = new OrMatcher( left, right ); assertThat( matcher.matches( context, node ), is( equalTo( true ) ) ); }
public boolean matches( final MatcherContext context, final ReportElement node ) { boolean result = false; for ( int i = 0; i < conditions.length; i++ ) { final NodeMatcher condition = conditions[i]; final boolean subresult = condition.matches( context, node ); if ( subresult ) { result = true; } } return result; }
OrMatcher implements NodeMatcher { public boolean matches( final MatcherContext context, final ReportElement node ) { boolean result = false; for ( int i = 0; i < conditions.length; i++ ) { final NodeMatcher condition = conditions[i]; final boolean subresult = condition.matches( context, node ); if ( subresult ) { result = true; } } return result; } }
OrMatcher implements NodeMatcher { public boolean matches( final MatcherContext context, final ReportElement node ) { boolean result = false; for ( int i = 0; i < conditions.length; i++ ) { final NodeMatcher condition = conditions[i]; final boolean subresult = condition.matches( context, node ); if ( subresult ) { result = true; } } return result; } OrMatcher( final NodeMatcher... conditions ); }
OrMatcher implements NodeMatcher { public boolean matches( final MatcherContext context, final ReportElement node ) { boolean result = false; for ( int i = 0; i < conditions.length; i++ ) { final NodeMatcher condition = conditions[i]; final boolean subresult = condition.matches( context, node ); if ( subresult ) { result = true; } } return result; } OrMatcher( final NodeMatcher... conditions ); boolean matches( final MatcherContext context, final ReportElement node ); String toString(); }
OrMatcher implements NodeMatcher { public boolean matches( final MatcherContext context, final ReportElement node ) { boolean result = false; for ( int i = 0; i < conditions.length; i++ ) { final NodeMatcher condition = conditions[i]; final boolean subresult = condition.matches( context, node ); if ( subresult ) { result = true; } } return result; } OrMatcher( final NodeMatcher... conditions ); boolean matches( final MatcherContext context, final ReportElement node ); String toString();  }