use of org.neo4j.kernel.configuration.BoltConnector in project neo4j by neo4j.
the class ConfigLoaderTest method loadOfflineConfigShouldDisableBolt.
@Test
public void loadOfflineConfigShouldDisableBolt() throws IOException {
// given
BoltConnector defaultBoltConf = new BoltConnector("bolt");
Optional<File> configFile = ConfigFileBuilder.builder(folder.getRoot()).withNameValue(defaultBoltConf.enabled.name(), Settings.TRUE).build();
// when
Config testConf = ConfigLoader.loadConfigWithConnectorsDisabled(Optional.of(folder.getRoot()), configFile);
// then
assertNotNull(testConf);
assertEquals(false, testConf.get(defaultBoltConf.enabled));
assertEquals(false, testConf.get(new BoltConnector().enabled));
}
use of org.neo4j.kernel.configuration.BoltConnector in project neo4j by neo4j.
the class HazelcastClusterTopologyTest method shouldLogAndExcludeMembersWithMissingAttributes.
@Test
public void shouldLogAndExcludeMembersWithMissingAttributes() throws Exception {
// given
Set<Member> hazelcastMembers = new HashSet<>();
List<MemberId> coreMembers = new ArrayList<>();
for (int i = 0; i < 4; i++) {
MemberId memberId = new MemberId(UUID.randomUUID());
coreMembers.add(memberId);
Config config = Config.defaults();
HashMap<String, String> settings = new HashMap<>();
settings.put(new BoltConnector("bolt").type.name(), "BOLT");
settings.put(new BoltConnector("bolt").enabled.name(), "true");
settings.put(new BoltConnector("bolt").advertised_address.name(), "bolt:" + (i + 1));
settings.put(new BoltConnector("http").type.name(), "HTTP");
settings.put(new BoltConnector("http").enabled.name(), "true");
settings.put(new BoltConnector("http").advertised_address.name(), "http:" + (i + 1));
config.augment(settings);
Map<String, Object> attributes = buildMemberAttributesForCore(memberId, config).getAttributes();
if (i == 2) {
attributes.remove(HazelcastClusterTopology.RAFT_SERVER);
}
hazelcastMembers.add(new MemberImpl(new Address("localhost", i), null, attributes, false));
}
// when
Map<MemberId, CoreServerInfo> map = toCoreMemberMap(hazelcastMembers, NullLog.getInstance(), hzInstance);
// then
assertThat(map.keySet(), hasItems(coreMembers.get(0), coreMembers.get(1), coreMembers.get(3)));
assertThat(map.keySet(), not(hasItems(coreMembers.get(2))));
}
use of org.neo4j.kernel.configuration.BoltConnector in project neo4j by neo4j.
the class TransactionGuardIntegrationTest method startNeoServer.
private CommunityNeoServer startNeoServer(GraphDatabaseFacade database) throws IOException {
if (neoServer == null) {
GuardingServerBuilder serverBuilder = new GuardingServerBuilder(database);
BoltConnector boltConnector = new BoltConnector("bolt");
serverBuilder.withProperty(boltConnector.type.name(), "BOLT").withProperty(boltConnector.enabled.name(), "true").withProperty(boltConnector.encryption_level.name(), BoltConnector.EncryptionLevel.DISABLED.name()).withProperty(GraphDatabaseSettings.auth_enabled.name(), "false");
neoServer = serverBuilder.build();
cleanupRule.add(neoServer);
neoServer.start();
}
return neoServer;
}
use of org.neo4j.kernel.configuration.BoltConnector in project neo4j by neo4j.
the class DiscoveryServiceTest method mockConfig.
private Config mockConfig() throws URISyntaxException {
Config config = Config.defaults();
HashMap<String, String> settings = new HashMap<>();
settings.put(GraphDatabaseSettings.auth_enabled.name(), "false");
settings.put(new BoltConnector("bolt").type.name(), "BOLT");
settings.put(new BoltConnector("bolt").enabled.name(), "true");
settings.put(new BoltConnector("bolt").advertised_address.name(), boltAddress.toString());
settings.put(ServerSettings.management_api_path.name(), managementUri.toString());
settings.put(ServerSettings.rest_api_path.name(), dataUri.toString());
config.augment(settings);
return config;
}
use of org.neo4j.kernel.configuration.BoltConnector in project neo4j by neo4j.
the class ConnectionInfoIT method hzTest.
@Test
public void hzTest() throws Throwable {
// given
testSocket = bindPort("0.0.0.0", 4243);
//when
AssertableLogProvider logProvider = new AssertableLogProvider();
AssertableLogProvider userLogProvider = new AssertableLogProvider();
HazelcastDiscoveryServiceFactory hzFactory = new HazelcastDiscoveryServiceFactory();
Config config = embeddedDefaults(stringMap(discovery_listen_address.name(), ":" + testSocket.getLocalPort(), CausalClusteringSettings.initial_discovery_members.name(), "localhost:" + testSocket.getLocalPort(), new BoltConnector("bolt").enabled.name(), "true", new HttpConnector("http").enabled.name(), "true"));
Neo4jJobScheduler jobScheduler = new Neo4jJobScheduler();
jobScheduler.init();
CoreTopologyService coreTopologyService = hzFactory.coreTopologyService(config, new MemberId(UUID.randomUUID()), jobScheduler, logProvider, userLogProvider);
try {
coreTopologyService.init();
coreTopologyService.start();
}//then
catch (Throwable throwable) {
//expected
}
logProvider.assertContainsMessageContaining("Hazelcast was unable to start with setting");
userLogProvider.assertContainsMessageContaining("Hazelcast was unable to start with setting");
}
Aggregations