@SuppressWarnings({"checkstyle:IllegalThrows", "checkstyle:avoidHidingCauseException" }) @Test(expected = ReadFailedException.class) public void readTestWithNullException() throws Throwable { doReturn(null).when(DATA_TREE_MODIFICATION).readNode(YangInstanceIdentifier.empty()); try { snapshotBackedReadWriteTransaction.read(YangInstanceIdentifier.empty()).get(); fail("Expected ReadFailedException"); } catch (ExecutionException e) { throw e.getCause(); } }
@SuppressWarnings("checkstyle:IllegalCatch") @Override public FluentFuture<Optional<NormalizedNode<?,?>>> read(final YangInstanceIdentifier path) { LOG.debug("Tx: {} Read: {}", getIdentifier(), path); requireNonNull(path, "Path must not be null."); final Optional<NormalizedNode<?, ?>> result; try { result = readSnapshotNode(path); } catch (Exception e) { LOG.error("Tx: {} Failed Read of {}", getIdentifier(), path, e); return FluentFutures.immediateFailedFluentFuture(new ReadFailedException("Read failed", e)); } if (result == null) { return FluentFutures.immediateFailedFluentFuture(new ReadFailedException("Transaction is closed")); } return FluentFutures.immediateFluentFuture(result); }
SnapshotBackedReadWriteTransaction extends
        SnapshotBackedWriteTransaction<T> implements DOMStoreReadWriteTransaction { @SuppressWarnings("checkstyle:IllegalCatch") @Override public FluentFuture<Optional<NormalizedNode<?,?>>> read(final YangInstanceIdentifier path) { LOG.debug("Tx: {} Read: {}", getIdentifier(), path); requireNonNull(path, "Path must not be null."); final Optional<NormalizedNode<?, ?>> result; try { result = readSnapshotNode(path); } catch (Exception e) { LOG.error("Tx: {} Failed Read of {}", getIdentifier(), path, e); return FluentFutures.immediateFailedFluentFuture(new ReadFailedException("Read failed", e)); } if (result == null) { return FluentFutures.immediateFailedFluentFuture(new ReadFailedException("Transaction is closed")); } return FluentFutures.immediateFluentFuture(result); } }
SnapshotBackedReadWriteTransaction extends
        SnapshotBackedWriteTransaction<T> implements DOMStoreReadWriteTransaction { @SuppressWarnings("checkstyle:IllegalCatch") @Override public FluentFuture<Optional<NormalizedNode<?,?>>> read(final YangInstanceIdentifier path) { LOG.debug("Tx: {} Read: {}", getIdentifier(), path); requireNonNull(path, "Path must not be null."); final Optional<NormalizedNode<?, ?>> result; try { result = readSnapshotNode(path); } catch (Exception e) { LOG.error("Tx: {} Failed Read of {}", getIdentifier(), path, e); return FluentFutures.immediateFailedFluentFuture(new ReadFailedException("Read failed", e)); } if (result == null) { return FluentFutures.immediateFailedFluentFuture(new ReadFailedException("Transaction is closed")); } return FluentFutures.immediateFluentFuture(result); } SnapshotBackedReadWriteTransaction(final T identifier, final boolean debug,
            final DataTreeSnapshot snapshot, final TransactionReadyPrototype<T> readyImpl); }
SnapshotBackedReadWriteTransaction extends
        SnapshotBackedWriteTransaction<T> implements DOMStoreReadWriteTransaction { @SuppressWarnings("checkstyle:IllegalCatch") @Override public FluentFuture<Optional<NormalizedNode<?,?>>> read(final YangInstanceIdentifier path) { LOG.debug("Tx: {} Read: {}", getIdentifier(), path); requireNonNull(path, "Path must not be null."); final Optional<NormalizedNode<?, ?>> result; try { result = readSnapshotNode(path); } catch (Exception e) { LOG.error("Tx: {} Failed Read of {}", getIdentifier(), path, e); return FluentFutures.immediateFailedFluentFuture(new ReadFailedException("Read failed", e)); } if (result == null) { return FluentFutures.immediateFailedFluentFuture(new ReadFailedException("Transaction is closed")); } return FluentFutures.immediateFluentFuture(result); } SnapshotBackedReadWriteTransaction(final T identifier, final boolean debug,
            final DataTreeSnapshot snapshot, final TransactionReadyPrototype<T> readyImpl); @SuppressWarnings("checkstyle:IllegalCatch") @Override FluentFuture<Optional<NormalizedNode<?,?>>> read(final YangInstanceIdentifier path); @SuppressWarnings("checkstyle:IllegalCatch") @Override FluentFuture<Boolean> exists(final YangInstanceIdentifier path); }
SnapshotBackedReadWriteTransaction extends
        SnapshotBackedWriteTransaction<T> implements DOMStoreReadWriteTransaction { @SuppressWarnings("checkstyle:IllegalCatch") @Override public FluentFuture<Optional<NormalizedNode<?,?>>> read(final YangInstanceIdentifier path) { LOG.debug("Tx: {} Read: {}", getIdentifier(), path); requireNonNull(path, "Path must not be null."); final Optional<NormalizedNode<?, ?>> result; try { result = readSnapshotNode(path); } catch (Exception e) { LOG.error("Tx: {} Failed Read of {}", getIdentifier(), path, e); return FluentFutures.immediateFailedFluentFuture(new ReadFailedException("Read failed", e)); } if (result == null) { return FluentFutures.immediateFailedFluentFuture(new ReadFailedException("Transaction is closed")); } return FluentFutures.immediateFluentFuture(result); } SnapshotBackedReadWriteTransaction(final T identifier, final boolean debug,
            final DataTreeSnapshot snapshot, final TransactionReadyPrototype<T> readyImpl); @SuppressWarnings("checkstyle:IllegalCatch") @Override FluentFuture<Optional<NormalizedNode<?,?>>> read(final YangInstanceIdentifier path); @SuppressWarnings("checkstyle:IllegalCatch") @Override FluentFuture<Boolean> exists(final YangInstanceIdentifier path);  }