Example #1
0
 /** @throws Exception */
 @Test
 public void getAsMapAsyncNoTx() throws Exception {
   Key key = ds.put(new Entity("Hoge")).get();
   Key key2 = ds.put(new Entity("Hoge", key)).get();
   Map<Key, Entity> map = DatastoreUtil.getAsMapAsync(ds, null, Arrays.asList(key, key2)).get();
   assertThat(map, is(notNullValue()));
   assertThat(map.size(), is(2));
 }
Example #2
0
 /** @throws Exception */
 @Test(expected = IllegalStateException.class)
 public void getAsMapAsyncTxIsIllegal() throws Exception {
   Key key = ds.put(new Entity("Hoge")).get();
   Key key2 = ds.put(new Entity("Hoge", key)).get();
   Transaction tx = ds.beginTransaction().get();
   tx.rollback();
   DatastoreUtil.getAsMapAsync(ds, tx, Arrays.asList(key, key2));
 }