use of com.github.bordertech.wcomponents.WTextArea in project wcomponents by BorderTech.
the class ExpressionBuilder_Test method testAndOperatorPrecedenceLHS.
/**
* Tests for correct operator precedence when there is an AND on the left-hand side of the OR: a
* {@literal &}{@literal &} b || c.
*/
@Test
public void testAndOperatorPrecedenceLHS() {
builder.equals(new WTextField(), "1").and().equals(new WTextArea(), "2").or().equals(new WDropdown(), "3");
Assert.assertEquals("Incorrect condition", "((WTextField=\"1\" and WTextArea=\"2\") or WDropdown=\"3\")", builder.build().toString());
}
use of com.github.bordertech.wcomponents.WTextArea in project wcomponents by BorderTech.
the class ExpressionBuilder_Test method testNotWithAndCondition.
/**
* Test Not with And condition.
*/
@Test
public void testNotWithAndCondition() {
builder.equals(new WTextField(), "1").and().not(new ExpressionBuilder().equals(new WTextArea(), "2")).or().not(new ExpressionBuilder().equals(new WTextArea(), "2")).and().equals(new WDropdown(), "3");
Assert.assertEquals("Incorrect condition", "((WTextField=\"1\" and NOT (WTextArea=\"2\")) or (NOT (WTextArea=\"2\") and WDropdown=\"3\"))", builder.build().toString());
}
use of com.github.bordertech.wcomponents.WTextArea in project wcomponents by BorderTech.
the class ExpressionBuilder_Test method testThreeArgAndCondition.
@Test
public void testThreeArgAndCondition() {
builder.equals(new WTextField(), "1").and().equals(new WTextArea(), "2").and().equals(new WDropdown(), "3");
Assert.assertEquals("Incorrect condition", "(WTextField=\"1\" and WTextArea=\"2\" and WDropdown=\"3\")", builder.build().toString());
}
use of com.github.bordertech.wcomponents.WTextArea in project wcomponents by BorderTech.
the class WTextAreaRenderer_Test method testReadOnly.
@Test
public void testReadOnly() throws IOException, SAXException, XpathException {
WTextArea field = new WTextArea();
field.setReadOnly(true);
assertSchemaMatch(field);
assertXpathEvaluatesTo("true", "//ui:textarea/@readOnly", field);
}
use of com.github.bordertech.wcomponents.WTextArea in project wcomponents by BorderTech.
the class WTextAreaRenderer_Test method testXssEscaping.
@Test
public void testXssEscaping() throws IOException, SAXException, XpathException {
WTextArea textArea = new WTextArea();
textArea.setText(getMaliciousContent());
assertSafeContent(textArea);
textArea.setToolTip(getMaliciousAttribute("ui:textarea"));
assertSafeContent(textArea);
textArea.setAccessibleText(getMaliciousAttribute("ui:textarea"));
assertSafeContent(textArea);
}
Aggregations