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

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

本文整理了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

  1. /**
  2. * Creates a mock object that implements the given interface, order checking
  3. * is enabled by default.
  4. * <p>
  5. * <b>Note:</b> This is the old version of {@link #strictMock(Class)}, which is more completion friendly
  6. *
  7. * @param toMock
  8. * the class or interface that should be mocked.
  9. * @param <T>
  10. * the interface that the mock object should implement. It is expected to be of
  11. * class {@code toMock}.
  12. * @return the mock object.
  13. */
  14. public static <T> T createStrictMock(Class<?> toMock) {
  15. return strictMock(toMock);
  16. }

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

  1. /**
  2. * Creates a mock object that implements the given interface, order checking
  3. * is enabled by default.
  4. * <p>
  5. * <b>Note:</b> This is the old version of {@link #strictMock(String, Class)}, which is more completion friendly
  6. *
  7. * @param name
  8. * the name of the mock object.
  9. * @param toMock
  10. * the class or interface that should be mocked.
  11. * @param <T>
  12. * the interface that the mock object should implement. It is expected to be of
  13. * class {@code toMock}.
  14. * @return the mock object.
  15. * @throws IllegalArgumentException
  16. * if the name is not a valid Java identifier.
  17. */
  18. public static <T> T createStrictMock(String name, Class<?> toMock) {
  19. return strictMock(name, toMock);
  20. }

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

  1. @Before
  2. public void setup()
  3. {
  4. indexerMetadataStorageCoordinator = EasyMock.strictMock(IndexerMetadataStorageCoordinator.class);
  5. taskStorageQueryAdapter = EasyMock.strictMock(TaskStorageQueryAdapter.class);
  6. indexerMetadataStorageAdapter = new IndexerMetadataStorageAdapter(
  7. taskStorageQueryAdapter,
  8. indexerMetadataStorageCoordinator
  9. );
  10. }

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

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

相关文章