@Test public void testReadFromDs_Exception() throws Exception { doThrow(new ReadFailedException(EXCEPTION_MESSAGE)).when(readFuture).checkedGet(); Assert.assertEquals(Optional.absent(), DataStoreHelper.readFromDs(LogicalDatastoreType.OPERATIONAL, mock(InstanceIdentifier.class), readTransaction)); }
public static <T extends DataObject> Optional<T> readFromDs(LogicalDatastoreType store, InstanceIdentifier<T> path, ReadTransaction rTx) { CheckedFuture<Optional<T>, ReadFailedException> resultFuture = rTx.read(store, path); try { return resultFuture.checkedGet(); } catch (ReadFailedException e) { LOG.warn("Read failed from DS.", e); return Optional.absent(); } }
DataStoreHelper { public static <T extends DataObject> Optional<T> readFromDs(LogicalDatastoreType store, InstanceIdentifier<T> path, ReadTransaction rTx) { CheckedFuture<Optional<T>, ReadFailedException> resultFuture = rTx.read(store, path); try { return resultFuture.checkedGet(); } catch (ReadFailedException e) { LOG.warn("Read failed from DS.", e); return Optional.absent(); } } }
DataStoreHelper { public static <T extends DataObject> Optional<T> readFromDs(LogicalDatastoreType store, InstanceIdentifier<T> path, ReadTransaction rTx) { CheckedFuture<Optional<T>, ReadFailedException> resultFuture = rTx.read(store, path); try { return resultFuture.checkedGet(); } catch (ReadFailedException e) { LOG.warn("Read failed from DS.", e); return Optional.absent(); } }  }
DataStoreHelper { public static <T extends DataObject> Optional<T> readFromDs(LogicalDatastoreType store, InstanceIdentifier<T> path, ReadTransaction rTx) { CheckedFuture<Optional<T>, ReadFailedException> resultFuture = rTx.read(store, path); try { return resultFuture.checkedGet(); } catch (ReadFailedException e) { LOG.warn("Read failed from DS.", e); return Optional.absent(); } }  static Optional<T> readFromDs(LogicalDatastoreType store, InstanceIdentifier<T> path, ReadTransaction rTx); static boolean submitToDs(WriteTransaction wTx); static Optional<T> removeIfExists(LogicalDatastoreType store, InstanceIdentifier<T> path,
            ReadWriteTransaction rwTx); }
DataStoreHelper { public static <T extends DataObject> Optional<T> readFromDs(LogicalDatastoreType store, InstanceIdentifier<T> path, ReadTransaction rTx) { CheckedFuture<Optional<T>, ReadFailedException> resultFuture = rTx.read(store, path); try { return resultFuture.checkedGet(); } catch (ReadFailedException e) { LOG.warn("Read failed from DS.", e); return Optional.absent(); } }  static Optional<T> readFromDs(LogicalDatastoreType store, InstanceIdentifier<T> path, ReadTransaction rTx); static boolean submitToDs(WriteTransaction wTx); static Optional<T> removeIfExists(LogicalDatastoreType store, InstanceIdentifier<T> path,
            ReadWriteTransaction rwTx);  }