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

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

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

EasyMock.captureLong介绍

[英]Expect any long but captures it for later use.
[中]期待任何长的,但捕获它供以后使用。

代码示例

代码示例来源:origin: googleapis/google-cloud-java

  1. @Test
  2. public void testSaveAndRestore() throws IOException {
  3. expect(storageRpcMock.open(BLOB_INFO.toPb(), EMPTY_RPC_OPTIONS)).andReturn(UPLOAD_ID);
  4. Capture<byte[]> capturedBuffer = Capture.newInstance(CaptureType.ALL);
  5. Capture<Long> capturedPosition = Capture.newInstance(CaptureType.ALL);
  6. storageRpcMock.write(
  7. eq(UPLOAD_ID),
  8. capture(capturedBuffer),
  9. eq(0),
  10. captureLong(capturedPosition),
  11. eq(DEFAULT_CHUNK_SIZE),
  12. eq(false));
  13. expectLastCall().times(2);
  14. replay(storageRpcMock);
  15. ByteBuffer buffer1 = randomBuffer(DEFAULT_CHUNK_SIZE);
  16. ByteBuffer buffer2 = randomBuffer(DEFAULT_CHUNK_SIZE);
  17. writer = new BlobWriteChannel(options, BLOB_INFO, EMPTY_RPC_OPTIONS);
  18. assertEquals(DEFAULT_CHUNK_SIZE, writer.write(buffer1));
  19. assertArrayEquals(buffer1.array(), capturedBuffer.getValues().get(0));
  20. assertEquals(new Long(0L), capturedPosition.getValues().get(0));
  21. RestorableState<WriteChannel> writerState = writer.capture();
  22. WriteChannel restoredWriter = writerState.restore();
  23. assertEquals(DEFAULT_CHUNK_SIZE, restoredWriter.write(buffer2));
  24. assertArrayEquals(buffer2.array(), capturedBuffer.getValues().get(1));
  25. assertEquals(new Long(DEFAULT_CHUNK_SIZE), capturedPosition.getValues().get(1));
  26. }

代码示例来源:origin: googleapis/google-cloud-java

  1. capture(capturedBuffer),
  2. eq(0),
  3. captureLong(capturedPosition),
  4. eq(DEFAULT_CHUNK_SIZE),
  5. eq(false)))

代码示例来源:origin: GeoWebCache/geowebcache

  1. eq(0L),
  2. eq(0),
  3. captureLong(sizeCapture));
  4. EasyMock.expectLastCall();

代码示例来源:origin: GeoWebCache/geowebcache

  1. eq(0L),
  2. eq(0),
  3. captureLong(sizeCapture));
  4. EasyMock.expectLastCall();

代码示例来源:origin: GeoWebCache/geowebcache

  1. eq(0L),
  2. eq(0),
  3. captureLong(sizeCapture1));
  4. EasyMock.expectLastCall();
  5. listener.tileStored(
  6. eq(0L),
  7. eq(0),
  8. captureLong(sizeCapture2));
  9. EasyMock.expectLastCall();

代码示例来源:origin: GeoWebCache/geowebcache

  1. eq(0L),
  2. eq(0),
  3. captureLong(sizeCapture1));
  4. EasyMock.expectLastCall();
  5. listener.tileStored(
  6. eq(0L),
  7. eq(0),
  8. captureLong(sizeCapture2));
  9. EasyMock.expectLastCall();

相关文章