@Test public void testTransactionException() { FramedGraph fg = new FramedGraph(transactionalGraph); try(Transaction t = fg.tx()) { throw new Exception(); } catch(Exception e) { } Mockito.verify(transactionalGraph).rollback(); }
public Transaction tx() { if (delegate instanceof TransactionalGraph) { return new Transaction((TransactionalGraph) delegate); } else { return new Transaction((TransactionalGraph) null); } }
FramedGraph { public Transaction tx() { if (delegate instanceof TransactionalGraph) { return new Transaction((TransactionalGraph) delegate); } else { return new Transaction((TransactionalGraph) null); } } }
FramedGraph { public Transaction tx() { if (delegate instanceof TransactionalGraph) { return new Transaction((TransactionalGraph) delegate); } else { return new Transaction((TransactionalGraph) null); } } FramedGraph(Graph delegate, FrameFactory builder, TypeResolver resolver);  FramedGraph(Graph delegate); }
FramedGraph { public Transaction tx() { if (delegate instanceof TransactionalGraph) { return new Transaction((TransactionalGraph) delegate); } else { return new Transaction((TransactionalGraph) null); } } FramedGraph(Graph delegate, FrameFactory builder, TypeResolver resolver);  FramedGraph(Graph delegate); Transaction tx(); void close(); T addVertex(Class<T> kind); TVertex addVertex(); VertexTraversal<?, ?, ?> V(); EdgeTraversal<?, ?, ?> E(); VertexTraversal<?, ?, ?> v(final Collection<?> ids); VertexTraversal<?, ?, ?> v(final Object... ids); EdgeTraversal<?, ?, ?> e(final Object... ids); EdgeTraversal<?, ?, ?> e(final Collection<?> ids); }
FramedGraph { public Transaction tx() { if (delegate instanceof TransactionalGraph) { return new Transaction((TransactionalGraph) delegate); } else { return new Transaction((TransactionalGraph) null); } } FramedGraph(Graph delegate, FrameFactory builder, TypeResolver resolver);  FramedGraph(Graph delegate); Transaction tx(); void close(); T addVertex(Class<T> kind); TVertex addVertex(); VertexTraversal<?, ?, ?> V(); EdgeTraversal<?, ?, ?> E(); VertexTraversal<?, ?, ?> v(final Collection<?> ids); VertexTraversal<?, ?, ?> v(final Object... ids); EdgeTraversal<?, ?, ?> e(final Object... ids); EdgeTraversal<?, ?, ?> e(final Collection<?> ids);  }