Search in sources :

Example 21 with ListenSocketAddress

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

the class GraphDatabaseSettingsTest method shouldBeAbleToOverrideHttpsListenAddressWithJustOneParameter.

@Test
public void shouldBeAbleToOverrideHttpsListenAddressWithJustOneParameter() throws Exception {
    // given
    Config config = Config.embeddedDefaults(stringMap("dbms.connector.https.enabled", "true", "dbms.connector.https.listen_address", ":8000"));
    // then
    assertEquals(1, config.enabledHttpConnectors().size());
    HttpConnector httpConnector = config.enabledHttpConnectors().get(0);
    assertEquals(new ListenSocketAddress("localhost", 8000), config.get(httpConnector.listen_address));
}
Also used : HttpConnector(org.neo4j.kernel.configuration.HttpConnector) Config(org.neo4j.kernel.configuration.Config) ListenSocketAddress(org.neo4j.helpers.ListenSocketAddress) Test(org.junit.Test)

Example 22 with ListenSocketAddress

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

the class GraphDatabaseSettingsTest method shouldBeAbleToOverrideBoltListenAddressesWithJustOneParameter.

@Test
public void shouldBeAbleToOverrideBoltListenAddressesWithJustOneParameter() throws Exception {
    // given
    Config config = Config.embeddedDefaults(stringMap("dbms.connector.bolt.enabled", "true", "dbms.connector.bolt.listen_address", ":8000"));
    BoltConnector boltConnector = config.boltConnectors().get(0);
    // then
    assertEquals(new ListenSocketAddress("localhost", 8000), config.get(boltConnector.listen_address));
}
Also used : BoltConnector(org.neo4j.kernel.configuration.BoltConnector) Config(org.neo4j.kernel.configuration.Config) ListenSocketAddress(org.neo4j.helpers.ListenSocketAddress) Test(org.junit.Test)

Example 23 with ListenSocketAddress

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

the class GraphDatabaseSettingsTest method shouldDeriveBoltListenAddressFromDefaultListenAddress.

@Test
public void shouldDeriveBoltListenAddressFromDefaultListenAddress() throws Exception {
    // given
    Config config = Config.embeddedDefaults(stringMap("dbms.connector.bolt.enabled", "true", "dbms.connectors.default_listen_address", "0.0.0.0"));
    BoltConnector boltConnector = config.boltConnectors().get(0);
    // then
    assertEquals(new ListenSocketAddress("0.0.0.0", 7687), config.get(boltConnector.listen_address));
}
Also used : BoltConnector(org.neo4j.kernel.configuration.BoltConnector) Config(org.neo4j.kernel.configuration.Config) ListenSocketAddress(org.neo4j.helpers.ListenSocketAddress) Test(org.junit.Test)

Example 24 with ListenSocketAddress

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

the class GraphDatabaseSettingsTest method shouldDeriveListenAddressFromDefaultListenAddressAndSpecifiedPorts.

@Test
public void shouldDeriveListenAddressFromDefaultListenAddressAndSpecifiedPorts() throws Exception {
    // given
    Config config = Config.embeddedDefaults(stringMap("dbms.connector.https.enabled", "true", "dbms.connector.http.enabled", "true", "dbms.connectors.default_listen_address", "0.0.0.0", "dbms.connector.http.listen_address", ":8000", "dbms.connector.https.listen_address", ":9000"));
    // then
    assertEquals(2, config.enabledHttpConnectors().size());
    config.enabledHttpConnectors().forEach(c -> {
        if (c.key().equals("https")) {
            assertEquals(new ListenSocketAddress("0.0.0.0", 9000), config.get(c.listen_address));
        } else {
            assertEquals(new ListenSocketAddress("0.0.0.0", 8000), config.get(c.listen_address));
        }
    });
}
Also used : Config(org.neo4j.kernel.configuration.Config) ListenSocketAddress(org.neo4j.helpers.ListenSocketAddress) Test(org.junit.Test)

Example 25 with ListenSocketAddress

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

the class GraphDatabaseSettingsTest method shouldDeriveBoltListenAddressFromDefaultListenAddressAndSpecifiedPort.

@Test
public void shouldDeriveBoltListenAddressFromDefaultListenAddressAndSpecifiedPort() throws Exception {
    // given
    Config config = Config.embeddedDefaults(stringMap("dbms.connectors.default_listen_address", "0.0.0.0", "dbms.connector.bolt.enabled", "true", "dbms.connector.bolt.listen_address", ":8000"));
    BoltConnector boltConnector = config.boltConnectors().get(0);
    // then
    assertEquals(new ListenSocketAddress("0.0.0.0", 8000), config.get(boltConnector.listen_address));
}
Also used : BoltConnector(org.neo4j.kernel.configuration.BoltConnector) Config(org.neo4j.kernel.configuration.Config) 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