use of com.google.appengine.api.taskqueue.TaskQueuePb.TaskQueueDeleteRequest in project appengine-java-standard by GoogleCloudPlatform.
the class LocalTaskQueueTest method testDeleteUnknownTask.
@Test
public void testDeleteUnknownTask() throws Exception {
localService.bulkAdd(new Status(), bulkAddRequest.build());
TaskQueueDeleteRequest deleteRequest = TaskQueueDeleteRequest.newBuilder().setQueueName(ByteString.copyFromUtf8(entry.getName())).addTaskName(bulkAddRequest.getAddRequest(1).getTaskName()).build();
TaskQueueDeleteResponse deleteResponse = localService.delete(new Status(), deleteRequest);
assertThat(deleteResponse.getResultCount()).isEqualTo(1);
assertThat(deleteResponse.getResult(0)).isEqualTo(ErrorCode.OK);
deleteResponse = localService.delete(new Status(), deleteRequest);
assertThat(deleteResponse.getResultCount()).isEqualTo(1);
assertThat(deleteResponse.getResult(0)).isEqualTo(ErrorCode.UNKNOWN_TASK);
}
use of com.google.appengine.api.taskqueue.TaskQueuePb.TaskQueueDeleteRequest in project appengine-java-standard by GoogleCloudPlatform.
the class LocalTaskQueueTest method testDelete.
@Test
public void testDelete() throws Exception {
localService.bulkAdd(new Status(), bulkAddRequest.build());
TaskQueueDeleteRequest deleteRequest = TaskQueueDeleteRequest.newBuilder().setQueueName(ByteString.copyFromUtf8(entry.getName())).addTaskName(bulkAddRequest.getAddRequest(1).getTaskName()).build();
TaskQueueDeleteResponse deleteResponse = localService.delete(new Status(), deleteRequest);
assertThat(deleteResponse.getResultCount()).isEqualTo(1);
assertThat(deleteResponse.getResult(0)).isEqualTo(ErrorCode.OK);
QueueStateInfo queueInfo = localService.getQueueStateInfo().get(entry.getName());
assertThat(queueInfo.getCountTasks()).isEqualTo(2);
}
use of com.google.appengine.api.taskqueue.TaskQueuePb.TaskQueueDeleteRequest in project appengine-java-standard by GoogleCloudPlatform.
the class LocalTaskQueueTest method testDeleteMultiple.
@Test
public void testDeleteMultiple() throws Exception {
localService.bulkAdd(new Status(), bulkAddRequest.build());
TaskQueueDeleteRequest deleteRequest = TaskQueueDeleteRequest.newBuilder().setQueueName(ByteString.copyFromUtf8(entry.getName())).addTaskName(bulkAddRequest.getAddRequest(1).getTaskName()).addTaskName(bulkAddRequest.getAddRequest(0).getTaskName()).build();
TaskQueueDeleteResponse deleteResponse = localService.delete(new Status(), deleteRequest);
assertThat(deleteResponse.getResultCount()).isEqualTo(2);
assertThat(deleteResponse.getResult(0)).isEqualTo(ErrorCode.OK);
assertThat(deleteResponse.getResult(1)).isEqualTo(ErrorCode.OK);
QueueStateInfo queueInfo = localService.getQueueStateInfo().get(entry.getName());
assertThat(queueInfo.getCountTasks()).isEqualTo(1);
}
Aggregations