endTransaction();
// ----------------------------------------------------------------------
startNewTransaction();
// create a new store
CoverageStoreInfo store = catalog.getFactory().createCoverageStore();
store.setWorkspace(ws);
store.setName("coverageStore");
store.setDescription("store description");
store.setEnabled(true);
store.setType("type");
store.setURL("url");
store.getMetadata().put("1", "one");
store.getMetadata().put("2", new Double(2.0));
catalog.add(store);
endTransaction();
// Logging.getLogger(this.getClass()).warning("##################### id:" + store.getId() +
// " name:"+store.getName() );
// ----------------------------------------------------------------------
startNewTransaction();
List<CoverageStoreInfo> stores = catalog.getCoverageStores();
// for (CoverageStoreInfo storex : stores) {
// Logging.getLogger(this.getClass()).warning(":::::::::: id:" + storex.getId() +
// " name:"+storex.getName() );
// }
assertEquals(1, stores.size());
// Logging.getLogger(this.getClass()).warning("::::::::::::::::::::: id:" +
// stores.get(0).getId() + " name:"+stores.get(0).getName() );
CoverageStoreInfo loadedStore = catalog.getCoverageStore(store.getId());
assertNotNull("Store " + store.getId() + " was not persisted properly.", loadedStore);
assertEquals("coverageStore", loadedStore.getName());
assertEquals("store description", loadedStore.getDescription());
assertTrue(loadedStore.isEnabled());
assertEquals("type", loadedStore.getType());
assertEquals("url", loadedStore.getURL());
assertEquals("one", loadedStore.getMetadata().get("1"));
assertEquals(new Double(2.0), loadedStore.getMetadata().get("2"));
}