use of com.github.alexcojocaru.mojo.elasticsearch.v2.ClusterConfiguration in project elasticsearch-maven-plugin by alexcojocaru.
the class ValidateUniquePortsStepTest method testWithTwoInstancesWithDuplicateHttpPorts.
/**
* Test with 2 instances; the http ports are duplicates, the transport ports are unique.
*/
@Test(expected = ElasticsearchSetupException.class)
public void testWithTwoInstancesWithDuplicateHttpPorts() {
ClusterConfiguration config = buildConfig(2000, 2010, 2000, 2011);
new ValidateUniquePortsStep().execute(config);
}
use of com.github.alexcojocaru.mojo.elasticsearch.v2.ClusterConfiguration in project elasticsearch-maven-plugin by alexcojocaru.
the class RemoveExistingDataStepTest method testRemoveExistingData.
@Test
public void testRemoveExistingData() {
InstanceConfiguration instanceConfig = mock(InstanceConfiguration.class);
when(instanceConfig.getBaseDir()).thenReturn(".");
ClusterConfiguration clusterConfig = new ClusterConfiguration.Builder().withKeepExistingData(false).build();
when(instanceConfig.getClusterConfiguration()).thenReturn(clusterConfig);
new RemoveExistingDataStep().execute(instanceConfig);
// a bit convoluted, but this check that getBaseDir()
// was called in order to build the data and logs directories.
Mockito.verify(instanceConfig).getBaseDir();
}
use of com.github.alexcojocaru.mojo.elasticsearch.v2.ClusterConfiguration in project elasticsearch-maven-plugin by alexcojocaru.
the class RemoveExistingDataStepTest method testKeepExistingData.
@Test
public void testKeepExistingData() {
InstanceConfiguration instanceConfig = mock(InstanceConfiguration.class);
ClusterConfiguration clusterConfig = new ClusterConfiguration.Builder().withKeepExistingData(true).build();
when(instanceConfig.getClusterConfiguration()).thenReturn(clusterConfig);
new RemoveExistingDataStep().execute(instanceConfig);
// a bit convoluted, but this check that getBaseDir()
// was never called in order to build the data and logs directories.
Mockito.verify(instanceConfig, never()).getBaseDir();
}
use of com.github.alexcojocaru.mojo.elasticsearch.v2.ClusterConfiguration in project elasticsearch-maven-plugin by alexcojocaru.
the class WaitToStartClusterStep method execute.
@Override
public void execute(ClusterConfiguration config) {
try (ElasticsearchClient client = new ElasticsearchClient.Builder().withInstanceConfiguration(config.getInstanceConfigurationList().get(0)).withHostname("localhost").build()) {
Monitor monitor = new Monitor(client, config.getLog());
monitor.waitToStartCluster(config.getClusterName(), config.getInstanceConfigurationList().size(), config.getStartupTimeout());
}
}
use of com.github.alexcojocaru.mojo.elasticsearch.v2.ClusterConfiguration in project elasticsearch-maven-plugin by alexcojocaru.
the class ValidateVersionStepTest method testCheckVersionWithCorrectVersion.
/**
* Test the version check with correct version
*/
@Test
public void testCheckVersionWithCorrectVersion() {
String version = "5.1";
ClusterConfiguration config = buildConfig(version);
new ValidateVersionStep().execute(config);
}
Aggregations