use of com.github.bordertech.wcomponents.WTabGroup in project wcomponents by BorderTech.
the class WTabGroupRenderer method doRender.
/**
* Paints the given WTabGroup.
*
* @param component the WTabGroup to paint.
* @param renderContext the RenderContext to paint to.
*/
@Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WTabGroup group = (WTabGroup) component;
paintChildren(group, renderContext);
}
use of com.github.bordertech.wcomponents.WTabGroup in project wcomponents by BorderTech.
the class WTabGroupRenderer_Test method testDoPaint.
@Test
public void testDoPaint() throws IOException, SAXException, XpathException {
String groupName = "WTabGroupRenderer_Test.testDoPaint.groupName";
WTabGroup tabGroup = new WTabGroup(groupName);
WComponent wrapped = wrapTabGroup(tabGroup);
assertXpathNotExists("//ui:tab", wrapped);
tabGroup.addTab(new WText("dummy"), "dummy", TabMode.CLIENT);
assertXpathExists("//ui:tab", wrapped);
assertSchemaMatch(wrapped);
}
use of com.github.bordertech.wcomponents.WTabGroup in project wcomponents by BorderTech.
the class WTabGroupRenderer_Test method testRendererCorrectlyConfigured.
@Test
public void testRendererCorrectlyConfigured() {
WTabGroup tabGroup = new WTabGroup("");
Assert.assertTrue("Incorrect renderer supplied", getWebXmlRenderer(tabGroup) instanceof WTabGroupRenderer);
}
use of com.github.bordertech.wcomponents.WTabGroup in project wcomponents by BorderTech.
the class WTabGroupRenderer_Test method testXssEscaping.
@Test
public void testXssEscaping() throws IOException, SAXException, XpathException {
WTabGroup tabGroup = new WTabGroup(getMaliciousContent());
tabGroup.addTab(new WText("dummy"), "dummy", TabMode.CLIENT);
WComponent wrapped = wrapTabGroup(tabGroup);
assertSafeContent(wrapped);
tabGroup.setToolTip(getMaliciousAttribute("ui:tab"));
assertSafeContent(wrapped);
tabGroup.setAccessibleText(getMaliciousAttribute("ui:tab"));
assertSafeContent(wrapped);
}
Aggregations