public void testVoldemortConfigMismatchNegative() {
boolean exceptionFound = false;
Properties props = createDefaultProperties();
props.setProperty("enable.readonly.rest.hdfs", "true");
try {
VoldemortConfig config = new VoldemortConfig(props);
} catch(ConfigurationException e) {
exceptionFound = true;
}
assertTrue(exceptionFound);
exceptionFound = false;
props = createDefaultProperties();
props.setProperty("file.fetcher.class",
"voldemort.server.protocol.hadoop.RestHadoopFetcher");
try {
VoldemortConfig config = new VoldemortConfig(props);
} catch(ConfigurationException e) {
exceptionFound = true;
}
assertTrue(exceptionFound);
exceptionFound = false;
props = createDefaultProperties();
props.setProperty("enable.readonly.rest.hdfs", "true");
props.setProperty("file.fetcher.class", "voldemort.store.readonly.fetcher.HdfsFetcher");
try {
VoldemortConfig config = new VoldemortConfig(props);
} catch(ConfigurationException e) {
exceptionFound = true;
}
assertTrue(exceptionFound);
exceptionFound = false;
props = createDefaultProperties();
props.setProperty("enable.readonly.rest.hdfs", "false");
props.setProperty("file.fetcher.class",
"voldemort.server.protocol.hadoop.RestHadoopFetcher");
try {
VoldemortConfig config = new VoldemortConfig(props);
} catch(ConfigurationException e) {
exceptionFound = true;
}
assertTrue(exceptionFound);
}