*/
@Test
public void testValidateIndexPriorityRanges() throws Exception {
Configuration conf = new Configuration(false);
// standard configs should be fine
PhoenixIndexRpcSchedulerFactory factory = new PhoenixIndexRpcSchedulerFactory();
factory.create(conf, null);
setMinMax(conf, 0, 4);
factory.create(conf, null);
setMinMax(conf, 101, 102);
factory.create(conf, null);
setMinMax(conf, 102, 101);
try {
factory.create(conf, null);
fail("Should not have allowed max less than min");
} catch (IllegalArgumentException e) {
// expected
}
setMinMax(conf, 5, 6);
try {
factory.create(conf, null);
fail("Should not have allowed min in range");
} catch (IllegalArgumentException e) {
// expected
}
setMinMax(conf, 6, 60);
try {
factory.create(conf, null);
fail("Should not have allowed min/max in hbase range");
} catch (IllegalArgumentException e) {
// expected
}
setMinMax(conf, 6, 101);
try {
factory.create(conf, null);
fail("Should not have allowed in range");
} catch (IllegalArgumentException e) {
// expected
}
}