use of org.neo4j.helpers.ListenSocketAddress in project neo4j by neo4j.
the class GraphDatabaseSettingsTest method shouldStillSupportCustomNameForHttpConnector.
@Test
public void shouldStillSupportCustomNameForHttpConnector() throws Exception {
Config config = Config.embeddedDefaults(stringMap("dbms.connector.random_name_that_will_be_unsupported.type", "HTTP", "dbms.connector.random_name_that_will_be_unsupported.encryption", "NONE", "dbms.connector.random_name_that_will_be_unsupported.enabled", "true", "dbms.connector.random_name_that_will_be_unsupported.listen_address", ":8000"));
// then
assertEquals(1, config.enabledHttpConnectors().size());
assertEquals(new ListenSocketAddress("localhost", 8000), config.get(config.enabledHttpConnectors().get(0).listen_address));
}
use of org.neo4j.helpers.ListenSocketAddress in project neo4j by neo4j.
the class GraphDatabaseSettingsTest method shouldStillSupportCustomNameForHttpsConnector.
@Test
public void shouldStillSupportCustomNameForHttpsConnector() throws Exception {
Config config = Config.embeddedDefaults(stringMap("dbms.connector.random_name_that_will_be_unsupported.type", "HTTP", "dbms.connector.random_name_that_will_be_unsupported.encryption", "TLS", "dbms.connector.random_name_that_will_be_unsupported.enabled", "true", "dbms.connector.random_name_that_will_be_unsupported.listen_address", ":9000"));
// then
assertEquals(1, config.enabledHttpConnectors().size());
assertEquals(new ListenSocketAddress("localhost", 9000), config.get(config.enabledHttpConnectors().get(0).listen_address));
}
use of org.neo4j.helpers.ListenSocketAddress in project neo4j by neo4j.
the class GraphDatabaseSettingsTest method shouldSupportMultipleBoltConnectorsWithDefaultAndCustomName.
@Test
public void shouldSupportMultipleBoltConnectorsWithDefaultAndCustomName() throws Exception {
Config config = Config.embeddedDefaults(stringMap("dbms.connector.bolt.type", "BOLT", "dbms.connector.bolt.enabled", "true", "dbms.connector.bolt.listen_address", ":8000", "dbms.connector.bolt2.type", "BOLT", "dbms.connector.bolt2.enabled", "true", "dbms.connector.bolt2.listen_address", ":9000"));
// when
BoltConnector boltConnector1 = config.boltConnectors().get(0);
BoltConnector boltConnector2 = config.boltConnectors().get(1);
// then
assertEquals(new ListenSocketAddress("localhost", 8000), config.get(boltConnector1.listen_address));
assertEquals(new ListenSocketAddress("localhost", 9000), config.get(boltConnector2.listen_address));
}
use of org.neo4j.helpers.ListenSocketAddress in project neo4j by neo4j.
the class GraphDatabaseSettingsTest method shouldEnableBoltByDefault.
@Test
public void shouldEnableBoltByDefault() throws Exception {
// given
Config config = Config.serverDefaults();
// when
BoltConnector boltConnector = config.boltConnectors().get(0);
ListenSocketAddress listenSocketAddress = config.get(boltConnector.listen_address);
// then
assertEquals(new ListenSocketAddress("localhost", 7687), listenSocketAddress);
}
use of org.neo4j.helpers.ListenSocketAddress in project neo4j by neo4j.
the class GraphDatabaseSettingsTest method testServerDefaultSettings.
/// JONAS HTTP FOLLOWS
@Test
public void testServerDefaultSettings() throws Exception {
// given
Config config = Config.serverDefaults();
// when
List<HttpConnector> connectors = config.httpConnectors();
// then
assertEquals(2, connectors.size());
if (connectors.get(0).encryptionLevel().equals(TLS)) {
assertEquals(new ListenSocketAddress("localhost", 7474), config.get(connectors.get(1).listen_address));
assertEquals(new ListenSocketAddress("localhost", 7473), config.get(connectors.get(0).listen_address));
} else {
assertEquals(new ListenSocketAddress("localhost", 7474), config.get(connectors.get(0).listen_address));
assertEquals(new ListenSocketAddress("localhost", 7473), config.get(connectors.get(1).listen_address));
}
}
Aggregations