use of com.github.bordertech.wcomponents.WMultiTextField in project wcomponents by BorderTech.
the class WMultiTextFieldRenderer_Test method testXssEscaping.
@Test
public void testXssEscaping() throws IOException, SAXException, XpathException {
WMultiTextField field = new WMultiTextField();
field.setTextInputs(new String[] { getInvalidCharSequence(), getMaliciousContent() });
assertSafeContent(field);
field.setToolTip(getMaliciousAttribute("ui:multitextfield"));
assertSafeContent(field);
field.setAccessibleText(getMaliciousAttribute("ui:multitextfield"));
assertSafeContent(field);
}
use of com.github.bordertech.wcomponents.WMultiTextField in project wcomponents by BorderTech.
the class WMultiTextFieldRenderer_Test method testDoPaint.
@Test
public void testDoPaint() throws IOException, SAXException, XpathException {
WMultiTextField wmtf = new WMultiTextField();
assertSchemaMatch(wmtf);
assertXpathEvaluatesTo("0", "count(//ui:multitextfield/ui:value)", wmtf);
wmtf.setTextInputs(new String[] { "a", "b" });
assertXpathEvaluatesTo("2", "count(//ui:multitextfield/ui:value)", wmtf);
assertXpathEvaluatesTo("a", "normalize-space(//ui:multitextfield/ui:value[position()=1])", wmtf);
assertXpathEvaluatesTo("b", "normalize-space(//ui:multitextfield/ui:value[position()=2])", wmtf);
}
Aggregations