@Test public void testFindElementsByAttribute() { ReportElement element = mock( ReportElement.class ); ReportAttributeMap<String> map = mock( ReportAttributeMap.class ); doReturn( map ).when( element ).getAttributes(); doReturn( "attr" ).when( map ).getAttribute( "test_namespace", "test_name" ); ReportElement[] elems = ReportStructureMatcher.findElementsByAttribute( element, "test_namespace", "test_name" ); assertThat( elems.length, is( equalTo( 1 ) ) ); assertThat( elems[0], is( equalTo( (ReportElement) element ) ) ); }
public static ReportElement[] findElementsByAttribute( final ReportElement section, final String ns, final String name ) { return findElementsByAttribute( section, ns, name, null ); }
ReportStructureMatcher { public static ReportElement[] findElementsByAttribute( final ReportElement section, final String ns, final String name ) { return findElementsByAttribute( section, ns, name, null ); } }
ReportStructureMatcher { public static ReportElement[] findElementsByAttribute( final ReportElement section, final String ns, final String name ) { return findElementsByAttribute( section, ns, name, null ); }  }
ReportStructureMatcher { public static ReportElement[] findElementsByAttribute( final ReportElement section, final String ns, final String name ) { return findElementsByAttribute( section, ns, name, null ); }  static NodeMatcher parse( final String s ); static ReportElement match( final MatcherContext context, final ReportElement base, final NodeMatcher parse ); static ReportElement[] matchAll( final MatcherContext context, final ReportElement base,
      final NodeMatcher parse ); static ReportElement match( final MatcherContext context, final ReportElement base, final String selector ); static ReportElement[] matchAll( final MatcherContext context, final ReportElement base, final String selector ); static ReportElement[] findElementsByName( final ReportElement section, final String name ); static ReportElement[] findElementsByAttribute( final ReportElement section, final String ns, final String name ); static ReportElement[] findElementsByAttribute( final ReportElement section, final String ns,
      final String name, final Object value ); static ReportElement[] findElementsByType( final ReportElement section, final ElementType type ); static ReportElement findElementByType( final Element element, final ElementType type ); }
ReportStructureMatcher { public static ReportElement[] findElementsByAttribute( final ReportElement section, final String ns, final String name ) { return findElementsByAttribute( section, ns, name, null ); }  static NodeMatcher parse( final String s ); static ReportElement match( final MatcherContext context, final ReportElement base, final NodeMatcher parse ); static ReportElement[] matchAll( final MatcherContext context, final ReportElement base,
      final NodeMatcher parse ); static ReportElement match( final MatcherContext context, final ReportElement base, final String selector ); static ReportElement[] matchAll( final MatcherContext context, final ReportElement base, final String selector ); static ReportElement[] findElementsByName( final ReportElement section, final String name ); static ReportElement[] findElementsByAttribute( final ReportElement section, final String ns, final String name ); static ReportElement[] findElementsByAttribute( final ReportElement section, final String ns,
      final String name, final Object value ); static ReportElement[] findElementsByType( final ReportElement section, final ElementType type ); static ReportElement findElementByType( final Element element, final ElementType type );  }