use of com.github.joschi.jadconfig.JadConfig in project graylog2-server by Graylog2.
the class ElasticsearchConfigurationTest method throwValidationExceptionIfHomePathIsNotReadable.
@Test(expected = ValidationException.class)
public void throwValidationExceptionIfHomePathIsNotReadable() throws Exception {
final File path = temporaryFolder.newFolder("elasticsearch-home");
assumeTrue(path.setReadable(false));
final ElasticsearchConfiguration configuration = new ElasticsearchConfiguration() {
@Override
public String getPathHome() {
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 throwValidationExceptionIfHomePathParentIsNotReadable.
@Test(expected = ValidationException.class)
public void throwValidationExceptionIfHomePathParentIsNotReadable() throws Exception {
final File parent = temporaryFolder.newFolder("elasticsearch");
final File path = new File(parent, "home");
assumeTrue(path.mkdir());
assumeTrue(parent.setReadable(false));
final ElasticsearchConfiguration configuration = new ElasticsearchConfiguration() {
@Override
public String getPathHome() {
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 testGetPathData.
@Test
public void testGetPathData() throws ValidationException, RepositoryException {
final ElasticsearchConfiguration configuration = new ElasticsearchConfiguration();
new JadConfig(new InMemoryRepository(), configuration).process();
assertEquals(configuration.getPathData(), "data/elasticsearch");
}
use of com.github.joschi.jadconfig.JadConfig in project graylog2-server by Graylog2.
the class ElasticsearchConfigurationTest method testIsClientNode.
@Test
public void testIsClientNode() throws ValidationException, RepositoryException {
final Map<String, String> props = new HashMap<>();
final ElasticsearchConfiguration configuration1 = new ElasticsearchConfiguration();
new JadConfig(new InMemoryRepository(), configuration1).process();
assertTrue(configuration1.isClientNode());
final ElasticsearchConfiguration configuration2 = new ElasticsearchConfiguration();
props.put("elasticsearch_node_data", "false");
new JadConfig(new InMemoryRepository(props), configuration2).process();
assertTrue(configuration2.isClientNode());
final ElasticsearchConfiguration configuration3 = new ElasticsearchConfiguration();
props.put("elasticsearch_node_data", "true");
new JadConfig(new InMemoryRepository(props), configuration3).process();
assertFalse(configuration3.isClientNode());
}
use of com.github.joschi.jadconfig.JadConfig in project graylog2-server by Graylog2.
the class ElasticsearchConfigurationTest method throwValidationExceptionIfDataPathParentIsNotReadable.
@Test(expected = ValidationException.class)
public void throwValidationExceptionIfDataPathParentIsNotReadable() throws Exception {
final File parent = temporaryFolder.newFolder("elasticsearch");
final File path = new File(parent, "data");
assumeTrue(path.mkdir());
assumeTrue(parent.setReadable(false));
final ElasticsearchConfiguration configuration = new ElasticsearchConfiguration() {
@Override
public String getPathData() {
return path.getAbsolutePath();
}
};
new JadConfig(new InMemoryRepository(), configuration).process();
}
Aggregations