org.easymock.EasyMock.strictMock()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(169)

本文整理了Java中org.easymock.EasyMock.strictMock()方法的一些代码示例,展示了EasyMock.strictMock()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。EasyMock.strictMock()方法的具体详情如下:
包路径:org.easymock.EasyMock
类名称:EasyMock
方法名:strictMock

EasyMock.strictMock介绍

[英]Creates a mock object that implements the given interface, order checking is enabled by default.
[中]创建实现给定接口的模拟对象,默认情况下启用顺序检查。

代码示例

代码示例来源:origin: org.easymock/easymock

/**
 * Creates a mock object that implements the given interface, order checking
 * is enabled by default.
 * <p>
 * <b>Note:</b> This is the old version of {@link #strictMock(Class)}, which is more completion friendly
 *
 * @param toMock
 *            the class or interface that should be mocked.
 * @param <T>
 *            the interface that the mock object should implement. It is expected to be of
 *            class {@code toMock}.
 * @return the mock object.
 */
public static <T> T createStrictMock(Class<?> toMock) {
  return strictMock(toMock);
}

代码示例来源:origin: org.easymock/easymock

/**
 * Creates a mock object that implements the given interface, order checking
 * is enabled by default.
 * <p>
 * <b>Note:</b> This is the old version of {@link #strictMock(String, Class)}, which is more completion friendly
 *
 * @param name
 *            the name of the mock object.
 * @param toMock
 *            the class or interface that should be mocked.
 * @param <T>
 *            the interface that the mock object should implement. It is expected to be of
 *            class {@code toMock}.
 * @return the mock object.
 * @throws IllegalArgumentException
 *             if the name is not a valid Java identifier.
 */
public static <T> T createStrictMock(String name, Class<?> toMock) {
  return strictMock(name, toMock);
}

代码示例来源:origin: apache/incubator-druid

@Before
public void setup()
{
 indexerMetadataStorageCoordinator = EasyMock.strictMock(IndexerMetadataStorageCoordinator.class);
 taskStorageQueryAdapter = EasyMock.strictMock(TaskStorageQueryAdapter.class);
 indexerMetadataStorageAdapter = new IndexerMetadataStorageAdapter(
   taskStorageQueryAdapter,
   indexerMetadataStorageCoordinator
 );
}

代码示例来源:origin: hibernate/hibernate-search

final String rowsPerPartition = String.valueOf( 3 );
mockedJobContext = strictMock( JobContext.class );
partitionMapper = new PartitionMapper(
    fetchSize,

相关文章