当前位置: 首页>>代码示例>>Java>>正文


Java OwnCloudClientManagerFactory.getDefaultPolicy方法代码示例

本文整理汇总了Java中com.owncloud.android.lib.common.OwnCloudClientManagerFactory.getDefaultPolicy方法的典型用法代码示例。如果您正苦于以下问题:Java OwnCloudClientManagerFactory.getDefaultPolicy方法的具体用法?Java OwnCloudClientManagerFactory.getDefaultPolicy怎么用?Java OwnCloudClientManagerFactory.getDefaultPolicy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.owncloud.android.lib.common.OwnCloudClientManagerFactory的用法示例。


在下文中一共展示了OwnCloudClientManagerFactory.getDefaultPolicy方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testSetDefaultPolicy

import com.owncloud.android.lib.common.OwnCloudClientManagerFactory; //导入方法依赖的package包/类
public void testSetDefaultPolicy() {
	OwnCloudClientManagerFactory.setDefaultPolicy(Policy.SINGLE_SESSION_PER_ACCOUNT);
	Policy defaultPolicy = OwnCloudClientManagerFactory.getDefaultPolicy();
	assertEquals("SINGLE_SESSION_PER_ACCOUNT not set", 
			Policy.SINGLE_SESSION_PER_ACCOUNT, defaultPolicy);
	
	OwnCloudClientManagerFactory.setDefaultPolicy(Policy.ALWAYS_NEW_CLIENT);
	defaultPolicy = OwnCloudClientManagerFactory.getDefaultPolicy();
	assertEquals("ALWAYS_NEW_CLIENT not set", Policy.ALWAYS_NEW_CLIENT, defaultPolicy);
	
	try {
		OwnCloudClientManagerFactory.setDefaultPolicy(null);
		throw new AssertionFailedError("Accepted NULL parameter");
		
	} catch(Exception e) {
		assertTrue("Unexpected exception when setting default policy null", 
				(e instanceof IllegalArgumentException));
	}
	defaultPolicy = OwnCloudClientManagerFactory.getDefaultPolicy();
	assertEquals("ALWAYS_NEW_CLIENT changed after setting null", 
			Policy.ALWAYS_NEW_CLIENT, defaultPolicy);
	
}
 
开发者ID:PicFrame,项目名称:picframe,代码行数:24,代码来源:OwnCloudClientManagerFactoryTest.java

示例2: testGetDefaultPolicy

import com.owncloud.android.lib.common.OwnCloudClientManagerFactory; //导入方法依赖的package包/类
public void testGetDefaultPolicy() {
	Policy defaultPolicy = OwnCloudClientManagerFactory.getDefaultPolicy();
	assertNotNull("Returned null value", defaultPolicy);
	assertTrue("Returned unknown value", 
					(Policy.ALWAYS_NEW_CLIENT.equals(defaultPolicy) ||
					(Policy.SINGLE_SESSION_PER_ACCOUNT.equals(defaultPolicy))));
}
 
开发者ID:PicFrame,项目名称:picframe,代码行数:8,代码来源:OwnCloudClientManagerFactoryTest.java


注:本文中的com.owncloud.android.lib.common.OwnCloudClientManagerFactory.getDefaultPolicy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。