Search in sources :

Example 26 with ListenSocketAddress

use of org.neo4j.helpers.ListenSocketAddress in project neo4j by neo4j.

the class ListenAddressSettingsTest method shouldParseExplicitSettingValueWhenProvided.

@Test
public void shouldParseExplicitSettingValueWhenProvided() throws Exception {
    // given
    Map<String, String> config = stringMap(GraphDatabaseSettings.default_listen_address.name(), "server1.example.com", listen_address_setting.name(), "server1.internal:4000");
    // when
    ListenSocketAddress listenSocketAddress = listen_address_setting.apply(config::get);
    // then
    assertEquals("server1.internal", listenSocketAddress.getHostname());
    assertEquals(4000, listenSocketAddress.getPort());
}
Also used : ListenSocketAddress(org.neo4j.helpers.ListenSocketAddress) Test(org.junit.Test)

Aggregations

ListenSocketAddress (org.neo4j.helpers.ListenSocketAddress)26 Test (org.junit.Test)23 Config (org.neo4j.kernel.configuration.Config)15 BoltConnector (org.neo4j.kernel.configuration.BoltConnector)8 AdvertisedSocketAddress (org.neo4j.helpers.AdvertisedSocketAddress)4 HttpConnector (org.neo4j.kernel.configuration.HttpConnector)4 ServerSocket (java.net.ServerSocket)2 HashMap (java.util.HashMap)2 List (java.util.List)2 Map (java.util.Map)2 BiFunction (java.util.function.BiFunction)2 NettyServer (org.neo4j.bolt.transport.NettyServer)2 Configuration (org.neo4j.graphdb.config.Configuration)2 Setting (org.neo4j.graphdb.config.Setting)2 JobScheduler (org.neo4j.kernel.impl.util.JobScheduler)2 AssertableLogProvider (org.neo4j.logging.AssertableLogProvider)2 InterfacesConfig (com.hazelcast.config.InterfacesConfig)1 JoinConfig (com.hazelcast.config.JoinConfig)1 MemberAttributeConfig (com.hazelcast.config.MemberAttributeConfig)1 NetworkConfig (com.hazelcast.config.NetworkConfig)1