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 TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void protocolOverrideWarnsUser() throws org.neo4j.commandline.admin.CommandFailed, org.neo4j.commandline.admin.IncorrectUsage
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ProtocolOverrideWarnsUser()
        {
            // with
            IList <object[]> cases = new IList <object[]>
            {
                new object[] { SelectedBackupProtocol.Catchup, string.Format("The selected protocol `catchup` means that it is only compatible with causal clustering instances%n") },
                new object[] { SelectedBackupProtocol.Common, string.Format("The selected protocol `common` means that it is only compatible with HA and single instances%n") }
            };

            foreach (object[] thisCase in cases)
            {
                // given
                _requiredArguments = new OnlineBackupRequiredArguments(_address, _backupDirectory, _backupName, ( SelectedBackupProtocol )thisCase[0], _fallbackToFull, _doConsistencyCheck, _timeout, _reportDirectory);
                OnlineBackupContext onlineBackupContext = new OnlineBackupContext(_requiredArguments, _config, _consistencyFlags);
                _subject = NewOnlineBackupCommand(_outsideWorld, onlineBackupContext, _backupSupportingClassesFactory, _backupStrategyCoordinatorFactory);

                // when
                Execute();

                // then
                assertThat(_baosOut.ToString(), containsString((string)thisCase[1]));
                _baosOut.reset();
            }
        }