Example #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void copiesDatabaseFromOldLocationToNewLocation() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void CopiesDatabaseFromOldLocationToNewLocation()
        {
            File home = TestDir.directory("home");

            File from        = ProvideStoreDirectory();
            File destination = new File(new File(new File(home, "data"), "databases"), "bar");

            string[] arguments = new string[] { "--mode=database", "--database=bar", "--from=" + from.AbsolutePath };

            DatabaseImporter importer = new DatabaseImporter(Args.parse(arguments), GetConfigWith(home, "bar"), new NullOutsideWorld());

            assertThat(destination, not(ExistingDatabase));
            importer.DoImport();
            assertThat(destination, ExistingDatabase);
        }
Example #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void removesOldMessagesLog() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void RemovesOldMessagesLog()
        {
            File home = TestDir.directory();

            File from           = ProvideStoreDirectory();
            File oldMessagesLog = new File(from, "messages.log");

            assertTrue(oldMessagesLog.createNewFile());

            File destination = TestDir.databaseDir();

            string[]         arguments = new string[] { "--mode=database", "--database=bar", "--from=" + from.AbsolutePath };
            DatabaseImporter importer  = new DatabaseImporter(Args.parse(arguments), GetConfigWith(home, "bar"), new NullOutsideWorld());

            File messagesLog = new File(destination, "messages.log");

            importer.DoImport();
            assertFalse(messagesLog.exists());
        }