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


Java WhiteboxImpl.setInternalState方法代码示例

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


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

示例1: createAclEntrySetMock

import org.powermock.reflect.internal.WhiteboxImpl; //导入方法依赖的package包/类
protected CloudAclEntrySet createAclEntrySetMock(String name) {
	CloudAclEntrySet aclEntrySet = context.mock(CloudAclEntrySet.class, name);
	// The next part we have to do because of the aclEntrySet.equals method which uses this,
	// so we have to set this value in the mock or we get an NPE
	WhiteboxImpl.setInternalState(aclEntrySet, "ownersLock", new ReentrantReadWriteLock());
	return aclEntrySet;
}
 
开发者ID:brdara,项目名称:java-cloud-filesystem-provider,代码行数:8,代码来源:DefaultCloudFileSystemImplementationTest.java

示例2: useMockJAXBContext

import org.powermock.reflect.internal.WhiteboxImpl; //导入方法依赖的package包/类
protected void useMockJAXBContext(Object object, Class<?> jaxbClassToBeBound) throws Exception {
	JAXBContext jaxbContext = JAXBContext.newInstance(jaxbClassToBeBound);
	when(context.createMarshaller()).thenReturn(jaxbContext.createMarshaller());
	when(context.createUnmarshaller()).thenReturn(jaxbContext.createUnmarshaller());
	WhiteboxImpl.setInternalState(object, JAXBContext.class, context);
}
 
开发者ID:jungyang,项目名称:oauth-client-master,代码行数:7,代码来源:BaseJaxbMessageConverterTest.java

示例3: registerProxyFramework

import org.powermock.reflect.internal.WhiteboxImpl; //导入方法依赖的package包/类
/**
 * Register a proxy framework.
 * 
 * @param proxyFramework
 *            The proxy framework to register.
 */
public static void registerProxyFramework(ProxyFramework proxyFramework) {
	WhiteboxImpl.setInternalState(WhiteboxImpl.class, proxyFramework);
}
 
开发者ID:awenblue,项目名称:powermock,代码行数:10,代码来源:RegisterProxyFramework.java

示例4: setInternalState

import org.powermock.reflect.internal.WhiteboxImpl; //导入方法依赖的package包/类
/**
 * Set the value of a field using reflection. This method will traverse the
 * super class hierarchy until a field with name <tt>fieldName</tt> is
 * found.
 * 
 * @param object
 *            the object whose field to modify
 * @param fieldName
 *            the name of the field
 * @param value
 *            the new value of the field
 */
public static void setInternalState(Object object, String fieldName, Object value) {
	WhiteboxImpl.setInternalState(object, fieldName, value);
}
 
开发者ID:awenblue,项目名称:powermock,代码行数:16,代码来源:Whitebox.java


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