本文整理了Java中org.easymock.EasyMock.captureLong()
方法的一些代码示例,展示了EasyMock.captureLong()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。EasyMock.captureLong()
方法的具体详情如下:
包路径:org.easymock.EasyMock
类名称: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();
内容来源于网络,如有侵权,请联系作者删除!