コード例 #1
0
 @Test(groups = "unit", dataProvider = "bool1", dataProviderClass = TestNGDataProviders.class)
 public void upload(final boolean shouldCommit) throws RemoteException {
   handleShouldCommit(shouldCommit);
   allowUpload();
   mockObjects.replay();
   final InputStream inputStream = new ByteArrayInputStream("moo".getBytes());
   final UploadCallback callback = service.upload(fileId, gridId);
   mockObjects.verifyAndReset();
   final long length = 3L;
   EasyMock.expect(accessProvider.putFile(EasyMock.eq(fileId), EasyMock.same(inputStream)))
       .andReturn(length);
   expectFinalizeAndReplay(shouldCommit, length);
   callback.onUpload(inputStream);
   mockObjects.verifyAndReset();
 }
コード例 #2
0
ファイル: FileMapperImpl.java プロジェクト: jj-umn/TINT
 public void handleUpload(final String fileKey, final InputStream inputStream) {
   final UploadCallback uploadCallback = (UploadCallback) fileMap.remove(fileKey);
   uploadCallback.onUpload(inputStream);
 }