コード例 #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);
        }
コード例 #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());
        }
コード例 #3
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: Importer getImporterForMode(String mode, org.neo4j.helpers.Args parsedArgs, org.neo4j.kernel.configuration.Config config, org.neo4j.commandline.admin.OutsideWorld outsideWorld) throws org.neo4j.commandline.admin.IncorrectUsage, org.neo4j.commandline.admin.CommandFailed
        internal virtual Importer GetImporterForMode(string mode, Args parsedArgs, Config config, OutsideWorld outsideWorld)
        {
            Importer importer;

            switch (mode)
            {
            case "database":
                importer = new DatabaseImporter(parsedArgs, config, outsideWorld);
                break;

            case "csv":
                importer = new CsvImporter(parsedArgs, config, outsideWorld);
                break;

            default:
                throw new CommandFailed("Invalid mode specified.");                           // This won't happen because mode is mandatory.
            }
            return(importer);
        }