• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java LocalMemcacheServiceTestConfig类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.google.appengine.tools.development.testing.LocalMemcacheServiceTestConfig的典型用法代码示例。如果您正苦于以下问题:Java LocalMemcacheServiceTestConfig类的具体用法?Java LocalMemcacheServiceTestConfig怎么用?Java LocalMemcacheServiceTestConfig使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



LocalMemcacheServiceTestConfig类属于com.google.appengine.tools.development.testing包,在下文中一共展示了LocalMemcacheServiceTestConfig类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createTestConfigs

import com.google.appengine.tools.development.testing.LocalMemcacheServiceTestConfig; //导入依赖的package包/类
/**
 * Override to customise the test configs required.
 *
 * @return Test configs.
 */
protected List<LocalServiceTestConfig> createTestConfigs() {
    List<LocalServiceTestConfig> results = new ArrayList<>();
    LocalTaskQueueTestConfig queueConfig = new LocalTaskQueueTestConfig();
    queueConfig.setQueueXmlPath("src/main/webapp/WEB-INF/queue.xml");

    results.add(new LocalDatastoreServiceTestConfig().setApplyAllHighRepJobPolicy());
    results.add(queueConfig);
    results.add(new LocalMemcacheServiceTestConfig());
    results.add(new LocalSearchServiceTestConfig());
    return results;
}
 
开发者ID:n15g,项目名称:spring-boot-gae,代码行数:17,代码来源:SetupAppengine.java


示例2: setUp

import com.google.appengine.tools.development.testing.LocalMemcacheServiceTestConfig; //导入依赖的package包/类
@Before
public void setUp() throws Exception
{
	super.setUp();

	// See
	// http://www.ensor.cc/2010/11/unit-testing-named-queues-spring.html
	// NOTE: THE QUEUE XML PATH RELATIVE TO WEB APP ROOT, More info
	// below
	// http://stackoverflow.com/questions/11197058/testing-non-default-app-engine-task-queues
	final LocalTaskQueueTestConfig localTaskQueueConfig = new LocalTaskQueueTestConfig()
		.setDisableAutoTaskExecution(false).setQueueXmlPath("src/test/resources/queue.xml")
		.setTaskExecutionLatch(countdownLatch).setCallbackClass(DeleteShardedCounterDeferredCallback.class);

	Capability testOne = new Capability("memcache");
	CapabilityStatus testStatus = CapabilityStatus.DISABLED;
	// Initialize
	LocalCapabilitiesServiceTestConfig capabilityStatusConfig = new LocalCapabilitiesServiceTestConfig()
		.setCapabilityStatus(testOne, testStatus);

	// Use a different queue.xml for testing purposes
	helper = new LocalServiceTestHelper(
		new LocalDatastoreServiceTestConfig().setDefaultHighRepJobPolicyUnappliedJobPercentage(0.01f),
		new LocalMemcacheServiceTestConfig(), localTaskQueueConfig, capabilityStatusConfig);
	helper.setUp();
}
 
开发者ID:instacount,项目名称:appengine-counter,代码行数:27,代码来源:ShardedCounterServiceCounterShardDecrementNoMemcacheTest.java


示例3: disableMemcache

import com.google.appengine.tools.development.testing.LocalMemcacheServiceTestConfig; //导入依赖的package包/类
protected void disableMemcache()
{
	// See
	// http://www.ensor.cc/2010/11/unit-testing-named-queues-spring.html
	// NOTE: THE QUEUE XML PATH RELATIVE TO WEB APP ROOT, More info
	// below
	// http://stackoverflow.com/questions/11197058/testing-non-default-app-engine-task-queues
	final LocalTaskQueueTestConfig localTaskQueueConfig = new LocalTaskQueueTestConfig()
		.setDisableAutoTaskExecution(false).setQueueXmlPath("src/test/resources/queue.xml")
		.setTaskExecutionLatch(countdownLatch).setCallbackClass(DeleteShardedCounterDeferredCallback.class);

	Capability testOne = new Capability("memcache");
	CapabilityStatus testStatus = CapabilityStatus.DISABLED;
	// Initialize
	LocalCapabilitiesServiceTestConfig capabilityStatusConfig = new LocalCapabilitiesServiceTestConfig()
		.setCapabilityStatus(testOne, testStatus);

	// Use a different queue.xml for testing purposes
	helper = new LocalServiceTestHelper(
		new LocalDatastoreServiceTestConfig().setDefaultHighRepJobPolicyUnappliedJobPercentage(0.01f),
		new LocalMemcacheServiceTestConfig(), localTaskQueueConfig, capabilityStatusConfig);
	helper.setUp();
}
 
开发者ID:instacount,项目名称:appengine-counter,代码行数:24,代码来源:AbstractShardedCounterServiceTest.java


示例4: createTestConfigs

import com.google.appengine.tools.development.testing.LocalMemcacheServiceTestConfig; //导入依赖的package包/类
/**
 * Override to customise the test configs required.
 *
 * @return
 */
protected List<LocalServiceTestConfig> createTestConfigs() {
    List<LocalServiceTestConfig> results = new ArrayList<>();
    LocalTaskQueueTestConfig queueConfig = new LocalTaskQueueTestConfig();
    queueConfig.setQueueXmlPath("src/main/webapp/WEB-INF/queue.xml");

    results.add(new LocalDatastoreServiceTestConfig().setApplyAllHighRepJobPolicy());
    results.add(queueConfig);
    results.add(new LocalMemcacheServiceTestConfig());
    results.add(new LocalSearchServiceTestConfig());
    return results;
}
 
