Search in sources :

Example 11 with ClusterConfiguration

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);
}
Also used : ClusterConfiguration(com.github.alexcojocaru.mojo.elasticsearch.v2.ClusterConfiguration) Test(org.junit.Test)

Example 12 with 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);
}
Also used : ClusterConfiguration(com.github.alexcojocaru.mojo.elasticsearch.v2.ClusterConfiguration) Test(org.junit.Test)

Example 13 with ClusterConfiguration

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);
}
Also used : ClusterConfiguration(com.github.alexcojocaru.mojo.elasticsearch.v2.ClusterConfiguration) Test(org.junit.Test)

Example 14 with ClusterConfiguration

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);
}
Also used : ClusterConfiguration(com.github.alexcojocaru.mojo.elasticsearch.v2.ClusterConfiguration) Test(org.junit.Test)

Example 15 with ClusterConfiguration

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;
}
Also used : ClusterConfiguration(com.github.alexcojocaru.mojo.elasticsearch.v2.ClusterConfiguration)

Aggregations

ClusterConfiguration (com.github.alexcojocaru.mojo.elasticsearch.v2.ClusterConfiguration)13 Test (org.junit.Test)12 ElasticsearchSetupException (com.github.alexcojocaru.mojo.elasticsearch.v2.ElasticsearchSetupException)2 InstanceConfiguration (com.github.alexcojocaru.mojo.elasticsearch.v2.InstanceConfiguration)2 ElasticsearchClient (com.github.alexcojocaru.mojo.elasticsearch.v2.client.ElasticsearchClient)2 Monitor (com.github.alexcojocaru.mojo.elasticsearch.v2.client.Monitor)1 PostStartClusterSequence (com.github.alexcojocaru.mojo.elasticsearch.v2.step.PostStartClusterSequence)1 PostStartInstanceSequence (com.github.alexcojocaru.mojo.elasticsearch.v2.step.PostStartInstanceSequence)1 PreStartClusterSequence (com.github.alexcojocaru.mojo.elasticsearch.v2.step.PreStartClusterSequence)1 File (java.io.File)1 IOException (java.io.IOException)1 MojoExecutionException (org.apache.maven.plugin.MojoExecutionException)1 MojoFailureException (org.apache.maven.plugin.MojoFailureException)1