Пример #1
0
 /** @throws Exception */
 @Test(expected = IllegalStateException.class)
 public void deleteAsyncIllegalTx() throws Exception {
   Key key = ds.put(new Entity("Hoge")).get();
   Transaction tx = ds.beginTransaction().get();
   tx.rollback();
   DatastoreUtil.deleteAsync(ds, tx, Arrays.asList(key)).get();
 }
Пример #2
0
 /** @throws Exception */
 @Test
 public void deleteAsync() throws Exception {
   Key key = ds.put(new Entity("Hoge")).get();
   Transaction tx = ds.beginTransaction().get();
   DatastoreUtil.deleteAsync(ds, tx, Arrays.asList(key)).get();
   tx.rollback();
   assertThat(tester.count("Hoge"), is(1));
 }
Пример #3
0
 /** @throws Exception */
 @Test
 public void deleteAsyncNoTx() throws Exception {
   Key key = ds.put(new Entity("Hoge")).get();
   DatastoreUtil.deleteAsync(ds, null, Arrays.asList(key)).get();
   assertThat(tester.count("Hoge"), is(0));
 }