@Test(expected = RepositoryException.class) public void testDeleteExclusionAccesorThrowsException() { Mockito.doThrow(new RuntimeException("RuntimeExcp")).when(accessor) .deleteExclusion(base.getRawID(), pair.getRawID()); repository.deleteExclusion(base, pair); }
@Override public void deleteExclusion(Experiment.ID base, Experiment.ID pair) throws RepositoryException { LOGGER.debug("Deleting exclusions for base {} pair {}", new Object[]{base, pair}); try { BatchStatement batchStatement = new BatchStatement(); batchStatement.add(mutexAccessor.deleteExclusion(base.getRawID(), pair.getRawID())); batchStatement.add(mutexAccessor.deleteExclusion(pair.getRawID(), base.getRawID())); session.execute(batchStatement); } catch (Exception e) { LOGGER.error("Error while deleting exclusions for base {} pair {}", new Object[]{base, pair}, e); throw new RepositoryException("Could not delete the exclusion \"" + base + "\", \"" + pair + "\"", e); } }
CassandraMutexRepository implements MutexRepository { @Override public void deleteExclusion(Experiment.ID base, Experiment.ID pair) throws RepositoryException { LOGGER.debug("Deleting exclusions for base {} pair {}", new Object[]{base, pair}); try { BatchStatement batchStatement = new BatchStatement(); batchStatement.add(mutexAccessor.deleteExclusion(base.getRawID(), pair.getRawID())); batchStatement.add(mutexAccessor.deleteExclusion(pair.getRawID(), base.getRawID())); session.execute(batchStatement); } catch (Exception e) { LOGGER.error("Error while deleting exclusions for base {} pair {}", new Object[]{base, pair}, e); throw new RepositoryException("Could not delete the exclusion \"" + base + "\", \"" + pair + "\"", e); } } }
CassandraMutexRepository implements MutexRepository { @Override public void deleteExclusion(Experiment.ID base, Experiment.ID pair) throws RepositoryException { LOGGER.debug("Deleting exclusions for base {} pair {}", new Object[]{base, pair}); try { BatchStatement batchStatement = new BatchStatement(); batchStatement.add(mutexAccessor.deleteExclusion(base.getRawID(), pair.getRawID())); batchStatement.add(mutexAccessor.deleteExclusion(pair.getRawID(), base.getRawID())); session.execute(batchStatement); } catch (Exception e) { LOGGER.error("Error while deleting exclusions for base {} pair {}", new Object[]{base, pair}, e); throw new RepositoryException("Could not delete the exclusion \"" + base + "\", \"" + pair + "\"", e); } } @Inject  CassandraMutexRepository(
            ExperimentAccessor experimentAccessor,
            ExclusionAccessor mutexAccessor,
            CassandraDriver driver); }
CassandraMutexRepository implements MutexRepository { @Override public void deleteExclusion(Experiment.ID base, Experiment.ID pair) throws RepositoryException { LOGGER.debug("Deleting exclusions for base {} pair {}", new Object[]{base, pair}); try { BatchStatement batchStatement = new BatchStatement(); batchStatement.add(mutexAccessor.deleteExclusion(base.getRawID(), pair.getRawID())); batchStatement.add(mutexAccessor.deleteExclusion(pair.getRawID(), base.getRawID())); session.execute(batchStatement); } catch (Exception e) { LOGGER.error("Error while deleting exclusions for base {} pair {}", new Object[]{base, pair}, e); throw new RepositoryException("Could not delete the exclusion \"" + base + "\", \"" + pair + "\"", e); } } @Inject  CassandraMutexRepository(
            ExperimentAccessor experimentAccessor,
            ExclusionAccessor mutexAccessor,
            CassandraDriver driver); @Override List<Experiment.ID> getExclusionList(Experiment.ID experimentID); @Override void deleteExclusion(Experiment.ID base, Experiment.ID pair); @Override void createExclusion(Experiment.ID baseID, Experiment.ID pairID); @Override ExperimentList getExclusions(Experiment.ID base); @Override ExperimentList getNotExclusions(Experiment.ID base); @Override Map<Experiment.ID, List<Experiment.ID>> getExclusivesList(Collection<Experiment.ID> experimentIds); }
CassandraMutexRepository implements MutexRepository { @Override public void deleteExclusion(Experiment.ID base, Experiment.ID pair) throws RepositoryException { LOGGER.debug("Deleting exclusions for base {} pair {}", new Object[]{base, pair}); try { BatchStatement batchStatement = new BatchStatement(); batchStatement.add(mutexAccessor.deleteExclusion(base.getRawID(), pair.getRawID())); batchStatement.add(mutexAccessor.deleteExclusion(pair.getRawID(), base.getRawID())); session.execute(batchStatement); } catch (Exception e) { LOGGER.error("Error while deleting exclusions for base {} pair {}", new Object[]{base, pair}, e); throw new RepositoryException("Could not delete the exclusion \"" + base + "\", \"" + pair + "\"", e); } } @Inject  CassandraMutexRepository(
            ExperimentAccessor experimentAccessor,
            ExclusionAccessor mutexAccessor,
            CassandraDriver driver); @Override List<Experiment.ID> getExclusionList(Experiment.ID experimentID); @Override void deleteExclusion(Experiment.ID base, Experiment.ID pair); @Override void createExclusion(Experiment.ID baseID, Experiment.ID pairID); @Override ExperimentList getExclusions(Experiment.ID base); @Override ExperimentList getNotExclusions(Experiment.ID base); @Override Map<Experiment.ID, List<Experiment.ID>> getExclusivesList(Collection<Experiment.ID> experimentIds);  }