本文整理了Java中org.easymock.EasyMock.getControl()
方法的一些代码示例,展示了EasyMock.getControl()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。EasyMock.getControl()
方法的具体详情如下:
包路径:org.easymock.EasyMock
类名称:EasyMock
方法名:getControl
暂无
代码示例来源:origin: org.easymock/easymock
/**
* Tell that the mock should be used in only one thread. An exception will
* be thrown if that's not the case. This can be useful when mocking an
* object that isn't thread safe to make sure it is used correctly in a
* multithreaded environment. By default, no check is done unless
* {@link #ENABLE_THREAD_SAFETY_CHECK_BY_DEFAULT} was set to true.
*
* @param mock
* the mock
* @param shouldBeUsedInOneThread
* If the mock should be used in only one thread
*/
public static void checkIsUsedInOneThread(Object mock, boolean shouldBeUsedInOneThread) {
getControl(mock).checkIsUsedInOneThread(shouldBeUsedInOneThread);
}
代码示例来源:origin: org.easymock/easymock
/**
* Switches order checking of the given mock object (more exactly: the
* control of the mock object) the on and off. For details, see the EasyMock
* documentation.
*
* @param mock
* the mock object.
* @param state
* {@code true} switches order checking on,
* {@code false} switches it off.
*/
public static void checkOrder(Object mock, boolean state) {
getControl(mock).checkOrder(state);
}
代码示例来源:origin: org.easymock/easymock
/**
* By default, a mock is thread safe (unless
* {@link #NOT_THREAD_SAFE_BY_DEFAULT} is set). This method can change this
* behavior. Two reasons are known for someone to do that: Performance or
* dead-locking issues.
*
* @param mock
* the mock to make thread safe
* @param threadSafe
* If the mock should be thread safe or not
*/
public static void makeThreadSafe(Object mock, boolean threadSafe) {
getControl(mock).makeThreadSafe(threadSafe);
}
代码示例来源:origin: org.easymock/easymock
/**
* Resets the given mock objects (more exactly: the controls of the mock
* objects). For details, see the EasyMock documentation.
*
* @param mocks
* the mock objects.
*/
public static void reset(Object... mocks) {
for (int i = 0; i < mocks.length; i++) {
try {
getControl(mocks[i]).reset();
} catch(RuntimeException e) {
throw getRuntimeException(mocks.length, i, e);
} catch(AssertionError e) {
throw getAssertionError(mocks.length, i, e);
}
}
}
代码示例来源:origin: org.easymock/easymock
/**
* Resets the given mock objects (more exactly: the controls of the mock
* objects) and turn them to a mock with nice behavior. For details, see the
* EasyMock documentation.
*
* @param mocks
* the mock objects
*/
public static void resetToNice(Object... mocks) {
for (int i = 0; i < mocks.length; i++) {
try {
getControl(mocks[i]).resetToNice();
} catch(RuntimeException e) {
throw getRuntimeException(mocks.length, i, e);
} catch(AssertionError e) {
throw getAssertionError(mocks.length, i, e);
}
}
}
代码示例来源:origin: org.easymock/easymock
/**
* Verifies that all expectations were met.
*
* @param mocks
* the mock objects.
* @since 3.5
*/
public static void verifyRecording(Object... mocks) {
for (int i = 0; i < mocks.length; i++) {
try {
getControl(mocks[i]).verifyRecording();
} catch(RuntimeException e) {
throw getRuntimeException(mocks.length, i, e);
} catch(AssertionError e) {
throw getAssertionError(mocks.length, i, e);
}
}
}
代码示例来源:origin: org.easymock/easymock
/**
* Resets the given mock objects (more exactly: the controls of the mock
* objects) and turn them to a mock with default behavior. For details, see
* the EasyMock documentation.
*
* @param mocks
* the mock objects
*/
public static void resetToDefault(Object... mocks) {
for (int i = 0; i < mocks.length; i++) {
try {
getControl(mocks[i]).resetToDefault();
} catch(RuntimeException e) {
throw getRuntimeException(mocks.length, i, e);
} catch(AssertionError e) {
throw getAssertionError(mocks.length, i, e);
}
}
}
代码示例来源:origin: org.easymock/easymock
/**
* Verifies that all expectations were met and that no unexpected
* call was performed on the mock objects. Or more precisely, verifies the
* underlying {@link IMocksControl} linked to the mock objects.
* <p>
* This method as same effect as calling {@link #verifyRecording(Object...)}
* followed by {@link #verifyUnexpectedCalls(Object...)}.
*
* @param mocks
* the mock objects.
*/
public static void verify(Object... mocks) {
for (int i = 0; i < mocks.length; i++) {
try {
getControl(mocks[i]).verify();
} catch(RuntimeException e) {
throw getRuntimeException(mocks.length, i, e);
} catch(AssertionError e) {
throw getAssertionError(mocks.length, i, e);
}
}
}
代码示例来源:origin: org.easymock/easymock
/**
* Switches the given mock objects (more exactly: the controls of the mock
* objects) to replay mode. For details, see the EasyMock documentation.
*
* @param mocks
* the mock objects.
*/
public static void replay(Object... mocks) {
for (int i = 0; i < mocks.length; i++) {
try {
getControl(mocks[i]).replay();
} catch(RuntimeException e) {
throw getRuntimeException(mocks.length, i, e);
} catch(AssertionError e) {
throw getAssertionError(mocks.length, i, e);
}
}
}
代码示例来源:origin: org.easymock/easymock
/**
* Verifies that no unexpected call was performed.
*
* @param mocks
* the mock objects.
* @since 3.5
*/
public static void verifyUnexpectedCalls(Object... mocks) {
for (int i = 0; i < mocks.length; i++) {
try {
getControl(mocks[i]).verifyUnexpectedCalls();
} catch(RuntimeException e) {
throw getRuntimeException(mocks.length, i, e);
} catch(AssertionError e) {
throw getAssertionError(mocks.length, i, e);
}
}
}
代码示例来源:origin: org.easymock/easymock
/**
* Resets the given mock objects (more exactly: the controls of the mock
* objects) and turn them to a mock with strict behavior. For details, see
* the EasyMock documentation.
*
* @param mocks
* the mock objects
*/
public static void resetToStrict(Object... mocks) {
for (int i = 0; i < mocks.length; i++) {
try {
getControl(mocks[i]).resetToStrict();
} catch(RuntimeException e) {
throw getRuntimeException(mocks.length, i, e);
} catch(AssertionError e) {
throw getAssertionError(mocks.length, i, e);
}
}
}
代码示例来源:origin: easymock/easymock
/**
* Switches the given mock object (more exactly: the control of the mock
* object) to replay mode. For details, see the EasyMock documentation.
*
* @param mock
* the mock object.
*/
public static void replay(Object mock) {
getControl(mock).replay();
}
代码示例来源:origin: org.easymock/com.springsource.org.easymock
/**
* Switches the given mock objects (more exactly: the controls of the mock
* objects) to replay mode. For details, see the EasyMock documentation.
*
* @param mocks
* the mock objects.
*/
public static void replay(Object... mocks) {
for (Object mock : mocks) {
getControl(mock).replay();
}
}
代码示例来源:origin: easymock/easymock
/**
* Verifies the given mock object (more exactly: the control of the mock
* object).
*
* @param mock
* the mock object.
*/
public static void verify(Object mock) {
getControl(mock).verify();
}
代码示例来源:origin: org.easymock/com.springsource.org.easymock
/**
* Resets the given mock objects (more exactly: the controls of the mock
* objects). For details, see the EasyMock documentation.
*
* @param mocks
* the mock objects.
*/
public static void reset(Object... mocks) {
for (Object mock : mocks) {
getControl(mock).reset();
}
}
代码示例来源:origin: org.easymock/com.springsource.org.easymock
/**
* Verifies the given mock objects (more exactly: the controls of the mock
* objects).
*
* @param mocks
* the mock objects.
*/
public static void verify(Object... mocks) {
for (Object mock : mocks) {
getControl(mock).verify();
}
}
代码示例来源:origin: easymock/easymock
/**
* Switches order checking of the given mock object (more exactly: the
* control of the mock object) the on and off. For details, see the EasyMock
* documentation.
*
* @param mock
* the mock object.
* @param state
* <code>true</code> switches order checking on,
* <code>false</code> switches it off.
*/
public static void checkOrder(Object mock, boolean state) {
getControl(mock).checkOrder(state);
}
代码示例来源:origin: easymock/easymock
/**
* Resets the given mock object (more exactly: the control of the mock
* object). For details, see the EasyMock documentation.
*
* @param mock
* the mock object.
*/
public static void reset(Object mock) {
getControl(mock).reset();
}
代码示例来源:origin: org.easymock/com.springsource.org.easymock
/**
* Resets the given mock objects (more exactly: the controls of the mock
* objects) and turn them to a mock with nice behavior. For details, see
* the EasyMock documentation.
*
* @param mocks
* the mock objects
*/
public static void resetToNice(Object... mocks) {
for (Object mock : mocks) {
getControl(mock).resetToNice();
}
}
代码示例来源:origin: org.easymock/com.springsource.org.easymock
/**
* Resets the given mock objects (more exactly: the controls of the mock
* objects) and turn them to a mock with strict behavior. For details, see
* the EasyMock documentation.
*
* @param mocks
* the mock objects
*/
public static void resetToStrict(Object... mocks) {
for (Object mock : mocks) {
getControl(mock).resetToStrict();
}
}
内容来源于网络,如有侵权,请联系作者删除!