예제 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldApplySomeTransactions() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldApplySomeTransactions()
        {
            // This tests the basic functionality of this tool, there are more things, but it's not as important
            // to test as the functionality of applying transactions.

            // GIVEN
            File           from = Directory.directory("from");
            DatabaseLayout to   = Directory.databaseLayout("to");

            DatabaseWithSomeTransactions(from);
            DatabaseRebuildTool tool = new DatabaseRebuildTool(Input("apply next", "apply next", "cc", "exit"), NULL_PRINT_STREAM, NULL_PRINT_STREAM);

            // WHEN
            tool.Run("--from", from.AbsolutePath, "--to", to.DatabaseDirectory().Path, "-i");

            // THEN
            assertEquals(Org.Neo4j.Kernel.impl.transaction.log.TransactionIdStore_Fields.BASE_TX_ID + 2, LastAppliedTx(to));
        }
예제 #2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private void shouldPrint(String command, String... expectedResultContaining) throws Exception
        private void ShouldPrint(string command, params string[] expectedResultContaining)
        {
            // GIVEN
            File from = Directory.directory("from");
            File to   = Directory.directory("to");

            DatabaseWithSomeTransactions(to);
            MemoryStream        byteArrayOut = new MemoryStream();
            PrintStream         @out         = new PrintStream(byteArrayOut);
            DatabaseRebuildTool tool         = new DatabaseRebuildTool(Input(command, "exit"), @out, NULL_PRINT_STREAM);

            // WHEN
            tool.Run("--from", from.AbsolutePath, "--to", to.AbsolutePath, "-i");

            // THEN
            @out.flush();
            string dump = StringHelper.NewString(byteArrayOut.toByteArray());

            foreach (string @string in expectedResultContaining)
            {
                assertThat("dump from command '" + command + "'", dump, containsString(@string));
            }
        }