use of com.github.bordertech.wcomponents.WFigure in project wcomponents by BorderTech.
the class WFigureRenderer_Test method testRenderedLazyMode.
@Test
public void testRenderedLazyMode() throws IOException, SAXException, XpathException {
WFigure figure = new WFigure(new WText(FIGURE_CONTENT), FIGURE_HEADING);
figure.setMode(FigureMode.LAZY);
// Content NOT Hidden
assertSchemaMatch(figure);
// If not hidden, then the figure's content should be rendered
assertXpathEvaluatesTo("", "//ui:figure/@type", figure);
assertXpathEvaluatesTo("", "//ui:figure/@hidden", figure);
assertXpathEvaluatesTo("lazy", "//ui:figure/@mode", figure);
assertXpathEvaluatesTo(FIGURE_CONTENT, "//ui:figure/ui:content", figure);
// Content Hidden
// Create User Context with UI component
UIContext uic = createUIContext();
uic.setUI(new DefaultWComponent());
setActiveContext(uic);
setFlag(figure, ComponentModel.HIDE_FLAG, true);
assertSchemaMatch(figure);
// If hidden, then the figure's content should NOT be rendered
assertXpathEvaluatesTo("", "//ui:figure/@type", figure);
assertXpathEvaluatesTo("true", "//ui:figure/@hidden", figure);
assertXpathEvaluatesTo("lazy", "//ui:figure/@mode", figure);
assertXpathEvaluatesTo("", "//ui:figure/ui:content", figure);
}
Aggregations