Search in sources :

Example 16 with BoltConnector

use of org.neo4j.kernel.configuration.BoltConnector 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 17 with BoltConnector

use of org.neo4j.kernel.configuration.BoltConnector 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 18 with BoltConnector

use of org.neo4j.kernel.configuration.BoltConnector 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)

Example 19 with BoltConnector

use of org.neo4j.kernel.configuration.BoltConnector in project neo4j by neo4j.

the class AbstractInProcessServerBuilder method init.

private void init(File workingDir) {
    setDirectory(workingDir);
    withConfig(auth_enabled, "false");
    withConfig(pagecache_memory, "8m");
    BoltConnector bolt0 = new BoltConnector("bolt");
    HttpConnector http1 = new HttpConnector("http", Encryption.NONE);
    HttpConnector http2 = new HttpConnector("https", Encryption.TLS);
    withConfig(http1.type, "HTTP");
    withConfig(http1.encryption, Encryption.NONE.name());
    withConfig(http1.enabled, "true");
    withConfig(http1.address, "localhost:" + Integer.toString(freePort(1001, 3000)));
    withConfig(http2.type, "HTTP");
    withConfig(http2.encryption, Encryption.TLS.name());
    withConfig(http2.enabled, "false");
    withConfig(http2.address, "localhost:" + Integer.toString(freePort(3001, 5000)));
    withConfig(bolt0.type, "BOLT");
    withConfig(bolt0.enabled, "true");
    withConfig(bolt0.address, "localhost:" + Integer.toString(freePort(5001, 9000)));
}
Also used : HttpConnector(org.neo4j.kernel.configuration.HttpConnector) BoltConnector(org.neo4j.kernel.configuration.BoltConnector)

Example 20 with BoltConnector

use of org.neo4j.kernel.configuration.BoltConnector in project neo4j by neo4j.

the class BoltIT method shouldLaunchBolt.

@Test
public void shouldLaunchBolt() throws Throwable {
    // When I run Neo4j with Bolt enabled
    server = server().withProperty(new BoltConnector("bolt").type.name(), "BOLT").withProperty(new BoltConnector("bolt").enabled.name(), "true").withProperty(new BoltConnector("bolt").encryption_level.name(), "REQUIRED").usingDataDir(tmpDir.getRoot().getAbsolutePath()).build();
    server.start();
    // Then
    assertEventuallyServerResponds("localhost", 7687);
}
Also used : BoltConnector(org.neo4j.kernel.configuration.BoltConnector) Test(org.junit.Test)

Aggregations

BoltConnector (org.neo4j.kernel.configuration.BoltConnector)21 Test (org.junit.Test)15 Config (org.neo4j.kernel.configuration.Config)14 ListenSocketAddress (org.neo4j.helpers.ListenSocketAddress)6 HashMap (java.util.HashMap)5 AdvertisedSocketAddress (org.neo4j.helpers.AdvertisedSocketAddress)4 File (java.io.File)3 Matchers.anyString (org.mockito.Matchers.anyString)3 MemberId (org.neo4j.causalclustering.identity.MemberId)3 MemberImpl (com.hazelcast.client.impl.MemberImpl)2 Member (com.hazelcast.core.Member)2 Address (com.hazelcast.nio.Address)2 ArrayList (java.util.ArrayList)2 HashSet (java.util.HashSet)2 HttpConnector (org.neo4j.kernel.configuration.HttpConnector)2 Matchers.containsString (org.hamcrest.Matchers.containsString)1 SocketConnection (org.neo4j.bolt.v1.transport.socket.client.SocketConnection)1 CoreTopologyService (org.neo4j.causalclustering.discovery.CoreTopologyService)1 HazelcastDiscoveryServiceFactory (org.neo4j.causalclustering.discovery.HazelcastDiscoveryServiceFactory)1 HostnamePort (org.neo4j.helpers.HostnamePort)1