Example #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldStreamBackTransactions() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldStreamBackTransactions()
        {
            // GIVEN
            int value   = 11;
            int txCount = 5;

            _life.add(_builder.server());
            MadeUpClient client = _life.add(_builder.client());

            _life.start();
            Response <int> response = client.StreamBackTransactions(value, txCount);
            TransactionStreamVerifyingResponseHandler handler = new TransactionStreamVerifyingResponseHandler(this, txCount);

            // WHEN
            response.Accept(handler);
            int responseValue = response.ResponseConflict();

            // THEN
            assertEquals(value, responseValue);
            assertEquals(txCount, handler.ExpectedTxId - Org.Neo4j.Kernel.impl.transaction.log.TransactionIdStore_Fields.BASE_TX_ID);
        }
Example #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void internalProtocolVersionsMustMatchMultiJvm()
        public virtual void InternalProtocolVersionsMustMatchMultiJvm()
        {
            ServerInterface server = _builder.internalProtocolVersion(( sbyte )1).serverInOtherJvm(_port);

            server.AwaitStarted();
            MadeUpClient client = _builder.port(_port).internalProtocolVersion(( sbyte )2).client();

            _life.add(client);
            _life.start();

            try
            {
                client.Multiply(10, 20);
                fail("Shouldn't be able to communicate with different application protocol versions");
            }
            catch (IllegalProtocolVersionException)
            {
            }

            server.Shutdown();
        }
Example #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void serverContextVerificationCanThrowException()
        public virtual void ServerContextVerificationCanThrowException()
        {
            const string       failureMessage  = "I'm failing";
            TxChecksumVerifier failingVerifier = (txId, checksum) =>
            {
                throw new FailingException(failureMessage);
            };

            MadeUpServer server = _builder.verifier(failingVerifier).server();
            MadeUpClient client = _builder.client();

            AddToLifeAndStart(server, client);

            try
            {
                client.Multiply(10, 5);
                fail("Should have failed");
            }
            catch (Exception)
            {               // Good
                // TODO catch FailingException instead of Exception and make Server throw the proper
                // one instead of getting a "channel closed".
            }
        }