本文整理汇总了Java中com.google.appengine.api.taskqueue.dev.LocalTaskQueue类的典型用法代码示例。如果您正苦于以下问题:Java LocalTaskQueue类的具体用法?Java LocalTaskQueue怎么用?Java LocalTaskQueue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LocalTaskQueue类属于com.google.appengine.api.taskqueue.dev包,在下文中一共展示了LocalTaskQueue类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: doTest
import com.google.appengine.api.taskqueue.dev.LocalTaskQueue; //导入依赖的package包/类
private void doTest() throws InterruptedException {
QueueFactory.getDefaultQueue().add(TaskOptions.Builder.withTaskName("task29"));
// Give the task time to execute if tasks are actually enabled (which they
// aren't, but that's part of the test).
Thread.sleep(1000);
LocalTaskQueue ltq = LocalTaskQueueTestConfig.getLocalTaskQueue();
QueueStateInfo qsi = ltq.getQueueStateInfo().get(QueueFactory.getDefaultQueue().getQueueName());
assertEquals(1, qsi.getTaskInfo().size());
assertEquals("task29", qsi.getTaskInfo().get(0).getTaskName());
}
开发者ID:GoogleCloudPlatform,项目名称:java-docs-samples,代码行数:11,代码来源:TaskQueueTest.java
示例2: doTest
import com.google.appengine.api.taskqueue.dev.LocalTaskQueue; //导入依赖的package包/类
private void doTest() throws InterruptedException {
// [START QueueFactory]
QueueFactory.getQueue("my-queue-name").add(TaskOptions.Builder.withTaskName("task29"));
// [END QueueFactory]
// Give the task time to execute if tasks are actually enabled (which they
// aren't, but that's part of the test).
Thread.sleep(1000);
LocalTaskQueue ltq = LocalTaskQueueTestConfig.getLocalTaskQueue();
QueueStateInfo qsi =
ltq.getQueueStateInfo().get(QueueFactory.getQueue("my-queue-name").getQueueName());
assertEquals(1, qsi.getTaskInfo().size());
assertEquals("task29", qsi.getTaskInfo().get(0).getTaskName());
}
开发者ID:GoogleCloudPlatform,项目名称:java-docs-samples,代码行数:14,代码来源:TaskQueueConfigTest.java
示例3: assertNumTasksInQueue
import com.google.appengine.api.taskqueue.dev.LocalTaskQueue; //导入依赖的package包/类
/**
* Asserts that the {@code numExpectedTasksInQueue} matches the actual number of tasks in the queue.
*/
private void assertNumTasksInQueue(int numExpectedTasksInQueue)
{
LocalTaskQueue ltq = LocalTaskQueueTestConfig.getLocalTaskQueue();
QueueStateInfo qsi = ltq.getQueueStateInfo()
.get(QueueFactory.getQueue(DELETE_COUNTER_SHARD_QUEUE_NAME).getQueueName());
assertEquals(numExpectedTasksInQueue, qsi.getTaskInfo().size());
}
开发者ID:instacount,项目名称:appengine-counter,代码行数:11,代码来源:ShardedCounterServiceDeleteTest.java
示例4: getCountTasks
import com.google.appengine.api.taskqueue.dev.LocalTaskQueue; //导入依赖的package包/类
private static int getCountTasks() {
LocalTaskQueue localTaskQueue = LocalTaskQueueTestConfig.getLocalTaskQueue();
Map<String, QueueStateInfo> queueStateInfo = localTaskQueue.getQueueStateInfo();
int count = 0;
for (String key : queueStateInfo.keySet()) {
count += queueStateInfo.get(key).getCountTasks();
}
return count;
}
开发者ID:feroult,项目名称:yawp,代码行数:14,代码来源:AsyncHelper.java
示例5: getTaskCount
import com.google.appengine.api.taskqueue.dev.LocalTaskQueue; //导入依赖的package包/类
/**
* Fetches the number of tasks that have been scheduled in a named queue in the
* current test, including both tasks that have executed, and those that have not.
* @param queueName the name of the queue
* @return the total number of tasks enqueued by the test
*/
public int getTaskCount(String queueName) {
LocalTaskQueue localTaskQueue = LocalTaskQueueTestConfig.getLocalTaskQueue();
QueueStateInfo queueState = localTaskQueue.getQueueStateInfo().get(queueName);
return queueState.getCountTasks();
}
开发者ID:openmash,项目名称:mashmesh,代码行数:12,代码来源:IntegrationTestHelper.java
注:本文中的com.google.appengine.api.taskqueue.dev.LocalTaskQueue类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论