use of com.github.joschi.jadconfig.JadConfig in project graylog2-server by Graylog2.
the class ElasticsearchConfigurationTest method throwValidationExceptionIfDataPathIsNotADirectory.
@Test(expected = ValidationException.class)
public void throwValidationExceptionIfDataPathIsNotADirectory() throws Exception {
final File path = temporaryFolder.newFile("elasticsearch-data");
final ElasticsearchConfiguration configuration = new ElasticsearchConfiguration() {
@Override
public String getPathData() {
return path.getAbsolutePath();
}
};
new JadConfig(new InMemoryRepository(), configuration).process();
}
use of com.github.joschi.jadconfig.JadConfig in project graylog2-server by Graylog2.
the class ElasticsearchConfigurationTest method throwValidationExceptionIfDataPathIsNotReadable.
@Test(expected = ValidationException.class)
public void throwValidationExceptionIfDataPathIsNotReadable() throws Exception {
final File path = temporaryFolder.newFolder("elasticsearch-data");
assumeTrue(path.setReadable(false));
final ElasticsearchConfiguration configuration = new ElasticsearchConfiguration() {
@Override
public String getPathData() {
return path.getAbsolutePath();
}
};
new JadConfig(new InMemoryRepository(), configuration).process();
}
use of com.github.joschi.jadconfig.JadConfig in project graylog2-server by Graylog2.
the class MongoDbConfigurationTest method testGetMaximumMongoDBConnectionsDefault.
@Test
public void testGetMaximumMongoDBConnectionsDefault() throws RepositoryException, ValidationException {
MongoDbConfiguration configuration = new MongoDbConfiguration();
new JadConfig(new InMemoryRepository(), configuration).process();
assertEquals(1000, configuration.getMaxConnections());
}
use of com.github.joschi.jadconfig.JadConfig in project graylog2-server by Graylog2.
the class MongoDbConfigurationTest method validateSucceedsWithIPv6Address.
@Test
public void validateSucceedsWithIPv6Address() throws Exception {
MongoDbConfiguration configuration = new MongoDbConfiguration();
final Map<String, String> properties = singletonMap("mongodb_uri", "mongodb://[2001:DB8::DEAD:BEEF:CAFE:BABE]:1234,127.0.0.1:5678/TEST");
new JadConfig(new InMemoryRepository(properties), configuration).process();
assertEquals("mongodb://[2001:DB8::DEAD:BEEF:CAFE:BABE]:1234,127.0.0.1:5678/TEST", configuration.getMongoClientURI().toString());
}
use of com.github.joschi.jadconfig.JadConfig in project graylog2-server by Graylog2.
the class MongoDbConfigurationTest method testGetThreadsAllowedToBlockMultiplierDefault.
@Test
public void testGetThreadsAllowedToBlockMultiplierDefault() throws RepositoryException, ValidationException {
MongoDbConfiguration configuration = new MongoDbConfiguration();
new JadConfig(new InMemoryRepository(), configuration).process();
assertEquals(5, configuration.getThreadsAllowedToBlockMultiplier());
}
Aggregations