@Test public void testNoTaskIterable() { Transaction tx = DatastoreServiceFactory.getDatastoreService().beginTransaction(); final int beforeNumTasks = getDefaultQueue().fetchStatistics().getNumTasks(); try { getDefaultQueue().add(tx, Collections.singleton(TaskOptions.Builder.withDefaults())); } finally { tx.rollback(); } if (doIgnore("testNoTaskIterable")) { return; } sync(10000); // Wait for statistics servers to refresh. Assert.assertEquals(beforeNumTasks, getDefaultQueue().fetchStatistics().getNumTasks()); }
@Test public void testNoTaskSingleAsync() { Transaction tx = DatastoreServiceFactory.getDatastoreService().beginTransaction(); final int beforeNumTasks = getDefaultQueue().fetchStatistics().getNumTasks(); try { waitOnFuture(getDefaultQueue().addAsync(tx, TaskOptions.Builder.withDefaults())); } finally { tx.rollback(); } if (doIgnore("testNoTaskSingleAsync")) { return; } sync(10000); Assert.assertEquals( beforeNumTasks, waitOnFuture(getDefaultQueue().fetchStatisticsAsync(2013.0)).getNumTasks()); }