Search in sources :

Example 16 with InMemoryRepository

use of com.github.joschi.jadconfig.repositories.InMemoryRepository in project graylog2-server by Graylog2.

the class ElasticsearchConfigurationTest method testGetPathHome.

@Test
public void testGetPathHome() throws ValidationException, RepositoryException {
    final ElasticsearchConfiguration configuration = new ElasticsearchConfiguration();
    new JadConfig(new InMemoryRepository(), configuration).process();
    assertEquals(configuration.getPathHome(), "data/elasticsearch");
}
Also used : JadConfig(com.github.joschi.jadconfig.JadConfig) InMemoryRepository(com.github.joschi.jadconfig.repositories.InMemoryRepository) Test(org.junit.Test)

Example 17 with InMemoryRepository

use of com.github.joschi.jadconfig.repositories.InMemoryRepository in project graylog2-server by Graylog2.

the class ElasticsearchConfigurationTest method testGetElasticSearchIndexPrefix.

@Test
public void testGetElasticSearchIndexPrefix() throws RepositoryException, ValidationException {
    ElasticsearchConfiguration configuration = new ElasticsearchConfiguration();
    new JadConfig(new InMemoryRepository(), configuration).process();
    assertEquals(configuration.getIndexPrefix(), "graylog");
}
Also used : JadConfig(com.github.joschi.jadconfig.JadConfig) InMemoryRepository(com.github.joschi.jadconfig.repositories.InMemoryRepository) Test(org.junit.Test)

Example 18 with InMemoryRepository

use of com.github.joschi.jadconfig.repositories.InMemoryRepository in project graylog2-server by Graylog2.

the class MongoDbConfigurationTest method testGetThreadsAllowedToBlockMultiplier.

@Test
public void testGetThreadsAllowedToBlockMultiplier() throws RepositoryException, ValidationException {
    MongoDbConfiguration configuration = new MongoDbConfiguration();
    new JadConfig(new InMemoryRepository(singletonMap("mongodb_threads_allowed_to_block_multiplier", "12345")), configuration).process();
    assertEquals(12345, configuration.getThreadsAllowedToBlockMultiplier());
}
Also used : JadConfig(com.github.joschi.jadconfig.JadConfig) InMemoryRepository(com.github.joschi.jadconfig.repositories.InMemoryRepository) Test(org.junit.Test)

Example 19 with InMemoryRepository

use of com.github.joschi.jadconfig.repositories.InMemoryRepository in project graylog2-server by Graylog2.

the class MongoDbConfigurationTest method validateFailsIfUriIsEmpty.

@Test(expected = ValidationException.class)
public void validateFailsIfUriIsEmpty() throws RepositoryException, ValidationException {
    MongoDbConfiguration configuration = new MongoDbConfiguration();
    new JadConfig(new InMemoryRepository(singletonMap("mongodb_uri", "")), configuration).process();
}
Also used : JadConfig(com.github.joschi.jadconfig.JadConfig) InMemoryRepository(com.github.joschi.jadconfig.repositories.InMemoryRepository) Test(org.junit.Test)

Example 20 with InMemoryRepository

use of com.github.joschi.jadconfig.repositories.InMemoryRepository in project graylog2-server by Graylog2.

the class MongoDbConfigurationTest method testGetMaximumMongoDBConnections.

@Test
public void testGetMaximumMongoDBConnections() throws RepositoryException, ValidationException {
    MongoDbConfiguration configuration = new MongoDbConfiguration();
    new JadConfig(new InMemoryRepository(singletonMap("mongodb_max_connections", "12345")), configuration).process();
    assertEquals(12345, configuration.getMaxConnections());
}
Also used : JadConfig(com.github.joschi.jadconfig.JadConfig) InMemoryRepository(com.github.joschi.jadconfig.repositories.InMemoryRepository) Test(org.junit.Test)

Aggregations

JadConfig (com.github.joschi.jadconfig.JadConfig)65 InMemoryRepository (com.github.joschi.jadconfig.repositories.InMemoryRepository)65 Test (org.junit.Test)64 File (java.io.File)19 ElasticsearchConfiguration (org.graylog2.configuration.ElasticsearchConfiguration)3 Settings (org.elasticsearch.common.settings.Settings)2 RepositoryException (com.github.joschi.jadconfig.RepositoryException)1 ValidationException (com.github.joschi.jadconfig.ValidationException)1 HashMap (java.util.HashMap)1