public void testNesting01() throws Exception { HtmlPage page = getPage("/faces/composite/nesting01.xhtml"); List<HtmlSpan> spans = new ArrayList<HtmlSpan>(2); getAllElementsOfGivenClass(page, spans, HtmlSpan.class); assertEquals(2, spans.size()); HtmlSpan span = spans.get(0); assertEquals("Should have a value: Hello World", span.asText()); span = spans.get(1); assertEquals("Shouldn't have a value:", span.asText()); }
private void validateChildrenAndFacets(List<HtmlSpan> spans) throws Exception { String[] ids = new String[] { "form:cf:outheader2", "form:cf:outheader", "form:cf:out1", "form:cf:out2", "ccCount", "header2Facet", "header1Facet" }; String[] values = new String[] {"Rendered", "Inserted", "v1", "v2", "0", "true", "true"}; assertEquals(ids.length, spans.size()); for (int i = 0, len = ids.length; i < len; i++) { HtmlSpan span = spans.get(i); assertEquals(ids[i], span.getId()); assertEquals(values[i], span.asText()); } }
private void validateSpanContent(HtmlPage page) { List<HtmlSpan> spans = new ArrayList<HtmlSpan>(3); getAllElementsOfGivenClass(page, spans, HtmlSpan.class); HtmlSpan span = spans.get(0); assertEquals("create", span.getId()); assertEquals("Resolved", span.asText()); span = spans.get(1); assertEquals("scopeReference", span.getId()); assertEquals("Resolved", span.asText()); span = spans.get(2); assertEquals("nonCreate", span.getId()); assertEquals("Resolved", span.asText()); }