开发者ID:monPlan,项目名称:springboot-spwa-gae-demo,代码行数:17,代码来源:SetupAppengine.java


示例5: setUp

import com.google.appengine.tools.development.testing.LocalMemcacheServiceTestConfig; //导入依赖的package包/类
/**
 * Sets up the AppEngine environment and initializes Guice.
 */
@Override
protected void setUp() throws Exception {
    super.setUp();
    datastoreConfig = new LocalDatastoreServiceTestConfig();
    memcacheConfig = new LocalMemcacheServiceTestConfig();
    taskQueueConfig = new LocalTaskQueueTestConfig();
    taskQueueConfig.setQueueXmlPath("src/main/webapp/WEB-INF/queue.xml");

    HashMap<String, Object> envAttr = new HashMap<String, Object>();
    envAttr.put("com.google.appengine.api.users.UserService.user_id_key", "13");

    helper = new LocalServiceTestHelper(datastoreConfig, taskQueueConfig);
    helper.setEnvAuthDomain("auth");
    helper.setEnvEmail("[email protected]");
    helper.setEnvAttributes(envAttr);
    helper.setEnvIsAdmin(true);
    helper.setEnvIsLoggedIn(true);
    helper.setUp();
    User user = UserTestCase.addTestUser();

    // Mock the session so AuthFilter will also return the test user
    HttpServletRequest mockServletRequest = Mockito.mock(HttpServletRequest.class);
    HttpSession mockHttpSession = Mockito.mock(HttpSession.class);
    Mockito.when(mockHttpSession.getAttribute(AuthFilter.USER_KEY)).thenReturn(user);
    Mockito.when(mockServletRequest.getSession()).thenReturn(mockHttpSession);
    AuthFilter.testLogin(mockServletRequest, user);
}
 
开发者ID:turbomanage,项目名称:listmaker,代码行数:31,代码来源:BaseTest.java


示例6: before

import com.google.appengine.tools.development.testing.LocalMemcacheServiceTestConfig; //导入依赖的package包/类
@Override 
protected void before() throws Throwable {
	LocalDatastoreServiceTestConfig cfg = new LocalDatastoreServiceTestConfig();
	LocalBlobstoreServiceTestConfig blobCfg = new LocalBlobstoreServiceTestConfig();
	LocalTaskQueueTestConfig queueCfg = new LocalTaskQueueTestConfig();
	LocalMemcacheServiceTestConfig cacheCfg = new LocalMemcacheServiceTestConfig();
	helper = new LocalServiceTestHelper(cfg, blobCfg, queueCfg, cacheCfg);
	helper.setUp();
}
 
开发者ID:rzymek,项目名称:obsolete-web-boards-gwt,代码行数:10,代码来源:EmbeddedDataStore.java


示例7: setUp

import com.google.appengine.tools.development.testing.LocalMemcacheServiceTestConfig; //导入依赖的package包/类
@Before
public void setUp() throws Exception
{
	// Don't call super.setUp because we initialize slightly differently
	// here...

	countdownLatch = new LocalTaskQueueTestConfig.TaskCountDownLatch(1);

	// See
	// http://www.ensor.cc/2010/11/unit-testing-named-queues-spring.html
	// NOTE: THE QUEUE XML PATH RELATIVE TO WEB APP ROOT, More info
	// below
	// http://stackoverflow.com/questions/11197058/testing-non-default-app-engine-task-queues
	final LocalTaskQueueTestConfig localTaskQueueConfig = new LocalTaskQueueTestConfig()
		.setDisableAutoTaskExecution(false).setQueueXmlPath("src/test/resources/queue.xml")
		.setTaskExecutionLatch(countdownLatch).setCallbackClass(DeleteShardedCounterDeferredCallback.class);

	// Use a different queue.xml for testing purposes
	helper = new LocalServiceTestHelper(new LocalDatastoreServiceTestConfig().setApplyAllHighRepJobPolicy(),
		new LocalMemcacheServiceTestConfig(), new LocalCapabilitiesServiceTestConfig(), localTaskQueueConfig);
	helper.setUp();

	memcache = MemcacheServiceFactory.getMemcacheService();
	capabilitiesService = CapabilitiesServiceFactory.getCapabilitiesService();

	// New Objectify 5.1 Way. See https://groups.google.com/forum/#!topic/objectify-appengine/O4FHC_i7EGk
	this.session = ObjectifyService.begin();

	// Enable Joda Translators
	JodaTimeTranslators.add(ObjectifyService.factory());

	ObjectifyService.factory().register(CounterData.class);
	ObjectifyService.factory().register(CounterShardData.class);
	ObjectifyService.factory().register(CounterShardOperationData.class);

	shardedCounterServiceImpl = new ShardedCounterServiceImpl();
	this.shardedCounterService = shardedCounterServiceImpl;
}
 
开发者ID:instacount,项目名称:appengine-counter,代码行数:39,代码来源:AbstractShardedCounterServiceTest.java


示例8: getMemcacheConfig

import com.google.appengine.tools.development.testing.LocalMemcacheServiceTestConfig; //导入依赖的package包/类
public LocalMemcacheServiceTestConfig getMemcacheConfig() {
    return memcacheConfig;
}
 
开发者ID:turbomanage,项目名称:listmaker,代码行数:4,代码来源:BaseTest.java



注:本文中的com.google.appengine.tools.development.testing.LocalMemcacheServiceTestConfig类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java CheckboxMenuItemPeer类代码示例发布时间:2022-05-21
下一篇:
Java MembershipEvent类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap