From 8997dba52f3d1148062cd5edeea7b6fc8546ecb2 Mon Sep 17 00:00:00 2001 From: javanna Date: Tue, 4 Nov 2014 13:19:44 +0100 Subject: [PATCH] [TEST] move NettyTransport*Tests to org.elasticsearch.transport.netty package NettyTransport*Tests were previously in org.elasticsearch.test.transport and ended up being exported with the test jar. org.elasticsearch.transport.netty should be a better place for them together with exising tests. --- .../NettyTransportMultiPortIntegrationTests.java | 6 +----- .../netty}/NettyTransportMultiPortTests.java | 14 +------------- .../netty}/NettyTransportTests.java | 5 +---- .../transport/netty/SimpleNettyTransportTests.java | 1 - 4 files changed, 3 insertions(+), 23 deletions(-) rename src/test/java/org/elasticsearch/{test/transport => transport/netty}/NettyTransportMultiPortIntegrationTests.java (94%) rename src/test/java/org/elasticsearch/{test/transport => transport/netty}/NettyTransportMultiPortTests.java (93%) rename src/test/java/org/elasticsearch/{test/transport => transport/netty}/NettyTransportTests.java (97%) diff --git a/src/test/java/org/elasticsearch/test/transport/NettyTransportMultiPortIntegrationTests.java b/src/test/java/org/elasticsearch/transport/netty/NettyTransportMultiPortIntegrationTests.java similarity index 94% rename from src/test/java/org/elasticsearch/test/transport/NettyTransportMultiPortIntegrationTests.java rename to src/test/java/org/elasticsearch/transport/netty/NettyTransportMultiPortIntegrationTests.java index c8baa80e3fa..70a2e79fe48 100644 --- a/src/test/java/org/elasticsearch/test/transport/NettyTransportMultiPortIntegrationTests.java +++ b/src/test/java/org/elasticsearch/transport/netty/NettyTransportMultiPortIntegrationTests.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.transport; +package org.elasticsearch.transport.netty; import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse; import org.elasticsearch.action.admin.cluster.health.ClusterHealthStatus; @@ -25,9 +25,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.InetSocketTransportAddress; import org.elasticsearch.test.ElasticsearchIntegrationTest; import org.elasticsearch.test.junit.annotations.Network; -import org.elasticsearch.test.junit.annotations.TestLogging; import org.elasticsearch.transport.TransportModule; -import org.elasticsearch.transport.netty.NettyTransport; import org.junit.Test; import java.util.Locale; @@ -64,7 +62,6 @@ public class NettyTransportMultiPortIntegrationTests extends ElasticsearchIntegr @Test @Network - @TestLogging("transport.netty:DEBUG") public void testThatTransportClientCanConnect() throws Exception { Settings settings = settingsBuilder() .put("cluster.name", internalCluster().getClusterName()) @@ -76,5 +73,4 @@ public class NettyTransportMultiPortIntegrationTests extends ElasticsearchIntegr assertThat(response.getStatus(), is(ClusterHealthStatus.GREEN)); } } - } diff --git a/src/test/java/org/elasticsearch/test/transport/NettyTransportMultiPortTests.java b/src/test/java/org/elasticsearch/transport/netty/NettyTransportMultiPortTests.java similarity index 93% rename from src/test/java/org/elasticsearch/test/transport/NettyTransportMultiPortTests.java rename to src/test/java/org/elasticsearch/transport/netty/NettyTransportMultiPortTests.java index cac69a3b0d8..dcf218fe460 100644 --- a/src/test/java/org/elasticsearch/test/transport/NettyTransportMultiPortTests.java +++ b/src/test/java/org/elasticsearch/transport/netty/NettyTransportMultiPortTests.java @@ -16,14 +16,12 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.transport; +package org.elasticsearch.transport.netty; import com.carrotsearch.hppc.IntOpenHashSet; import com.google.common.base.Charsets; -import com.google.common.collect.Sets; import org.elasticsearch.Version; import org.elasticsearch.cache.recycler.PageCacheRecycler; -import org.elasticsearch.cluster.metadata.BenchmarkMetaData; import org.elasticsearch.common.component.Lifecycle; import org.elasticsearch.common.network.NetworkService; import org.elasticsearch.common.network.NetworkUtils; @@ -31,24 +29,18 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.InetSocketTransportAddress; import org.elasticsearch.common.util.BigArrays; import org.elasticsearch.indices.breaker.NoneCircuitBreakerService; -import org.elasticsearch.node.settings.NodeSettingsService; import org.elasticsearch.test.ElasticsearchTestCase; import org.elasticsearch.test.cache.recycler.MockBigArrays; import org.elasticsearch.test.junit.annotations.Network; -import org.elasticsearch.test.junit.annotations.TestLogging; import org.elasticsearch.threadpool.ThreadPool; -import org.elasticsearch.transport.netty.NettyTransport; import org.junit.After; -import org.junit.Before; import org.junit.Test; import java.io.IOException; -import java.io.InputStream; import java.io.OutputStream; import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.Socket; -import java.util.Set; import static org.elasticsearch.common.settings.ImmutableSettings.settingsBuilder; import static org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope; @@ -76,7 +68,6 @@ public class NettyTransportMultiPortTests extends ElasticsearchTestCase { } @Test - @TestLogging("shield.transport.netty:DEBUG") public void testThatNettyCanBindToMultiplePorts() throws Exception { int[] ports = getRandomPorts(3); @@ -95,7 +86,6 @@ public class NettyTransportMultiPortTests extends ElasticsearchTestCase { } @Test - @TestLogging("transport.netty:DEBUG") public void testThatDefaultProfileInheritsFromStandardSettings() throws Exception { int[] ports = getRandomPorts(2); @@ -112,7 +102,6 @@ public class NettyTransportMultiPortTests extends ElasticsearchTestCase { } @Test - @TestLogging("transport.netty:DEBUG") public void testThatProfileWithoutPortSettingsFails() throws Exception { int[] ports = getRandomPorts(1); @@ -128,7 +117,6 @@ public class NettyTransportMultiPortTests extends ElasticsearchTestCase { } @Test - @TestLogging("transport.netty:DEBUG") public void testThatDefaultProfilePortOverridesGeneralConfiguration() throws Exception { int[] ports = getRandomPorts(3); diff --git a/src/test/java/org/elasticsearch/test/transport/NettyTransportTests.java b/src/test/java/org/elasticsearch/transport/netty/NettyTransportTests.java similarity index 97% rename from src/test/java/org/elasticsearch/test/transport/NettyTransportTests.java rename to src/test/java/org/elasticsearch/transport/netty/NettyTransportTests.java index 4ec8ed0d3c6..940f0d01643 100644 --- a/src/test/java/org/elasticsearch/test/transport/NettyTransportTests.java +++ b/src/test/java/org/elasticsearch/transport/netty/NettyTransportTests.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.transport; +package org.elasticsearch.transport.netty; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.Version; @@ -38,9 +38,6 @@ import org.elasticsearch.transport.ActionNotFoundTransportException; import org.elasticsearch.transport.TransportModule; import org.elasticsearch.transport.TransportRequest; import org.elasticsearch.transport.TransportRequestHandler; -import org.elasticsearch.transport.netty.MessageChannelHandler; -import org.elasticsearch.transport.netty.NettyTransport; -import org.elasticsearch.transport.netty.NettyTransportChannel; import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelPipeline; import org.jboss.netty.channel.ChannelPipelineFactory; diff --git a/src/test/java/org/elasticsearch/transport/netty/SimpleNettyTransportTests.java b/src/test/java/org/elasticsearch/transport/netty/SimpleNettyTransportTests.java index 6215ffcae38..465929a1933 100644 --- a/src/test/java/org/elasticsearch/transport/netty/SimpleNettyTransportTests.java +++ b/src/test/java/org/elasticsearch/transport/netty/SimpleNettyTransportTests.java @@ -49,7 +49,6 @@ public class SimpleNettyTransportTests extends AbstractSimpleTransportTests { serviceA.connectToNode(new DiscoveryNode("C", new InetSocketTransportAddress("localhost", 9876), Version.CURRENT)); fail(); } catch (ConnectTransportException e) { -// e.printStackTrace(); // all is well } }