Search in sources :

Example 1 with ConfigurationValidator

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

the class ServerBootstrapperTest method shouldNotThrowNullPointerExceptionIfConfigurationValidationFails.

@Test
public void shouldNotThrowNullPointerExceptionIfConfigurationValidationFails() throws Exception {
    // given
    ServerBootstrapper serverBootstrapper = new ServerBootstrapper() {

        @Override
        protected NeoServer createNeoServer(Config config, GraphDatabaseDependencies dependencies, LogProvider userLogProvider) {
            return mock(NeoServer.class);
        }

        @Nonnull
        @Override
        protected Collection<ConfigurationValidator> configurationValidators() {
            return Collections.emptyList();
        }
    };
    File dir = Files.createTempDirectory("test-server-bootstrapper").toFile();
    dir.deleteOnExit();
    // when
    serverBootstrapper.start(dir, Optional.empty());
    // then no exceptions are thrown and
    assertThat(suppress.getOutputVoice().lines(), not(empty()));
}
Also used : LogProvider(org.neo4j.logging.LogProvider) Config(org.neo4j.kernel.configuration.Config) GraphDatabaseDependencies(org.neo4j.kernel.GraphDatabaseDependencies) ConfigurationValidator(org.neo4j.kernel.configuration.ConfigurationValidator) File(java.io.File) Test(org.junit.Test)

Example 2 with ConfigurationValidator

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

the class EnterpriseBootstrapper method configurationValidators.

@Override
@Nonnull
protected Collection<ConfigurationValidator> configurationValidators() {
    ArrayList<ConfigurationValidator> validators = new ArrayList<>();
    validators.addAll(super.configurationValidators());
    validators.add(new HaConfigurationValidator());
    validators.add(new CausalClusterConfigurationValidator());
    return validators;
}
Also used : HaConfigurationValidator(org.neo4j.configuration.HaConfigurationValidator) ArrayList(java.util.ArrayList) CausalClusterConfigurationValidator(org.neo4j.causalclustering.core.CausalClusterConfigurationValidator) ConfigurationValidator(org.neo4j.kernel.configuration.ConfigurationValidator) HaConfigurationValidator(org.neo4j.configuration.HaConfigurationValidator) CausalClusterConfigurationValidator(org.neo4j.causalclustering.core.CausalClusterConfigurationValidator) Nonnull(javax.annotation.Nonnull)

Aggregations

ConfigurationValidator (org.neo4j.kernel.configuration.ConfigurationValidator)2 File (java.io.File)1 ArrayList (java.util.ArrayList)1 Nonnull (javax.annotation.Nonnull)1 Test (org.junit.Test)1 CausalClusterConfigurationValidator (org.neo4j.causalclustering.core.CausalClusterConfigurationValidator)1 HaConfigurationValidator (org.neo4j.configuration.HaConfigurationValidator)1 GraphDatabaseDependencies (org.neo4j.kernel.GraphDatabaseDependencies)1 Config (org.neo4j.kernel.configuration.Config)1 LogProvider (org.neo4j.logging.LogProvider)1