public StoreStreamingProcess(StoreFileStreamingProtocol protocol, System.Func <CheckPointer> checkPointerSupplier, StoreCopyCheckPointMutex mutex, StoreResourceStreamFactory resourceStreamFactory) { this._protocol = protocol; this._checkPointerSupplier = checkPointerSupplier; this._mutex = mutex; this._resourceStreamFactory = resourceStreamFactory; }
internal StoreCopyRequestHandler(CatchupServerProtocol protocol, System.Func <NeoStoreDataSource> dataSource, CheckPointerService checkPointerService, StoreFileStreamingProtocol storeFileStreamingProtocol, FileSystemAbstraction fs, LogProvider logProvider) { this._protocol = protocol; this._dataSource = dataSource; this._storeFileStreamingProtocol = storeFileStreamingProtocol; this._fs = fs; this._log = logProvider.GetLog(typeof(StoreCopyRequestHandler)); this._checkPointerService = checkPointerService; }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldBeAbleToEndWithSuccess() public virtual void ShouldBeAbleToEndWithSuccess() { // given StoreFileStreamingProtocol protocol = new StoreFileStreamingProtocol(); ChannelHandlerContext ctx = mock(typeof(ChannelHandlerContext)); // when protocol.End(ctx, StoreCopyFinishedResponse.Status.Success); // then InOrder inOrder = Mockito.inOrder(ctx); inOrder.verify(ctx).write(ResponseMessageType.STORE_COPY_FINISHED); inOrder.verify(ctx).writeAndFlush(new StoreCopyFinishedResponse(SUCCESS)); inOrder.verifyNoMoreInteractions(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldStreamResources() throws Exception //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ShouldStreamResources() { // given StoreFileStreamingProtocol protocol = new StoreFileStreamingProtocol(); ChannelHandlerContext ctx = mock(typeof(ChannelHandlerContext)); Fs.mkdir(new File("dirA")); Fs.mkdir(new File("dirB")); string[] files = new string[] { "dirA/one", "dirA/two", "dirB/one", "dirB/two", "one", "two", "three" }; IList <StoreResource> resourceList = new List <StoreResource>(); foreach (string file in files) { resourceList.Add(CreateResource(new File(file), ThreadLocalRandom.current().Next(1, 4096))); } RawCursor <StoreResource, IOException> resources = rawCursorOf(resourceList); // when while (resources.Next()) { protocol.Stream(ctx, resources.get()); } // then InOrder inOrder = Mockito.inOrder(ctx); foreach (StoreResource resource in resourceList) { inOrder.verify(ctx).write(ResponseMessageType.FILE); inOrder.verify(ctx).write(new FileHeader(resource.Path(), resource.RecordSize())); inOrder.verify(ctx).write(new FileSender(resource)); } verifyNoMoreInteractions(ctx); }
public GetIndexSnapshotRequestHandler(CatchupServerProtocol protocol, System.Func <NeoStoreDataSource> dataSource, CheckPointerService checkPointerService, StoreFileStreamingProtocol storeFileStreamingProtocol, FileSystemAbstraction fs, LogProvider logProvider) : base(protocol, dataSource, checkPointerService, storeFileStreamingProtocol, fs, logProvider) { }
internal EvilStoreCopyRequestHandler(StoreCopyRequestHandlerTest outerInstance, CatchupServerProtocol protocol, System.Func <NeoStoreDataSource> dataSource, StoreFileStreamingProtocol storeFileStreamingProtocol, FileSystemAbstraction fs, LogProvider logProvider) : base(protocol, dataSource, outerInstance.checkPointerService, storeFileStreamingProtocol, fs, logProvider) { this._outerInstance = outerInstance; }