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

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

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

@Test
public void testSaveAndRestore() throws IOException {
 expect(storageRpcMock.open(BLOB_INFO.toPb(), EMPTY_RPC_OPTIONS)).andReturn(UPLOAD_ID);
 Capture<byte[]> capturedBuffer = Capture.newInstance(CaptureType.ALL);
 Capture<Long> capturedPosition = Capture.newInstance(CaptureType.ALL);
 storageRpcMock.write(
   eq(UPLOAD_ID),
   capture(capturedBuffer),
   eq(0),
   captureLong(capturedPosition),
   eq(DEFAULT_CHUNK_SIZE),
   eq(false));
 expectLastCall().times(2);
 replay(storageRpcMock);
 ByteBuffer buffer1 = randomBuffer(DEFAULT_CHUNK_SIZE);
 ByteBuffer buffer2 = randomBuffer(DEFAULT_CHUNK_SIZE);
 writer = new BlobWriteChannel(options, BLOB_INFO, EMPTY_RPC_OPTIONS);
 assertEquals(DEFAULT_CHUNK_SIZE, writer.write(buffer1));
 assertArrayEquals(buffer1.array(), capturedBuffer.getValues().get(0));
 assertEquals(new Long(0L), capturedPosition.getValues().get(0));
 RestorableState<WriteChannel> writerState = writer.capture();
 WriteChannel restoredWriter = writerState.restore();
 assertEquals(DEFAULT_CHUNK_SIZE, restoredWriter.write(buffer2));
 assertArrayEquals(buffer2.array(), capturedBuffer.getValues().get(1));
 assertEquals(new Long(DEFAULT_CHUNK_SIZE), capturedPosition.getValues().get(1));
}

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

capture(capturedBuffer),
eq(0),
captureLong(capturedPosition),
eq(DEFAULT_CHUNK_SIZE),
eq(false)))

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

eq(0L),
    eq(0),
    captureLong(sizeCapture));
EasyMock.expectLastCall();

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

eq(0L),
    eq(0),
    captureLong(sizeCapture));
EasyMock.expectLastCall();

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

eq(0L),
    eq(0),
    captureLong(sizeCapture1));
EasyMock.expectLastCall();
listener.tileStored(
    eq(0L),
    eq(0),
    captureLong(sizeCapture2));
EasyMock.expectLastCall();

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

eq(0L),
    eq(0),
    captureLong(sizeCapture1));
EasyMock.expectLastCall();
listener.tileStored(
    eq(0L),
    eq(0),
    captureLong(sizeCapture2));
EasyMock.expectLastCall();

相关文章