use of org.neo4j.graphdb.config.Setting in project neo4j by neo4j.
the class SessionRule method apply.
@Override
public Statement apply(final Statement base, Description description) {
return new Statement() {
@Override
public void evaluate() throws Throwable {
Map<Setting<?>, String> config = new HashMap<>();
config.put(GraphDatabaseSettings.auth_enabled, Boolean.toString(authEnabled));
gdb = (GraphDatabaseAPI) new TestGraphDatabaseFactory().newImpermanentDatabase(config);
DependencyResolver resolver = gdb.getDependencyResolver();
Authentication authentication = authentication(resolver.resolveDependency(AuthManager.class), resolver.resolveDependency(UserManagerSupplier.class));
boltFactory = new BoltFactoryImpl(gdb, new UsageData(null), NullLogService.getInstance(), resolver.resolveDependency(ThreadToStatementContextBridge.class), authentication, BoltConnectionTracker.NOOP, Config.defaults());
boltFactory.start();
try {
base.evaluate();
} finally {
try {
if (runningMachines != null) {
runningMachines.forEach(BoltStateMachine::close);
}
} catch (Throwable e) {
e.printStackTrace();
}
gdb.shutdown();
}
}
};
}
use of org.neo4j.graphdb.config.Setting in project neo4j by neo4j.
the class HttpConnectorValidatorTest method setsDeprecationFlagOnEncryption.
@Test
public void setsDeprecationFlagOnEncryption() throws Exception {
Setting setting = cv.getSettingFor("dbms.connector.http.encryption", Collections.emptyMap()).orElseThrow(() -> new RuntimeException("missing setting!"));
assertTrue(setting.deprecated());
assertEquals(Optional.empty(), setting.replacement());
}
use of org.neo4j.graphdb.config.Setting in project neo4j by neo4j.
the class HttpConnectorValidatorTest method sdfa.
@Test
public void sdfa() throws Exception {
Setting setting = cv.getSettingFor("dbms.connector.http.type", Collections.emptyMap()).orElseThrow(() -> new RuntimeException("missing setting!"));
assertTrue(setting.deprecated());
assertEquals(Optional.empty(), setting.replacement());
}
use of org.neo4j.graphdb.config.Setting in project neo4j by neo4j.
the class HttpConnectorValidatorTest method setsDeprecationFlagOnCustomNamedHttpConnectors.
@Test
public void setsDeprecationFlagOnCustomNamedHttpConnectors() throws Exception {
List<Setting<Object>> settings = cv.settings(stringMap("dbms.connector.0.type", "HTTP", "dbms.connector.0.enabled", "false", "dbms.connector.0.listen_address", "1.2.3.4:123", "dbms.connector.0.advertised_address", "localhost:123", "dbms.connector.0.encryption", Encryption.NONE.toString()));
assertEquals(5, settings.size());
for (Setting s : settings) {
assertTrue("every setting should be deprecated: " + s.name(), s.deprecated());
String[] parts = s.name().split("\\.");
if (!"encryption".equals(parts[3]) && !"type".equals(parts[3])) {
assertEquals(Optional.of(format("%s.%s.%s.%s", parts[0], parts[1], "http", parts[3])), s.replacement());
}
}
}
use of org.neo4j.graphdb.config.Setting in project neo4j by neo4j.
the class BoltConnectorValidatorTest method setsDeprecationFlagOnAddress.
@Test
public void setsDeprecationFlagOnAddress() throws Exception {
Setting setting = cv.getSettingFor("dbms.connector.bolt.address", Collections.emptyMap()).orElseThrow(() -> new RuntimeException("missing setting!"));
assertTrue(setting.deprecated());
assertEquals(Optional.of("dbms.connector.bolt.listen_address"), setting.replacement());
}
Aggregations