use of com.github.alexcojocaru.mojo.elasticsearch.v2.ClusterConfiguration in project elasticsearch-maven-plugin by alexcojocaru.
the class ValidateClusterNameStepTest method TestWithClusterNameContainingDash.
@Test
public void TestWithClusterNameContainingDash() {
ClusterConfiguration clusterConfiguration = configBuilder.withClusterName("ONE-TWO-THREE").build();
validateClusterNameStep.execute(clusterConfiguration);
}
use of com.github.alexcojocaru.mojo.elasticsearch.v2.ClusterConfiguration in project elasticsearch-maven-plugin by alexcojocaru.
the class ValidateUniquePortsStepTest method testWithSingleInstanceWithDuplicatePorts.
/**
* Test with a single instance with duplicate ports.
*/
@Test(expected = ElasticsearchSetupException.class)
public void testWithSingleInstanceWithDuplicatePorts() {
ClusterConfiguration config = buildConfig(2000, 2000);
new ValidateUniquePortsStep().execute(config);
}
use of com.github.alexcojocaru.mojo.elasticsearch.v2.ClusterConfiguration in project elasticsearch-maven-plugin by alexcojocaru.
the class ValidateUniquePortsStepTest method testWithTwoInstancesWithDuplicateTransportPorts.
/**
* Test with 2 instances; the http ports are unique, the transport ports are duplicates.
*/
@Test(expected = ElasticsearchSetupException.class)
public void testWithTwoInstancesWithDuplicateTransportPorts() {
ClusterConfiguration config = buildConfig(2000, 2010, 2001, 2010);
new ValidateUniquePortsStep().execute(config);
}
use of com.github.alexcojocaru.mojo.elasticsearch.v2.ClusterConfiguration in project elasticsearch-maven-plugin by alexcojocaru.
the class ValidateUniquePortsStepTest method testWithSingleInstanceWithUniquePorts.
/**
* Test with a single instance with unique ports.
*/
@Test
public void testWithSingleInstanceWithUniquePorts() {
ClusterConfiguration config = buildConfig(2000, 2010);
new ValidateUniquePortsStep().execute(config);
}
use of com.github.alexcojocaru.mojo.elasticsearch.v2.ClusterConfiguration in project elasticsearch-maven-plugin by alexcojocaru.
the class ValidateUniquePortsStepTest method buildConfig.
private ClusterConfiguration buildConfig(int... ports) {
ClusterConfiguration.Builder configBuilder = new ClusterConfiguration.Builder();
for (int i = 0; i < ports.length; ) {
int httpPort = ports[i++];
int transportPort = ports[i++];
configBuilder.addInstanceConfiguration(new InstanceConfiguration.Builder().withHttpPort(httpPort).withTransportPort(transportPort).build());
}
ClusterConfiguration config = configBuilder.build();
return config;
}
Aggregations