use of com.github.bordertech.wcomponents.WText in project wcomponents by BorderTech.
the class WTextRenderer_Test method testDoPaintWhenEmpty.
@Test
public void testDoPaintWhenEmpty() throws IOException, SAXException, XpathException {
WText text = new WText();
String xml = toXHtml(text);
Assert.assertEquals("Text output should be empty by default", "", xml);
}
use of com.github.bordertech.wcomponents.WText in project wcomponents by BorderTech.
the class WTextRenderer_Test method testXssEscaping.
@Test
public void testXssEscaping() throws IOException, SAXException, XpathException {
WText text = new WText();
text.setText(getInvalidCharSequence());
assertSafeContent(text);
text.setText(getMaliciousContent());
assertSafeContent(text);
}
use of com.github.bordertech.wcomponents.WText in project wcomponents by BorderTech.
the class WTextRenderer_Test method testRendererCorrectlyConfigured.
@Test
public void testRendererCorrectlyConfigured() {
WText text = new WText();
Assert.assertTrue("Incorrect renderer supplied", getWebXmlRenderer(text) instanceof WTextRenderer);
}
use of com.github.bordertech.wcomponents.WText in project wcomponents by BorderTech.
the class WCollapsibleRenderer_Test method testXssEscaping.
@Test
public void testXssEscaping() throws IOException, SAXException, XpathException {
WCollapsible collapsible = new WCollapsible(new WText("dummy"), getMaliciousContent(), WCollapsible.CollapsibleMode.CLIENT);
assertSafeContent(collapsible);
}
use of com.github.bordertech.wcomponents.WText in project wcomponents by BorderTech.
the class WCollapsibleRenderer_Test method testRendererCorrectlyConfigured.
@Test
public void testRendererCorrectlyConfigured() {
WCollapsible collapsible = new WCollapsible(new WText(), "");
Assert.assertTrue("Incorrect renderer supplied", getWebXmlRenderer(collapsible) instanceof WCollapsibleRenderer);
}
Aggregations