1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package io.netty.testsuite.transport;
17
18 import io.netty.channel.Channel;
19 import io.netty.channel.DefaultSelectStrategyFactory;
20 import io.netty.channel.EventLoopGroup;
21 import io.netty.channel.ServerChannel;
22 import io.netty.channel.nio.NioEventLoopGroup;
23 import io.netty.channel.socket.nio.NioServerSocketChannel;
24 import io.netty.channel.socket.nio.NioSocketChannel;
25
26 import java.nio.channels.spi.SelectorProvider;
27 import java.util.concurrent.Executor;
28
29 public class NioEventLoopTest extends AbstractSingleThreadEventLoopTest {
30
31 @Override
32 protected boolean supportsChannelIteration() {
33 return true;
34 }
35
36 @Override
37 protected EventLoopGroup newEventLoopGroup() {
38 return new NioEventLoopGroup();
39 }
40
41 @Override
42 protected EventLoopGroup newAutoScalingEventLoopGroup() {
43 return new NioEventLoopGroup(SCALING_MAX_THREADS, (Executor) null, AUTO_SCALING_CHOOSER_FACTORY,
44 SelectorProvider.provider(), DefaultSelectStrategyFactory.INSTANCE);
45 }
46
47 @Override
48 protected Channel newChannel() {
49 return new NioSocketChannel();
50 }
51
52 @Override
53 protected Class<? extends ServerChannel> serverChannelClass() {
54 return NioServerSocketChannel.class;
55 }
56 }