예제 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Override public void bulk(@Nonnull Consumer<org.neo4j.logging.Log> consumer)
        public override void Bulk(Consumer <Log> consumer)
        {
            PrintWriter writer;

            lock (this)
            {
                writer = _writerSupplier.get();
                consumer.accept(new ConsistencyReportLog(Suppliers.singleton(writer), @lock, false));
            }
        }
예제 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldResolveMasterClientFactory()
        public virtual void ShouldResolveMasterClientFactory()
        {
            // Given
            LogEntryReader <ReadableClosablePositionAwareChannel> logEntryReader = new VersionAwareLogEntryReader <ReadableClosablePositionAwareChannel>();
            MasterClientResolver resolver = new MasterClientResolver(NullLogProvider.Instance, Org.Neo4j.com.storecopy.ResponseUnpacker_Fields.NoOpResponseUnpacker, mock(typeof(InvalidEpochExceptionHandler)), 1, 1, 1, 1024, Suppliers.singleton(logEntryReader));

            LifeSupport life = new LifeSupport();

            try
            {
                life.Start();
                MasterClient masterClient1 = resolver.Instantiate("cluster://localhost", 44, null, new Monitors(), StoreId.DEFAULT, life);
                assertThat(masterClient1, instanceOf(typeof(MasterClient320)));
            }
            finally
            {
                life.Shutdown();
            }

            IllegalProtocolVersionException illegalProtocolVersionException = new IllegalProtocolVersionException(MasterClient214.PROTOCOL_VERSION.ApplicationProtocol, MasterClient310.PROTOCOL_VERSION.ApplicationProtocol, "Protocol is too modern");

            // When
            resolver.Handle(illegalProtocolVersionException);

            // Then
            life = new LifeSupport();
            try
            {
                life.Start();
                MasterClient masterClient2 = resolver.Instantiate("cluster://localhost", 55, null, new Monitors(), StoreId.DEFAULT, life);

                assertThat(masterClient2, instanceOf(typeof(MasterClient214)));
            }
            finally
            {
                life.Shutdown();
            }
        }
예제 #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldNotThrowNPEWhenAskedToFulFilledButNotYetHavingARoleAssigned() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldNotThrowNPEWhenAskedToFulFilledButNotYetHavingARoleAssigned()
        {
            // Given
            UpdatePullingTransactionObligationFulfiller fulfiller = new UpdatePullingTransactionObligationFulfiller(_updatePuller, _machine, _serverId, Suppliers.singleton(mock(typeof(TransactionIdStore))));

            // When
            fulfiller.Fulfill(1);

            // Then
            // it doesn't blow up
        }