@Test public void or() { Element control = doc.createElement(FOO); Element test = doc.createElement(BAR); assertFalse(ElementSelectors.or(ElementSelectors.byName) .canBeCompared(control, test)); assertTrue(ElementSelectors.or(ElementSelectors.byName, ElementSelectors.Default) .canBeCompared(control, test)); }
public static ElementSelector or(final ElementSelector... selectors) { if (selectors == null) { throw new IllegalArgumentException(SELECTORS_MUST_NOT_BE_NULL); } final Collection<ElementSelector> s = Arrays.asList(selectors); if (any(s, new IsNullPredicate())) { throw new IllegalArgumentException("selectors must not contain null values"); } return new ElementSelector() { @Override public boolean canBeCompared(Element controlElement, Element testElement) { return any(s, new CanBeComparedPredicate(controlElement, testElement)); } }; }
ElementSelectors { public static ElementSelector or(final ElementSelector... selectors) { if (selectors == null) { throw new IllegalArgumentException(SELECTORS_MUST_NOT_BE_NULL); } final Collection<ElementSelector> s = Arrays.asList(selectors); if (any(s, new IsNullPredicate())) { throw new IllegalArgumentException("selectors must not contain null values"); } return new ElementSelector() { @Override public boolean canBeCompared(Element controlElement, Element testElement) { return any(s, new CanBeComparedPredicate(controlElement, testElement)); } }; } }
ElementSelectors { public static ElementSelector or(final ElementSelector... selectors) { if (selectors == null) { throw new IllegalArgumentException(SELECTORS_MUST_NOT_BE_NULL); } final Collection<ElementSelector> s = Arrays.asList(selectors); if (any(s, new IsNullPredicate())) { throw new IllegalArgumentException("selectors must not contain null values"); } return new ElementSelector() { @Override public boolean canBeCompared(Element controlElement, Element testElement) { return any(s, new CanBeComparedPredicate(controlElement, testElement)); } }; } private  ElementSelectors(); }
ElementSelectors { public static ElementSelector or(final ElementSelector... selectors) { if (selectors == null) { throw new IllegalArgumentException(SELECTORS_MUST_NOT_BE_NULL); } final Collection<ElementSelector> s = Arrays.asList(selectors); if (any(s, new IsNullPredicate())) { throw new IllegalArgumentException("selectors must not contain null values"); } return new ElementSelector() { @Override public boolean canBeCompared(Element controlElement, Element testElement) { return any(s, new CanBeComparedPredicate(controlElement, testElement)); } }; } private  ElementSelectors(); static ElementSelector byNameAndAttributes(String... attribs); static ElementSelector byNameAndAttributesControlNS(final String... attribs); static ElementSelector byNameAndAttributes(final QName... attribs); static ElementSelector not(final ElementSelector es); static ElementSelector or(final ElementSelector... selectors); static ElementSelector and(final ElementSelector... selectors); static ElementSelector xor(final ElementSelector es1,
                                      final ElementSelector es2); static ElementSelector conditionalSelector(final Predicate<? super Element> predicate,
                                                      final ElementSelector es); static ElementSelector selectorForElementNamed(final String expectedName,
                                                          final ElementSelector es); static ElementSelector selectorForElementNamed(final QName expectedName,
                                                          final ElementSelector es); static ElementSelector byXPath(String xpath, ElementSelector childSelector); static ElementSelector byXPath(final String xpath,
                                          Map<String, String> prefix2Uri,
                                          ElementSelector childSelector); static ConditionalSelectorBuilder conditionalBuilder(); }
ElementSelectors { public static ElementSelector or(final ElementSelector... selectors) { if (selectors == null) { throw new IllegalArgumentException(SELECTORS_MUST_NOT_BE_NULL); } final Collection<ElementSelector> s = Arrays.asList(selectors); if (any(s, new IsNullPredicate())) { throw new IllegalArgumentException("selectors must not contain null values"); } return new ElementSelector() { @Override public boolean canBeCompared(Element controlElement, Element testElement) { return any(s, new CanBeComparedPredicate(controlElement, testElement)); } }; } private  ElementSelectors(); static ElementSelector byNameAndAttributes(String... attribs); static ElementSelector byNameAndAttributesControlNS(final String... attribs); static ElementSelector byNameAndAttributes(final QName... attribs); static ElementSelector not(final ElementSelector es); static ElementSelector or(final ElementSelector... selectors); static ElementSelector and(final ElementSelector... selectors); static ElementSelector xor(final ElementSelector es1,
                                      final ElementSelector es2); static ElementSelector conditionalSelector(final Predicate<? super Element> predicate,
                                                      final ElementSelector es); static ElementSelector selectorForElementNamed(final String expectedName,
                                                          final ElementSelector es); static ElementSelector selectorForElementNamed(final QName expectedName,
                                                          final ElementSelector es); static ElementSelector byXPath(String xpath, ElementSelector childSelector); static ElementSelector byXPath(final String xpath,
                                          Map<String, String> prefix2Uri,
                                          ElementSelector childSelector); static ConditionalSelectorBuilder conditionalBuilder(); static final ElementSelector Default; static final ElementSelector byName; static final ElementSelector byNameAndText; static final ElementSelector byNameAndAllAttributes; }