本文整理汇总了Java中powermock.examples.mockpolicy.nontest.Dependency类的典型用法代码示例。如果您正苦于以下问题:Java Dependency类的具体用法?Java Dependency怎么用?Java Dependency使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Dependency类属于powermock.examples.mockpolicy.nontest包,在下文中一共展示了Dependency类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: applyInterceptionPolicy
import powermock.examples.mockpolicy.nontest.Dependency; //导入依赖的package包/类
/**
* Every time the {@link Dependency#getData()} method is invoked we return a
* custom instance of a {@link DataObject}.
*/
@Override
public void applyInterceptionPolicy(MockPolicyInterceptionSettings settings) {
final Method getDataMethod = Whitebox.getMethod(Dependency.class);
final DataObject dataObject = new DataObject("Policy generated data object");
settings.stubMethod(getDataMethod, dataObject);
}
示例2: getDependencyData
import powermock.examples.mockpolicy.nontest.Dependency; //导入依赖的package包/类
public DataObject getDependencyData() {
return new Dependency("some data").getData();
}
示例3: applyClassLoadingPolicy
import powermock.examples.mockpolicy.nontest.Dependency; //导入依赖的package包/类
/**
* Add the {@link Dependency} to the list of classes that should be loaded
* by the mock class-loader.
*/
@Override
public void applyClassLoadingPolicy(MockPolicyClassLoadingSettings settings) {
settings.addFullyQualifiedNamesOfClassesToLoadByMockClassloader(Dependency.class.getName());
}
示例4: applyInterceptionPolicy
import powermock.examples.mockpolicy.nontest.Dependency; //导入依赖的package包/类
/**
* Every time the {@link Dependency#getData()} method is invoked we return a
* custom instance of a {@link DataObject}.
*/
public void applyInterceptionPolicy(MockPolicyInterceptionSettings settings) {
final Method getDataMethod = Whitebox.getMethod(Dependency.class);
final DataObject dataObject = new DataObject("Policy generated data object");
settings.stubMethod(getDataMethod, dataObject);
}
示例5: getDependencyData
import powermock.examples.mockpolicy.nontest.Dependency; //导入依赖的package包/类
public DataObject getDependencyData()
{
return new Dependency("some data").getData();
}
示例6: applyClassLoadingPolicy
import powermock.examples.mockpolicy.nontest.Dependency; //导入依赖的package包/类
/**
* Add the {@link Dependency} to the list of classes that should be loaded
* by the mock class-loader.
*/
public void applyClassLoadingPolicy(MockPolicyClassLoadingSettings settings) {
settings.addFullyQualifiedNamesOfClassesToLoadByMockClassloader(Dependency.class.getName());
}