//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void noPortResolvesToDefault_ha() public virtual void NoPortResolvesToDefaultHa() { // given int?portIsNotSupplied = null; // when HostnamePort resolved = Subject.resolveCorrectHAAddress(DefaultConfig, new OptionalHostnamePort("localhost", portIsNotSupplied, null)); // then assertEquals(6362, resolved.Port); }
public override Fallible <BackupStageOutcome> PerformIncrementalBackup(DatabaseLayout targetDatabaseLayout, Config config, OptionalHostnamePort fromAddress) { HostnamePort resolvedAddress = _addressResolver.resolveCorrectHAAddress(config, fromAddress); _log.info("Resolved address for backup protocol is " + resolvedAddress); try { string host = resolvedAddress.Host; int port = resolvedAddress.Port; _backupProtocolService.doIncrementalBackup(host, port, targetDatabaseLayout, ConsistencyCheck.NONE, _timeout, config); return(new Fallible <BackupStageOutcome>(BackupStageOutcome.Success, null)); } catch (MismatchingStoreIdException e) { return(new Fallible <BackupStageOutcome>(BackupStageOutcome.UnrecoverableFailure, e)); } catch (Exception e) { return(new Fallible <BackupStageOutcome>(BackupStageOutcome.Failure, e)); } }
//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(OnlineBackupContext.RequiredArguments).thenReturn(RequiredArgs); when(AddressResolver.resolveCorrectHAAddress(any(), any())).thenReturn(HostnamePort); Subject = new HaBackupStrategy(_backupProtocolService, AddressResolver, NullLogProvider.Instance, 0); }