Beispiel #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()
        {
            when(_reportDir.toFile()).thenReturn(TestDirectory.databaseLayout().databaseDirectory());
            when(_outsideWorld.fileSystem()).thenReturn(_fileSystem);
            when(_onlineBackupContext.RequiredArguments).thenReturn(_requiredArguments);
            when(_onlineBackupContext.ResolvedLocationFromName).thenReturn(_reportDir);
            when(_requiredArguments.ReportDir).thenReturn(_reportDir);
            _subject = new BackupStrategyCoordinator(_consistencyCheckService, _outsideWorld, _logProvider, _progressMonitorFactory, Arrays.asList(_firstStrategy, _secondStrategy));
        }
Beispiel #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void havingNoStrategiesCausesAllSolutionsFailedException() throws org.neo4j.commandline.admin.CommandFailed
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void HavingNoStrategiesCausesAllSolutionsFailedException()
        {
            // given there are no strategies in the solution
            _subject = new BackupStrategyCoordinator(_consistencyCheckService, _outsideWorld, _logProvider, _progressMonitorFactory, Collections.emptyList());

            // then we want a predictable exception (instead of NullPointer)
            ExpectedException.expect(typeof(CommandFailed));
            ExpectedException.expectMessage("Failed to run a backup using the available strategies.");

            // when
            _subject.performBackup(_onlineBackupContext);
        }
Beispiel #3
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.");
            }
        }