@Test(expected = ExecutionException.class) public void testAdaptedWriteTransactionCannotCancel() throws Exception { managedNewTransactionRunner.callWithNewWriteOnlyTransactionAndSubmit(OPERATIONAL, tx -> TransactionAdapter.toWriteTransaction(tx).cancel()).get(); }
public static WriteTransaction toWriteTransaction(final TypedWriteTransaction<? extends Datastore> datastoreTx) { if (datastoreTx instanceof TypedWriteTransactionImpl) { final TypedWriteTransactionImpl<?, ?> txImpl = (TypedWriteTransactionImpl<?, ?>) datastoreTx; return new WriteTransactionAdapter<>(txImpl.getDatastoreType(), txImpl); } throw new IllegalArgumentException("Unsupported TypedWriteTransaction implementation " + datastoreTx.getClass()); }
TransactionAdapter { public static WriteTransaction toWriteTransaction(final TypedWriteTransaction<? extends Datastore> datastoreTx) { if (datastoreTx instanceof TypedWriteTransactionImpl) { final TypedWriteTransactionImpl<?, ?> txImpl = (TypedWriteTransactionImpl<?, ?>) datastoreTx; return new WriteTransactionAdapter<>(txImpl.getDatastoreType(), txImpl); } throw new IllegalArgumentException("Unsupported TypedWriteTransaction implementation " + datastoreTx.getClass()); } }
TransactionAdapter { public static WriteTransaction toWriteTransaction(final TypedWriteTransaction<? extends Datastore> datastoreTx) { if (datastoreTx instanceof TypedWriteTransactionImpl) { final TypedWriteTransactionImpl<?, ?> txImpl = (TypedWriteTransactionImpl<?, ?>) datastoreTx; return new WriteTransactionAdapter<>(txImpl.getDatastoreType(), txImpl); } throw new IllegalArgumentException("Unsupported TypedWriteTransaction implementation " + datastoreTx.getClass()); } private  TransactionAdapter(); }
TransactionAdapter { public static WriteTransaction toWriteTransaction(final TypedWriteTransaction<? extends Datastore> datastoreTx) { if (datastoreTx instanceof TypedWriteTransactionImpl) { final TypedWriteTransactionImpl<?, ?> txImpl = (TypedWriteTransactionImpl<?, ?>) datastoreTx; return new WriteTransactionAdapter<>(txImpl.getDatastoreType(), txImpl); } throw new IllegalArgumentException("Unsupported TypedWriteTransaction implementation " + datastoreTx.getClass()); } private  TransactionAdapter(); static ReadWriteTransaction toReadWriteTransaction(
            final TypedReadWriteTransaction<? extends Datastore> datastoreTx); static WriteTransaction toWriteTransaction(final TypedWriteTransaction<? extends Datastore> datastoreTx); }
TransactionAdapter { public static WriteTransaction toWriteTransaction(final TypedWriteTransaction<? extends Datastore> datastoreTx) { if (datastoreTx instanceof TypedWriteTransactionImpl) { final TypedWriteTransactionImpl<?, ?> txImpl = (TypedWriteTransactionImpl<?, ?>) datastoreTx; return new WriteTransactionAdapter<>(txImpl.getDatastoreType(), txImpl); } throw new IllegalArgumentException("Unsupported TypedWriteTransaction implementation " + datastoreTx.getClass()); } private  TransactionAdapter(); static ReadWriteTransaction toReadWriteTransaction(
            final TypedReadWriteTransaction<? extends Datastore> datastoreTx); static WriteTransaction toWriteTransaction(final TypedWriteTransaction<? extends Datastore> datastoreTx);  }