Exemplo n.º 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void setup()
        public virtual void Setup()
        {
            _backupDirectory = TestDirectory.directory("backupDirectory").toPath();
            _reportDirectory = TestDirectory.directory("reportDirectory/").toPath();
            BackupSupportingClasses backupSupportingClasses = new BackupSupportingClasses(mock(typeof(BackupDelegator)), mock(typeof(BackupProtocolService)), mock(typeof(PageCache)), Collections.emptyList());

            when(_backupSupportingClassesFactory.createSupportingClasses(any())).thenReturn(backupSupportingClasses);

            _requiredArguments = new OnlineBackupRequiredArguments(_address, _backupDirectory, _backupName, SelectedBackupProtocol.Any, _fallbackToFull, _doConsistencyCheck, _timeout, _reportDirectory);
            OnlineBackupContext onlineBackupContext = new OnlineBackupContext(_requiredArguments, _config, _consistencyFlags);

            when(_backupStrategyCoordinatorFactory.backupStrategyCoordinator(any(), any(), any(), any())).thenReturn(_backupStrategyCoordinator);

            _subject = NewOnlineBackupCommand(_outsideWorld, onlineBackupContext, _backupSupportingClassesFactory, _backupStrategyCoordinatorFactory);
        }
Exemplo n.º 2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void execute(String[] args) throws org.neo4j.commandline.admin.IncorrectUsage, org.neo4j.commandline.admin.CommandFailed
        public override void Execute(string[] args)
        {
            OnlineBackupContext onlineBackupContext = _contextBuilder.createContext(args);

            ProtocolWarn(onlineBackupContext);
            using (BackupSupportingClasses backupSupportingClasses = _backupSupportingClassesFactory.createSupportingClasses(onlineBackupContext.Config))
            {
                // Make sure destination exists
                CheckDestination(onlineBackupContext.RequiredArguments.Directory);
                CheckDestination(onlineBackupContext.RequiredArguments.ReportDir);

                BackupStrategyCoordinator backupStrategyCoordinator = _backupStrategyCoordinatorFactory.backupStrategyCoordinator(onlineBackupContext, backupSupportingClasses.BackupProtocolService, backupSupportingClasses.BackupDelegator, backupSupportingClasses.PageCache);

                backupStrategyCoordinator.PerformBackup(onlineBackupContext);
                _outsideWorld.stdOutLine("Backup complete.");
            }
        }