@Override public void close() throws IOException { if (dataStore != null) { try { dataStore.close(); } catch (DataStoreException e) { throw new IOException(e); } } }
@Override public void close() throws IOException { if (dataStore != null) { try { dataStore.close(); } catch (DataStoreException e) { throw new IOException(e); } } }
@Override public void close() throws IOException { if (dataStore != null) { try { dataStore.close(); } catch (DataStoreException e) { throw new IOException(e); } } }
@Override public void close() throws IOException { closer.close(); try { blobStore.close(); } catch (DataStoreException e) { throw new IOException(e); } } }
@Override public void close() throws IOException { closer.close(); try { blobStore.close(); } catch (DataStoreException e) { throw new IOException(e); } } }
protected void deactivate() throws DataStoreException { if (reg != null) { reg.unregister(); } if (mbeanReg != null){ mbeanReg.unregister(); } dataStore.close(); }
protected void deactivate() throws DataStoreException { if (reg != null) { reg.unregister(); } if (mbeanReg != null){ mbeanReg.unregister(); } dataStore.close(); }
@Override public void tearDown() { if (blobStore instanceof DataStoreBlobStore) { try { ((DataStoreBlobStore) blobStore).close(); cleanup(storeDir, config, unique.toLowerCase()); } catch (Exception e) { throw new RuntimeException(e); } } }
protected void deactivate() throws DataStoreException { if (reg != null) { reg.unregister(); } if (mbeanReg != null){ mbeanReg.unregister(); } dataStore.close(); }
@Override public void tearDown() { if (blobStore instanceof DataStoreBlobStore) { try { ((DataStoreBlobStore) blobStore).close(); cleanup(storeDir, config, unique.toLowerCase()); } catch (Exception e) { throw new RuntimeException(e); } } }
@Override protected void after() { try { store.close(); } catch (DataStoreException e) { throw new IllegalStateException(e); } }
@After public void closeBlobStore() throws Exception { if (blobStore != null) { blobStore.close(); } }
@Test public void testMissingOpParams() throws Exception { setupDataStore.close(); File dump = temporaryFolder.newFolder(); List<String> argsList = Lists .newArrayList("--" + dsOption, cfgFilePath, "--store", storePath, "--dump", dump.getAbsolutePath()); log.info("Running testMissinOpParams: {}", argsList); testIncorrectParams(argsList, Lists.newArrayList("Missing required option(s)", "id", "ref", "consistency")); }
@Test public void testConsistencyNoRepo() throws Exception { setupDataStore.close(); File dump = temporaryFolder.newFolder(); List<String> argsList = Lists .newArrayList("--id", "--ref", "--consistency", "--store", storePath, "--dump", dump.getAbsolutePath()); testIncorrectParams(argsList, Lists.newArrayList("Missing required option(s) [repoHome]")); }
@Test public void testTrackNoRepo() throws Exception { setupDataStore.close(); File dump = temporaryFolder.newFolder(); List<String> argsList = Lists .newArrayList("--id", "--ref", "--consistency", "--store", storePath, "--dump", dump.getAbsolutePath(), "--track"); testIncorrectParams(argsList, Lists.newArrayList("Missing required option(s) [repoHome]")); }
@Test public void testTarNoDS() throws Exception { setupDataStore.close(); File dump = temporaryFolder.newFolder(); List<String> argsList = Lists .newArrayList("--id", "--ref", "--consistency", "--store", storePath, "--dump", dump.getAbsolutePath(), "--repoHome", temporaryFolder.newFolder().getAbsolutePath()); testIncorrectParams(argsList, Lists.newArrayList("Operation not defined for SegmentNodeStore without external datastore")); }
@Test public void testTrackWithRefs() throws Exception { setupDataStore.close(); File dump = temporaryFolder.newFolder(); List<String> argsList = Lists .newArrayList("--ref", "--store", storePath, "--dump", dump.getAbsolutePath(), "--track", "--repoHome", temporaryFolder.newFolder().getAbsolutePath()); testIncorrectParams(argsList, Lists.newArrayList("Option(s) [track] are unavailable given other options on the command line")); }
@Test public void testOpNoStore() throws Exception { setupDataStore.close(); File dump = temporaryFolder.newFolder(); List<String> argsList = Lists .newArrayList("--consistency", "--" + dsOption, cfgFilePath, "--dump", dump.getAbsolutePath(), "--repoHome", temporaryFolder.newFolder().getAbsolutePath()); testIncorrectParams(argsList, Lists.newArrayList("Missing required option(s) [store]")); argsList = Lists .newArrayList("--ref", "--" + dsOption, cfgFilePath, "--dump", dump.getAbsolutePath(), "--repoHome", temporaryFolder.newFolder().getAbsolutePath()); testIncorrectParams(argsList, Lists.newArrayList("Missing required option(s) [store]")); }
public void close() throws IOException { new ExecutorCloser(scheduler).close(); tracker.close(); try { ((DataStoreBlobStore) dataStore).close(); } catch (DataStoreException e) { log.warn("Error closing blobstore", e); } } }
@Test public void testCorrect() throws Exception { File dump = temporaryFolder.newFolder(); File repoHome = temporaryFolder.newFolder(); setupDataStore.close(); testAllParams(dump, repoHome); }