Пример #1
0
 private void WriteRun(RunMessage message)
 {
     try
     {
         Packer.packStructHeader(2, RunMessage.SIGNATURE);
         Packer.pack(message.Statement());
         Packer.pack(message.Params());
     }
     catch (IOException e)
     {
         throw new UncheckedIOException(e);
     }
 }
Пример #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldDecodeAckFailure() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        internal virtual void ShouldDecodeAckFailure()
        {
            Neo4jPackV1 neo4jPack       = new Neo4jPackV1();
            RunMessage  originalMessage = new RunMessage("UNWIND range(1, 10) AS x RETURN x, $y", map(new string[] { "y" }, new AnyValue[] { longValue(42) }));

            PackedInputArray   innput   = new PackedInputArray(serialize(neo4jPack, originalMessage));
            Neo4jPack_Unpacker unpacker = neo4jPack.NewUnpacker(innput);

            // these two steps are executed before decoding in order to select a correct decoder
            unpacker.UnpackStructHeader();
            unpacker.UnpackStructSignature();

            RequestMessage deserializedMessage = _decoder.decode(unpacker);

            assertEquals(originalMessage, deserializedMessage);
        }
Пример #3
0
 private static bool Matches(RunMessage message, Pattern pattern)
 {
     return(pattern.matcher(message.Statement()).matches());
 }
Пример #4
0
 internal static bool IsRollback(RunMessage message)
 {
     return(Matches(message, _rollback));
 }
Пример #5
0
 internal static bool IsCommit(RunMessage message)
 {
     return(Matches(message, _commit));
 }
Пример #6
0
 internal static bool IsBegin(RunMessage message)
 {
     return(Matches(message, _begin));
 }