public void testStoreConfig() throws Exception {
File dir = FileUtils.getTestDir(getClass().getSimpleName());
StoreConfig config;
DynamicDataStore store;
config = new StoreConfig(dir, 10000);
config.setSegmentFileSizeMB(32);
assertTrue(config.getDataHandler() == null);
config.setDataHandler(createDataStoreHandler());
assertTrue(config.getDataHandler() != null);
byte[] key = "key".getBytes();
byte[] value = randomValue();
store = new DynamicDataStore(config);
store.put(key, value);
assertTrue(Arrays.equals(value, store.get(key)));
store.close();
StoreConfig config2 = StoreConfig.newInstance(dir);
assertTrue(config2.getDataHandler() != null);
assertEquals(config.getDataHandler().getClass(), config2.getDataHandler().getClass());
store = new DynamicDataStore(config2);
assertTrue(Arrays.equals(value, store.get(key)));
store.close();
FileUtils.deleteDirectory(dir);
}