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