Example #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldParseHostnamePortCorrectly()
        public virtual void ShouldParseHostnamePortCorrectly()
        {
            Config config = Config.builder().withSetting(OnlineBackupSettings.online_backup_server, CombinedHostname()).build();
            ListenSocketAddress listenSocketAddress = HostnamePortAsListenAddress.Resolve(config, OnlineBackupSettings.online_backup_server);

            assertEquals(new ListenSocketAddress(SanitizedHostname, _port), listenSocketAddress);
        }
Example #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(expected = org.neo4j.graphdb.config.InvalidSettingException.class) public void shouldThrowInvalidSettingsExceptionOnBadFormat()
        public virtual void ShouldThrowInvalidSettingsExceptionOnBadFormat()
        {
            Config config = Config.builder().withSetting(OnlineBackupSettings.online_backup_server, "localhost").build();
            ListenSocketAddress listenSocketAddress = HostnamePortAsListenAddress.Resolve(config, OnlineBackupSettings.online_backup_server);

            assertEquals(OnlineBackupSettings.online_backup_server.DefaultValue, listenSocketAddress.ToString());
        }
Example #3
0
 public virtual Optional <Server> ResolveIfBackupEnabled(Config config)
 {
     if (config.Get(OnlineBackupSettings.online_backup_enabled))
     {
         ListenSocketAddress backupAddress = HostnamePortAsListenAddress.Resolve(config, OnlineBackupSettings.online_backup_server);
         _logProvider.getLog(typeof(TransactionBackupServiceProvider)).info("Binding backup service on address %s", backupAddress);
         return(Optional.of(new CatchupServerBuilder(_catchupServerHandler)
                            .serverHandler(_parentHandler).catchupProtocols(_catchupProtocols).modifierProtocols(_supportedModifierProtocols).pipelineBuilder(_serverPipelineBuilderFactory).userLogProvider(_userLogProvider).debugLogProvider(_logProvider).listenAddress(backupAddress).serverName("backup-server").build()));
     }
     else
     {
         return(null);
     }
 }