use of com.github.bordertech.wcomponents.WLabel in project wcomponents by BorderTech.
the class WLabelRenderer_Test method testReadOnlyWithInput.
@Test
public void testReadOnlyWithInput() throws IOException, SAXException, XpathException {
MyInput comp = new MyInput();
WLabel label = new WLabel("label", comp);
comp.setReadOnly(true);
assertSchemaMatch(label);
assertXpathEvaluatesTo("true", "//ui:label/@readonly", label);
}
use of com.github.bordertech.wcomponents.WLabel in project wcomponents by BorderTech.
the class WLabelRenderer_Test method testXssEscaping.
@Test
public void testXssEscaping() throws IOException, SAXException, XpathException {
WLabel label = new WLabel(getMaliciousContent());
assertSafeContent(label);
label.setHint(getMaliciousAttribute("ui:label"));
assertSafeContent(label);
label.setToolTip(getMaliciousAttribute("ui:label"));
assertSafeContent(label);
label.setAccessibleText(getMaliciousAttribute("ui:label"));
assertSafeContent(label);
}
use of com.github.bordertech.wcomponents.WLabel in project wcomponents by BorderTech.
the class WLabelRenderer_Test method testHidden.
@Test
public void testHidden() throws IOException, SAXException, XpathException {
MyInput comp = new MyInput();
WLabel label = new WLabel("label", comp);
label.setHidden(true);
assertSchemaMatch(label);
assertXpathEvaluatesTo("", "//ui:label/@hiddencomponent", label);
assertXpathEvaluatesTo("true", "//ui:label/@hidden", label);
}
use of com.github.bordertech.wcomponents.WLabel in project wcomponents by BorderTech.
the class WLabelRenderer_Test method testWhatForNotAnInput.
@Test
public void testWhatForNotAnInput() throws IOException, SAXException, XpathException {
MyComponent comp = new MyComponent();
WLabel label = new WLabel("label", comp);
assertXpathEvaluatesTo("", "//ui:label/@what", label);
}
use of com.github.bordertech.wcomponents.WLabel in project wcomponents by BorderTech.
the class WLabelRenderer_Test method testMandatoryWithInput.
@Test
public void testMandatoryWithInput() throws IOException, SAXException, XpathException {
MyInput comp = new MyInput();
WLabel label = new WLabel("label", comp);
comp.setMandatory(true);
assertSchemaMatch(label);
assertXpathEvaluatesTo("true", "//ui:label/@required", label);
}
Aggregations