[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.
This commit is contained in:
javanna 2014-11-04 13:19:44 +01:00 committed by Luca Cavanna
parent 4396e6b48e
commit 8997dba52f
4 changed files with 3 additions and 23 deletions

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * 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.ClusterHealthResponse;
import org.elasticsearch.action.admin.cluster.health.ClusterHealthStatus; 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.common.transport.InetSocketTransportAddress;
import org.elasticsearch.test.ElasticsearchIntegrationTest; import org.elasticsearch.test.ElasticsearchIntegrationTest;
import org.elasticsearch.test.junit.annotations.Network; import org.elasticsearch.test.junit.annotations.Network;
import org.elasticsearch.test.junit.annotations.TestLogging;
import org.elasticsearch.transport.TransportModule; import org.elasticsearch.transport.TransportModule;
import org.elasticsearch.transport.netty.NettyTransport;
import org.junit.Test; import org.junit.Test;
import java.util.Locale; import java.util.Locale;
@ -64,7 +62,6 @@ public class NettyTransportMultiPortIntegrationTests extends ElasticsearchIntegr
@Test @Test
@Network @Network
@TestLogging("transport.netty:DEBUG")
public void testThatTransportClientCanConnect() throws Exception { public void testThatTransportClientCanConnect() throws Exception {
Settings settings = settingsBuilder() Settings settings = settingsBuilder()
.put("cluster.name", internalCluster().getClusterName()) .put("cluster.name", internalCluster().getClusterName())
@ -76,5 +73,4 @@ public class NettyTransportMultiPortIntegrationTests extends ElasticsearchIntegr
assertThat(response.getStatus(), is(ClusterHealthStatus.GREEN)); assertThat(response.getStatus(), is(ClusterHealthStatus.GREEN));
} }
} }
} }

View File

@ -16,14 +16,12 @@
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.elasticsearch.test.transport; package org.elasticsearch.transport.netty;
import com.carrotsearch.hppc.IntOpenHashSet; import com.carrotsearch.hppc.IntOpenHashSet;
import com.google.common.base.Charsets; import com.google.common.base.Charsets;
import com.google.common.collect.Sets;
import org.elasticsearch.Version; import org.elasticsearch.Version;
import org.elasticsearch.cache.recycler.PageCacheRecycler; import org.elasticsearch.cache.recycler.PageCacheRecycler;
import org.elasticsearch.cluster.metadata.BenchmarkMetaData;
import org.elasticsearch.common.component.Lifecycle; import org.elasticsearch.common.component.Lifecycle;
import org.elasticsearch.common.network.NetworkService; import org.elasticsearch.common.network.NetworkService;
import org.elasticsearch.common.network.NetworkUtils; 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.transport.InetSocketTransportAddress;
import org.elasticsearch.common.util.BigArrays; import org.elasticsearch.common.util.BigArrays;
import org.elasticsearch.indices.breaker.NoneCircuitBreakerService; import org.elasticsearch.indices.breaker.NoneCircuitBreakerService;
import org.elasticsearch.node.settings.NodeSettingsService;
import org.elasticsearch.test.ElasticsearchTestCase; import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.cache.recycler.MockBigArrays; import org.elasticsearch.test.cache.recycler.MockBigArrays;
import org.elasticsearch.test.junit.annotations.Network; import org.elasticsearch.test.junit.annotations.Network;
import org.elasticsearch.test.junit.annotations.TestLogging;
import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.transport.netty.NettyTransport;
import org.junit.After; import org.junit.After;
import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream; import java.io.OutputStream;
import java.net.InetAddress; import java.net.InetAddress;
import java.net.InetSocketAddress; import java.net.InetSocketAddress;
import java.net.Socket; import java.net.Socket;
import java.util.Set;
import static org.elasticsearch.common.settings.ImmutableSettings.settingsBuilder; import static org.elasticsearch.common.settings.ImmutableSettings.settingsBuilder;
import static org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope; import static org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope;
@ -76,7 +68,6 @@ public class NettyTransportMultiPortTests extends ElasticsearchTestCase {
} }
@Test @Test
@TestLogging("shield.transport.netty:DEBUG")
public void testThatNettyCanBindToMultiplePorts() throws Exception { public void testThatNettyCanBindToMultiplePorts() throws Exception {
int[] ports = getRandomPorts(3); int[] ports = getRandomPorts(3);
@ -95,7 +86,6 @@ public class NettyTransportMultiPortTests extends ElasticsearchTestCase {
} }
@Test @Test
@TestLogging("transport.netty:DEBUG")
public void testThatDefaultProfileInheritsFromStandardSettings() throws Exception { public void testThatDefaultProfileInheritsFromStandardSettings() throws Exception {
int[] ports = getRandomPorts(2); int[] ports = getRandomPorts(2);
@ -112,7 +102,6 @@ public class NettyTransportMultiPortTests extends ElasticsearchTestCase {
} }
@Test @Test
@TestLogging("transport.netty:DEBUG")
public void testThatProfileWithoutPortSettingsFails() throws Exception { public void testThatProfileWithoutPortSettingsFails() throws Exception {
int[] ports = getRandomPorts(1); int[] ports = getRandomPorts(1);
@ -128,7 +117,6 @@ public class NettyTransportMultiPortTests extends ElasticsearchTestCase {
} }
@Test @Test
@TestLogging("transport.netty:DEBUG")
public void testThatDefaultProfilePortOverridesGeneralConfiguration() throws Exception { public void testThatDefaultProfilePortOverridesGeneralConfiguration() throws Exception {
int[] ports = getRandomPorts(3); int[] ports = getRandomPorts(3);

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.elasticsearch.test.transport; package org.elasticsearch.transport.netty;
import org.elasticsearch.ElasticsearchException; import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.Version; import org.elasticsearch.Version;
@ -38,9 +38,6 @@ import org.elasticsearch.transport.ActionNotFoundTransportException;
import org.elasticsearch.transport.TransportModule; import org.elasticsearch.transport.TransportModule;
import org.elasticsearch.transport.TransportRequest; import org.elasticsearch.transport.TransportRequest;
import org.elasticsearch.transport.TransportRequestHandler; 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.Channel;
import org.jboss.netty.channel.ChannelPipeline; import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelPipelineFactory; import org.jboss.netty.channel.ChannelPipelineFactory;

View File

@ -49,7 +49,6 @@ public class SimpleNettyTransportTests extends AbstractSimpleTransportTests {
serviceA.connectToNode(new DiscoveryNode("C", new InetSocketTransportAddress("localhost", 9876), Version.CURRENT)); serviceA.connectToNode(new DiscoveryNode("C", new InetSocketTransportAddress("localhost", 9876), Version.CURRENT));
fail(); fail();
} catch (ConnectTransportException e) { } catch (ConnectTransportException e) {
// e.printStackTrace();
// all is well // all is well
} }
} }