예제 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void setup() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void Setup()
        {
            _logProvider   = new DuplicatingLogProvider(_assertableLogProvider, FormattedLogProvider.withDefaultLogLevel(Level.DEBUG).toOutputStream(System.out));
            _serverHandler = new TestCatchupServerHandler(_logProvider, TestDirectory, _fsa);
            _serverHandler.addFile(_fileA);
            _serverHandler.addFile(_fileB);
            _serverHandler.addIndexFile(_indexFileA);
            WriteContents(_fsa, Relative(_fileA.Filename), _fileA.Content);
            WriteContents(_fsa, Relative(_fileB.Filename), _fileB.Content);
            WriteContents(_fsa, Relative(_indexFileA.Filename), _indexFileA.Content);

            ListenSocketAddress listenAddress = new ListenSocketAddress("localhost", PortAuthority.allocatePort());

            _catchupServer = (new CatchupServerBuilder(_serverHandler)).listenAddress(listenAddress).build();
            _catchupServer.start();

            CatchUpClient catchUpClient = (new CatchupClientBuilder()).build();

            catchUpClient.Start();

            ConstantTimeTimeoutStrategy storeCopyBackoffStrategy = new ConstantTimeTimeoutStrategy(1, TimeUnit.MILLISECONDS);

            Monitors monitors = new Monitors();

            _subject = new StoreCopyClient(catchUpClient, monitors, _logProvider, storeCopyBackoffStrategy);
        }
예제 #2
0
 public SimpleChannelInboundHandlerAnonymousInnerClass(TestCatchupServerHandler outerInstance, CatchupServerProtocol catchupServerProtocol)
 {
     this.outerInstance          = outerInstance;
     this._catchupServerProtocol = catchupServerProtocol;
 }