From ac2ee35c22dc60142f10a41582f07f5eeefa4fd9 Mon Sep 17 00:00:00 2001 From: javanna Date: Tue, 4 Nov 2014 13:40:48 +0100 Subject: [PATCH] [TEST] move ClusterDiscoveryConfiguration to org.elasticsearch.test.discovery ClusterDiscoveryConfiguration is part of the test infra and should get exported as part of the test jar. This is achieved by moving the class to org.elasticsearch.test.discovery Closes #8337 --- .../discovery/DiscoveryWithServiceDisruptions.java | 1 + .../elasticsearch/discovery/ZenUnicastDiscoveryTests.java | 1 + .../{ => test}/discovery/ClusterDiscoveryConfiguration.java | 5 ++--- 3 files changed, 4 insertions(+), 3 deletions(-) rename src/test/java/org/elasticsearch/{ => test}/discovery/ClusterDiscoveryConfiguration.java (98%) diff --git a/src/test/java/org/elasticsearch/discovery/DiscoveryWithServiceDisruptions.java b/src/test/java/org/elasticsearch/discovery/DiscoveryWithServiceDisruptions.java index 5576fca59e2..8770ab075ad 100644 --- a/src/test/java/org/elasticsearch/discovery/DiscoveryWithServiceDisruptions.java +++ b/src/test/java/org/elasticsearch/discovery/DiscoveryWithServiceDisruptions.java @@ -51,6 +51,7 @@ import org.elasticsearch.discovery.zen.ping.unicast.UnicastZenPing; import org.elasticsearch.discovery.zen.publish.PublishClusterStateAction; import org.elasticsearch.test.ElasticsearchIntegrationTest; import org.elasticsearch.test.InternalTestCluster; +import org.elasticsearch.test.discovery.ClusterDiscoveryConfiguration; import org.elasticsearch.test.disruption.*; import org.elasticsearch.test.junit.annotations.TestLogging; import org.elasticsearch.test.transport.MockTransportService; diff --git a/src/test/java/org/elasticsearch/discovery/ZenUnicastDiscoveryTests.java b/src/test/java/org/elasticsearch/discovery/ZenUnicastDiscoveryTests.java index fb1b32f8925..f37f138c9e5 100644 --- a/src/test/java/org/elasticsearch/discovery/ZenUnicastDiscoveryTests.java +++ b/src/test/java/org/elasticsearch/discovery/ZenUnicastDiscoveryTests.java @@ -26,6 +26,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.test.ElasticsearchIntegrationTest; import org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope; import org.elasticsearch.test.ElasticsearchIntegrationTest.Scope; +import org.elasticsearch.test.discovery.ClusterDiscoveryConfiguration; import org.junit.Before; import org.junit.Test; diff --git a/src/test/java/org/elasticsearch/discovery/ClusterDiscoveryConfiguration.java b/src/test/java/org/elasticsearch/test/discovery/ClusterDiscoveryConfiguration.java similarity index 98% rename from src/test/java/org/elasticsearch/discovery/ClusterDiscoveryConfiguration.java rename to src/test/java/org/elasticsearch/test/discovery/ClusterDiscoveryConfiguration.java index 868197d8432..690071053f6 100644 --- a/src/test/java/org/elasticsearch/discovery/ClusterDiscoveryConfiguration.java +++ b/src/test/java/org/elasticsearch/test/discovery/ClusterDiscoveryConfiguration.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.discovery; +package org.elasticsearch.test.discovery; import com.carrotsearch.randomizedtesting.RandomizedTest; import com.google.common.primitives.Ints; @@ -107,14 +107,13 @@ public class ClusterDiscoveryConfiguration extends SettingsSource { this.basePort = calcBasePort(); } - private final static int calcBasePort() { + private static int calcBasePort() { // note that this has properly co-exist with the port logic at InternalTestCluster's constructor return 30000 + 1000 * (ElasticsearchIntegrationTest.CHILD_JVM_ID % 60) + // up to 60 jvms 100 * portRangeCounter.incrementAndGet(); // up to 100 nodes } - @Override public Settings node(int nodeOrdinal) { ImmutableSettings.Builder builder = ImmutableSettings.builder()