public class setValue
implements Testlet
{
public void test(TestHarness harness)
{
DefaultBoundedRangeModel dbrm = new DefaultBoundedRangeModel();
// Check #1: Value between min and max.
dbrm.setRangeProperties(1, 1, 0, 10, false);
dbrm.setValue(5);
setRangeProperties.check(harness, dbrm, 5, 1, 0, 10, false);
// Check #2: Value < min.
dbrm.setRangeProperties(4, 1, 3, 10, false);
dbrm.setValue(-5);
setRangeProperties.check(harness, dbrm, 3, 1, 3, 10, false);
// Check #3: Value > max.
dbrm.setRangeProperties(4, 0, 3, 10, false);
dbrm.setValue(140);
setRangeProperties.check(harness, dbrm, 10, 0, 3, 10, false);
// Check #4: Value + extent > max.
dbrm.setRangeProperties(4, 4, 3, 10, false);
dbrm.setValue(9);
setRangeProperties.check(harness, dbrm, 6, 4, 3, 10, false);
}