use of com.github.bordertech.wcomponents.SubordinateTarget in project wcomponents by BorderTech.
the class AbstractSetMandatory_Test method testConstructor.
@Test
public void testConstructor() {
SubordinateTarget target = new MyTarget();
Boolean value = Boolean.TRUE;
// Constructor - 1
AbstractSetMandatory mandatory = new MyMandatory(target, value);
Assert.assertEquals("Incorrect target returned", target, mandatory.getTarget());
Assert.assertEquals("Incorrect value returned", value, mandatory.getValue());
}
use of com.github.bordertech.wcomponents.SubordinateTarget in project wcomponents by BorderTech.
the class DisableInGroup_Test method testConstructor.
@Test
public void testConstructor() {
SubordinateTarget target = new MyTarget();
WComponentGroup<SubordinateTarget> group = new WComponentGroup<>();
DisableInGroup action = new DisableInGroup(target, group);
Assert.assertEquals("Value for DisableIn should be true", Boolean.TRUE, action.getValue());
Assert.assertEquals("Target for DisableIn should be the group", group, action.getTarget());
Assert.assertEquals("TargetInGroup for DisableIn should be the target", target, action.getTargetInGroup());
}
use of com.github.bordertech.wcomponents.SubordinateTarget in project wcomponents by BorderTech.
the class DisableInGroup_Test method testToString.
@Test
public void testToString() {
SubordinateTarget target1 = new MyTarget();
SubordinateTarget target2 = new MyTarget();
SubordinateTarget target3 = new MyTarget();
WComponentGroup<SubordinateTarget> group = new WComponentGroup<>();
group.addToGroup(target1);
group.addToGroup(target2);
group.addToGroup(target3);
DisableInGroup action = new DisableInGroup(target2, group);
Assert.assertEquals("Incorrect toString for action", "disable MyTarget in WComponentGroup([MyTarget, MyTarget, MyTarget])", action.toString());
new WLabel("test label", target2);
Assert.assertEquals("Incorrect toString for action with a label", "disable test label in WComponentGroup([MyTarget, MyTarget, MyTarget])", action.toString());
}
use of com.github.bordertech.wcomponents.SubordinateTarget in project wcomponents by BorderTech.
the class Disable_Test method testConstructor.
@Test
public void testConstructor() {
SubordinateTarget target = new MyTarget();
Disable action = new Disable(target);
Assert.assertEquals("Value for Disable should be false", Boolean.FALSE, action.getValue());
Assert.assertEquals("Target for Disable should be the target", target, action.getTarget());
}
use of com.github.bordertech.wcomponents.SubordinateTarget in project wcomponents by BorderTech.
the class EnableInGroup_Test method testActionType.
@Test
public void testActionType() {
SubordinateTarget target = new WTextField();
WComponentGroup<SubordinateTarget> group = new WComponentGroup<>();
group.addToGroup(target);
EnableInGroup action = new EnableInGroup(target, group);
Assert.assertEquals("Incorrect Action Type", action.getActionType(), AbstractAction.ActionType.ENABLEIN);
}
Aggregations