use of com.github.bordertech.wcomponents.WTextField 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.WTextField 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.WTextField in project wcomponents by BorderTech.
the class GroupExpression_Test method testBuildAnd.
@Test
public void testBuildAnd() {
GroupExpression expr = new GroupExpression(GroupExpression.Type.AND);
BooleanExpression operand1 = new CompareExpression(CompareType.EQUAL, new WTextField(), "1");
BooleanExpression operand2 = new CompareExpression(CompareType.EQUAL, new WTextField(), "2");
BooleanExpression operand3 = new CompareExpression(CompareType.EQUAL, new WTextField(), "3");
expr.add(operand1);
expr.add(operand2);
expr.add(operand3);
And condition = (And) expr.build();
Assert.assertEquals("Incorrect number of conditions for AND", 3, condition.getConditions().size());
Assert.assertEquals("Incorrect 1st operand for AND", operand1.build().toString(), condition.getConditions().get(0).toString());
Assert.assertEquals("Incorrect 2nd operand for AND", operand2.build().toString(), condition.getConditions().get(1).toString());
Assert.assertEquals("Incorrect 3rd operand for AND", operand3.build().toString(), condition.getConditions().get(2).toString());
}
use of com.github.bordertech.wcomponents.WTextField in project wcomponents by BorderTech.
the class HtmlRenderUtilTest method testGetEffectivePlaceholder.
@Test
public void testGetEffectivePlaceholder() {
Placeholderable field = new WTextField();
String actual = HtmlRenderUtil.getEffectivePlaceholder(field);
Assert.assertNull("Placeholder should not be set for an optional field with no explicit placeholder text", actual);
}
use of com.github.bordertech.wcomponents.WTextField in project wcomponents by BorderTech.
the class AbstractContainerHelper_Test method testGetUI.
@Test
public void testGetUI() {
AbstractContainerHelper helper = new MyContainerHelper();
WebComponent webComponent = new WTextField();
helper.setWebComponent(webComponent);
Assert.assertSame("getUI returned incorrect UI", webComponent, helper.getUI());
}
Aggregations