本文整理汇总了Java中org.mockito.internal.progress.MockingProgress类的典型用法代码示例。如果您正苦于以下问题:Java MockingProgress类的具体用法?Java MockingProgress怎么用?Java MockingProgress使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MockingProgress类属于org.mockito.internal.progress包,在下文中一共展示了MockingProgress类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: MocksCollector
import org.mockito.internal.progress.MockingProgress; //导入依赖的package包/类
public MocksCollector() {
createdMocks = new LinkedList<Object>();
final MockingProgress progress = new ThreadSafeMockingProgress();
progress.setListener(new CollectCreatedMocks(createdMocks));
}
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:6,代码来源:MocksCollector.java
示例2: Verification
import org.mockito.internal.progress.MockingProgress; //导入依赖的package包/类
Verification(Object target) {
MockUtil mockUtil = new MockUtil();
InternalMockHandler<?> handler = mockUtil.getMockHandler(target);
InvocationContainer container = handler.getInvocationContainer();
Field field = ReflectionUtils.findField(container.getClass(),
"mockingProgress");
ReflectionUtils.makeAccessible(field);
this.progress = (MockingProgress) ReflectionUtils.getField(field, container);
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:10,代码来源:MockitoAopProxyTargetInterceptor.java
示例3: getVerificationMode
import org.mockito.internal.progress.MockingProgress; //导入依赖的package包/类
private VerificationMode getVerificationMode() {
try {
MockingProgress progress = (MockingProgress) Whitebox.invokeMethod(ThreadSafeMockingProgress.class,
"threadSafely");
return getVerificationModeFromMockProgress(progress);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
开发者ID:awenblue,项目名称:powermock,代码行数:10,代码来源:MockitoMethodInvocationControl.java
示例4: getVerificationModeFromMockProgress
import org.mockito.internal.progress.MockingProgress; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private VerificationMode getVerificationModeFromMockProgress(MockingProgress mockingProgress) {
if (mockingProgress == null) {
return null;
}
if (mockingProgress instanceof ThreadSafeMockingProgress) {
ThreadLocal<MockingProgress> threadLocal = Whitebox.getInternalState(mockingProgress, ThreadLocal.class);
return getVerificationModeFromMockProgress(threadLocal.get());
} else {
Localized<VerificationMode> verificationMode = Whitebox.getInternalState(mockingProgress, Localized.class);
return verificationMode == null ? null : verificationMode.getObject();
}
}
开发者ID:awenblue,项目名称:powermock,代码行数:14,代码来源:MockitoMethodInvocationControl.java
示例5: getMockingProgress
import org.mockito.internal.progress.MockingProgress; //导入依赖的package包/类
private MockingProgress getMockingProgress() {
return Whitebox.getInternalState(Mockito.class, MockingProgress.class);
}
开发者ID:awenblue,项目名称:powermock,代码行数:4,代码来源:PowerMockitoCore.java
示例6: MocksCollector
import org.mockito.internal.progress.MockingProgress; //导入依赖的package包/类
public MocksCollector() {
createdMocks = new LinkedList<>();
final MockingProgress progress = new ThreadSafeMockingProgress();
progress.setListener(new CollectCreatedMocks(createdMocks));
}
开发者ID:create1st,项目名称:spring-batch,代码行数:6,代码来源:MocksCollector.java
示例7: InvocationContainerImpl
import org.mockito.internal.progress.MockingProgress; //导入依赖的package包/类
public InvocationContainerImpl(MockingProgress mockingProgress) {
this.mockingProgress = mockingProgress;
}
开发者ID:SpoonLabs,项目名称:astor,代码行数:4,代码来源:InvocationContainerImpl.java
示例8: WarningsCollector
import org.mockito.internal.progress.MockingProgress; //导入依赖的package包/类
public WarningsCollector() {
createdMocks = new LinkedList();
MockingProgress progress = new ThreadSafeMockingProgress();
progress.setListener(new CollectCreatedMocks(createdMocks));
}
开发者ID:SpoonLabs,项目名称:astor,代码行数:6,代码来源:WarningsCollector.java
示例9: InvocationContainerImpl
import org.mockito.internal.progress.MockingProgress; //导入依赖的package包/类
public InvocationContainerImpl(MockingProgress mockingProgress, MockCreationSettings mockSettings) {
this.mockingProgress = mockingProgress;
this.registeredInvocations = createRegisteredInvocations(mockSettings);
}
开发者ID:SpoonLabs,项目名称:astor,代码行数:5,代码来源:InvocationContainerImpl.java
示例10: verifyPrivate
import org.mockito.internal.progress.MockingProgress; //导入依赖的package包/类
/**
* Verify a private method invocation with a given verification mode.
*
* @see {@link Mockito#verify(Object)}
* @throws Exception
* If something unexpected goes wrong.
*/
public static PrivateMethodVerification verifyPrivate(Object object, VerificationMode verificationMode)
throws Exception {
Whitebox.getInternalState(Mockito.class, MockingProgress.class).verificationStarted(
POWERMOCKITO_CORE.wrapInMockitoSpecificVerificationMode(object, verificationMode));
return new DefaultPrivateMethodVerification(object);
}
开发者ID:awenblue,项目名称:powermock,代码行数:14,代码来源:PowerMockito.java
示例11: verifyStatic
import org.mockito.internal.progress.MockingProgress; //导入依赖的package包/类
/**
* Verifies certain behavior happened at least once / exact number of times
* / never. E.g:
*
* <pre>
* verifyStatic(times(5));
* ClassWithStaticMethod.someStaticMethod("was called five times");
*
* verifyStatic(atLeast(2));
* ClassWithStaticMethod.someStaticMethod("was called at least two times");
*
* //you can use flexible argument matchers, e.g:
* verifyStatic(atLeastOnce());
* ClassWithStaticMethod.someMethod(<b>anyString()</b>);
* </pre>
*
* <b>times(1) is the default</b> and can be omitted
* <p>
*
* @param verificationMode
* times(x), atLeastOnce() or never()
*/
public static synchronized void verifyStatic(VerificationMode verificationMode) {
Whitebox.getInternalState(Mockito.class, MockingProgress.class).verificationStarted(
POWERMOCKITO_CORE.wrapInStaticVerificationMode(verificationMode));
}
开发者ID:awenblue,项目名称:powermock,代码行数:27,代码来源:PowerMockito.java
注:本文中的org.mockito.internal.progress.MockingProgress类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论