Skip to content

Commit eab33a4

Browse files
committed
Add native transport dependencies and support for IO_URING in tests
1 parent 705ef80 commit eab33a4

2 files changed

Lines changed: 25 additions & 1 deletion

File tree

core/pom.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,21 @@
3636
<classifier>linux-x86_64</classifier>
3737
<scope>test</scope>
3838
</dependency>
39+
<!-- Add native transport test dependency for io_uring so IOUring classes are available in tests. -->
40+
<dependency>
41+
<groupId>io.netty</groupId>
42+
<artifactId>netty-transport-native-io_uring</artifactId>
43+
<version>${netty.version}</version>
44+
<classifier>linux-x86_64</classifier>
45+
<scope>test</scope>
46+
</dependency>
47+
<!-- Add the io_uring "classes" artifact so the Java wrappers and handler classes are present at test time. -->
48+
<dependency>
49+
<groupId>io.netty</groupId>
50+
<artifactId>netty-transport-classes-io_uring</artifactId>
51+
<version>${netty.version}</version>
52+
<scope>test</scope>
53+
</dependency>
3954
</dependencies>
4055

4156
<build>

core/src/test/java/io/netty/loom/VirtualMultithreadIoEventLoopGroupTest.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
import io.netty.channel.epoll.EpollIoHandler;
3434
import io.netty.channel.epoll.EpollServerSocketChannel;
3535

36+
import io.netty.channel.uring.IoUring;
37+
import io.netty.channel.uring.IoUringIoHandler;
38+
import io.netty.channel.uring.IoUringServerSocketChannel;
3639
import org.junit.jupiter.api.Test;
3740
import org.junit.jupiter.params.ParameterizedTest;
3841
import org.junit.jupiter.params.provider.MethodSource;
@@ -58,7 +61,7 @@ public class VirtualMultithreadIoEventLoopGroupTest {
5861

5962
// Transport enumeration to drive tests across available Netty transports.
6063
private enum Transport {
61-
NIO, EPOLL, LOCAL;
64+
NIO, EPOLL, IO_URING, LOCAL;
6265

6366
boolean isLocal() {
6467
return this == LOCAL;
@@ -70,6 +73,8 @@ boolean isAvailable() {
7073
return true;
7174
case EPOLL :
7275
return Epoll.isAvailable();
76+
case IO_URING :
77+
return IoUring.isAvailable();
7378
case LOCAL :
7479
return true;
7580
default :
@@ -83,6 +88,8 @@ IoHandlerFactory handlerFactory() {
8388
return NioIoHandler.newFactory();
8489
case EPOLL :
8590
return EpollIoHandler.newFactory();
91+
case IO_URING :
92+
return IoUringIoHandler.newFactory();
8693
case LOCAL :
8794
return LocalIoHandler.newFactory();
8895
default :
@@ -96,6 +103,8 @@ Class<? extends io.netty.channel.ServerChannel> serverChannelClass() {
96103
return NioServerSocketChannel.class;
97104
case EPOLL :
98105
return EpollServerSocketChannel.class;
106+
case IO_URING :
107+
return IoUringServerSocketChannel.class;
99108
case LOCAL :
100109
throw new IllegalStateException(
101110
"LOCAL transport does not provide a ServerChannel class for real networking");

0 commit comments

Comments
 (0)