diff --git a/junixsocket-common/src/main/resources/META-INF/native-image/com.kohlschutter.junixsocket/junixsocket-common/jni-config.json b/junixsocket-common/src/main/resources/META-INF/native-image/com.kohlschutter.junixsocket/junixsocket-common/jni-config.json index 458b2c59f..d54b568d0 100644 --- a/junixsocket-common/src/main/resources/META-INF/native-image/com.kohlschutter.junixsocket/junixsocket-common/jni-config.json +++ b/junixsocket-common/src/main/resources/META-INF/native-image/com.kohlschutter.junixsocket/junixsocket-common/jni-config.json @@ -160,6 +160,10 @@ "name":"org.newsclub.net.unix.NoSuchDeviceSocketException", "methods":[{"name":"","parameterTypes":["java.lang.String"] }] }, +{ + "name":"org.newsclub.net.unix.NotConnectedSocketException", + "methods":[{"name":"","parameterTypes":["java.lang.String"] }] +}, { "name":"org.newsclub.net.unix.AddressUnavailableSocketException", "methods":[{"name":"","parameterTypes":["java.lang.String"] }] diff --git a/junixsocket-common/src/main/resources/META-INF/native-image/com.kohlschutter.junixsocket/junixsocket-common/reflect-config.json b/junixsocket-common/src/main/resources/META-INF/native-image/com.kohlschutter.junixsocket/junixsocket-common/reflect-config.json index 39e6e7b65..2167c098c 100644 --- a/junixsocket-common/src/main/resources/META-INF/native-image/com.kohlschutter.junixsocket/junixsocket-common/reflect-config.json +++ b/junixsocket-common/src/main/resources/META-INF/native-image/com.kohlschutter.junixsocket/junixsocket-common/reflect-config.json @@ -65,7 +65,20 @@ "name":"java.net.InetSocketAddress" }, { - "name":"java.net.UnixDomainSocketAddress" + "name":"java.net.UnixDomainSocketAddress", + "methods":[{"name":"of","parameterTypes":["java.nio.file.Path"] }] +}, +{ + "name":"java.nio.channels.DatagramChannel", + "methods":[{"name":"open","parameterTypes":["java.net.ProtocolFamily"] }] +}, +{ + "name":"java.nio.channels.ServerSocketChannel", + "methods":[{"name":"open","parameterTypes":["java.net.ProtocolFamily"] }] +}, +{ + "name":"java.nio.channels.SocketChannel", + "methods":[{"name":"open","parameterTypes":["java.net.ProtocolFamily"] }] }, { "name":"org.newsclub.net.unix.AFSYSTEMSocketAddress", diff --git a/junixsocket-native-graalvm/bin/build-selftest b/junixsocket-native-graalvm/bin/build-selftest index f6c5455a8..d8139f051 100755 --- a/junixsocket-native-graalvm/bin/build-selftest +++ b/junixsocket-native-graalvm/bin/build-selftest @@ -93,13 +93,18 @@ else echo "[WARNING] mysql-connector-j dependency is missing: $mysqlDep" >&2 fi +selftestArgs=( + -Dselftest.enable-module.junixsocket-common.JavaInet=true + -Dselftest.enable-module.junixsocket-common.JEP380=true + -cp "$jar":"$mysqlDep" +) + echo echo Running junixsocket-selftest with GraalVM native-image-agent... ( set -x java -agentlib:native-image-agent=config-output-dir=${tmpDir}/native-image.{pid} \ - -Dselftest.enable-module.junixsocket-common.JavaInet=true \ - -cp "$jar":"$mysqlDep" org.newsclub.net.unix.selftest.Selftest >/dev/null + ${selftestArgs[@]} org.newsclub.net.unix.selftest.Selftest >/dev/null ) if [[ $? -ne 0 ]]; then @@ -120,8 +125,7 @@ echo Running native-image... ( set -x native-image -cp "$tmpDir" --initialize-at-build-time=sun.rmi.transport.GC --report-unsupported-elements-at-runtime --no-fallback \ - -Dselftest.enable-module.junixsocket-common.JavaInet=true \ - -cp "$jar":"$mysqlDep" org.newsclub.net.unix.selftest.Selftest + ${selftestArgs[@]} org.newsclub.net.unix.selftest.Selftest ) if [[ $? -ne 0 ]]; then echo "Error: Failed to run native-image" >&2 diff --git a/junixsocket-native-graalvm/output/META-INF/native-image/com.kohlschutter.junixsocket/junixsocket-native-graalvm/jni-config.json b/junixsocket-native-graalvm/output/META-INF/native-image/com.kohlschutter.junixsocket/junixsocket-native-graalvm/jni-config.json index 3b8241d16..2a7635ebb 100644 --- a/junixsocket-native-graalvm/output/META-INF/native-image/com.kohlschutter.junixsocket/junixsocket-native-graalvm/jni-config.json +++ b/junixsocket-native-graalvm/output/META-INF/native-image/com.kohlschutter.junixsocket/junixsocket-native-graalvm/jni-config.json @@ -137,6 +137,10 @@ "name":"org.newsclub.net.unix.NoSuchDeviceSocketException", "methods":[{"name":"","parameterTypes":["java.lang.String"] }] }, +{ + "name":"org.newsclub.net.unix.NotConnectedSocketException", + "methods":[{"name":"","parameterTypes":["java.lang.String"] }] +}, { "name":"org.newsclub.net.unix.OperationNotSupportedSocketException", "methods":[{"name":"","parameterTypes":["java.lang.String"] }] diff --git a/junixsocket-native-graalvm/output/META-INF/native-image/com.kohlschutter.junixsocket/junixsocket-native-graalvm/reflect-config.json b/junixsocket-native-graalvm/output/META-INF/native-image/com.kohlschutter.junixsocket/junixsocket-native-graalvm/reflect-config.json index 8dc4ca57f..66799488d 100644 --- a/junixsocket-native-graalvm/output/META-INF/native-image/com.kohlschutter.junixsocket/junixsocket-native-graalvm/reflect-config.json +++ b/junixsocket-native-graalvm/output/META-INF/native-image/com.kohlschutter.junixsocket/junixsocket-native-graalvm/reflect-config.json @@ -190,7 +190,20 @@ "name":"java.net.InetSocketAddress" }, { - "name":"java.net.UnixDomainSocketAddress" + "name":"java.net.UnixDomainSocketAddress", + "methods":[{"name":"of","parameterTypes":["java.nio.file.Path"] }] +}, +{ + "name":"java.nio.channels.DatagramChannel", + "methods":[{"name":"open","parameterTypes":["java.net.ProtocolFamily"] }] +}, +{ + "name":"java.nio.channels.ServerSocketChannel", + "methods":[{"name":"open","parameterTypes":["java.net.ProtocolFamily"] }] +}, +{ + "name":"java.nio.channels.SocketChannel", + "methods":[{"name":"open","parameterTypes":["java.net.ProtocolFamily"] }] }, { "name":"java.nio.channels.spi.AbstractSelectableChannel" @@ -316,6 +329,10 @@ "name":"org.junit.jupiter.api.Test", "queryAllPublicMethods":true }, +{ + "name":"org.junit.jupiter.api.TestInstance", + "queryAllPublicMethods":true +}, { "name":"org.junit.jupiter.api.TestMethodOrder", "queryAllPublicMethods":true @@ -367,6 +384,16 @@ "name":"org.junit.jupiter.params.provider.EnumSource", "queryAllPublicMethods":true }, +{ + "name":"org.junit.jupiter.params.provider.MethodArgumentsProvider", + "queryAllDeclaredMethods":true, + "queryAllPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.junit.jupiter.params.provider.MethodSource", + "queryAllPublicMethods":true +}, { "name":"org.junit.jupiter.params.support.AnnotationConsumer", "queryAllPublicMethods":true @@ -573,6 +600,14 @@ "queryAllDeclaredConstructors":true, "methods":[{"name":"","parameterTypes":[] }, {"name":"testFromToBytes","parameterTypes":[] }, {"name":"testHostnameString","parameterTypes":[] }, {"name":"testHostnameStringEndsWithJunixSocket","parameterTypes":[] }, {"name":"testIsLoopbackAddress","parameterTypes":[] }] }, +{ + "name":"org.newsclub.net.unix.InterruptIssue158Test", + "allDeclaredFields":true, + "allDeclaredClasses":true, + "queryAllDeclaredMethods":true, + "queryAllPublicMethods":true, + "methods":[{"name":"afterEach","parameterTypes":[] }, {"name":"beforeEach","parameterTypes":["org.junit.jupiter.api.TestInfo"] }, {"name":"clientProvider","parameterTypes":[] }, {"name":"serverProvider","parameterTypes":[] }, {"name":"testClientInterruption","parameterTypes":["boolean","org.newsclub.net.unix.InterruptIssue158Test$IOSupplier","org.newsclub.net.unix.InterruptIssue158Test$IOConsumer","java.lang.Class","java.util.function.Predicate"] }, {"name":"testClientInterruptionWithDelay","parameterTypes":["boolean","org.newsclub.net.unix.InterruptIssue158Test$IOSupplier","org.newsclub.net.unix.InterruptIssue158Test$IOConsumer","java.lang.Class","java.util.function.Predicate"] }, {"name":"testServerInterruption","parameterTypes":["org.newsclub.net.unix.InterruptIssue158Test$IOSupplier","org.newsclub.net.unix.InterruptIssue158Test$IOConsumer","java.lang.Class","java.util.function.Predicate"] }, {"name":"testServerInterruptionWithDelay","parameterTypes":["org.newsclub.net.unix.InterruptIssue158Test$IOSupplier","org.newsclub.net.unix.InterruptIssue158Test$IOConsumer","java.lang.Class","java.util.function.Predicate"] }] +}, { "name":"org.newsclub.net.unix.InterruptTest", "allDeclaredFields":true, @@ -656,7 +691,7 @@ "allDeclaredClasses":true, "queryAllDeclaredMethods":true, "queryAllPublicMethods":true, - "methods":[{"name":"testByteBufferWithPositionOffset","parameterTypes":[] }, {"name":"testDoubleBindAddressNotReusable","parameterTypes":[] }, {"name":"testDoubleBindAddressReusable","parameterTypes":[] }, {"name":"testNonBlockingConnect","parameterTypes":[] }] + "methods":[{"name":"testAcceptNotBoundYet","parameterTypes":[] }, {"name":"testByteBufferWithPositionOffset","parameterTypes":[] }, {"name":"testDoubleBindAddressNotReusable","parameterTypes":[] }, {"name":"testDoubleBindAddressReusable","parameterTypes":[] }, {"name":"testNonBlockingConnect","parameterTypes":[] }, {"name":"testReadNotConnectedYet","parameterTypes":[] }, {"name":"testWriteNotConnectedYet","parameterTypes":[] }] }, { "name":"org.newsclub.net.unix.SocketClosedException" @@ -817,6 +852,15 @@ "queryAllDeclaredConstructors":true, "methods":[{"name":"","parameterTypes":[] }, {"name":"testAncillaryReceiveBufferTooSmall","parameterTypes":[] }, {"name":"testBadFileDescriptor","parameterTypes":[] }, {"name":"testDatagramSocket","parameterTypes":[] }, {"name":"testEmptyFileDescriptorArray","parameterTypes":[] }, {"name":"testFileInputStream","parameterTypes":[] }, {"name":"testFileInputStreamPartiallyConsumed","parameterTypes":[] }, {"name":"testNoAncillaryReceiveBuffer","parameterTypes":[] }, {"name":"testNullFileDescriptorArray","parameterTypes":[] }, {"name":"testSendRecvFileDescriptors","parameterTypes":[] }] }, +{ + "name":"org.newsclub.net.unix.domain.InterruptIssue158Test", + "allDeclaredFields":true, + "allDeclaredClasses":true, + "queryAllDeclaredMethods":true, + "queryAllPublicMethods":true, + "queryAllDeclaredConstructors":true, + "methods":[{"name":"","parameterTypes":[] }] +}, { "name":"org.newsclub.net.unix.domain.InterruptTest", "allDeclaredFields":true, @@ -905,7 +949,7 @@ "queryAllDeclaredMethods":true, "queryAllPublicMethods":true, "queryAllDeclaredConstructors":true, - "methods":[{"name":"","parameterTypes":[] }] + "methods":[{"name":"","parameterTypes":[] }, {"name":"testUnixDomainProtocolFamily","parameterTypes":[] }] }, { "name":"org.newsclub.net.unix.domain.SocketFactoryTest", @@ -981,6 +1025,15 @@ { "name":"org.newsclub.net.unix.generic.AFGenericSelectorProvider" }, +{ + "name":"org.newsclub.net.unix.java.InterruptIssue158Test", + "allDeclaredFields":true, + "allDeclaredClasses":true, + "queryAllDeclaredMethods":true, + "queryAllPublicMethods":true, + "queryAllDeclaredConstructors":true, + "methods":[{"name":"","parameterTypes":[] }] +}, { "name":"org.newsclub.net.unix.java.InterruptTest", "allDeclaredFields":true, @@ -1007,6 +1060,15 @@ "queryAllDeclaredConstructors":true, "methods":[{"name":"","parameterTypes":[] }] }, +{ + "name":"org.newsclub.net.unix.java.SocketChannelTest", + "allDeclaredFields":true, + "allDeclaredClasses":true, + "queryAllDeclaredMethods":true, + "queryAllPublicMethods":true, + "queryAllDeclaredConstructors":true, + "methods":[{"name":"","parameterTypes":[] }] +}, { "name":"org.newsclub.net.unix.java.ThroughputTest", "allDeclaredFields":true, @@ -1016,6 +1078,24 @@ "queryAllDeclaredConstructors":true, "methods":[{"name":"","parameterTypes":[] }] }, +{ + "name":"org.newsclub.net.unix.jep380.InterruptIssue158Test", + "allDeclaredFields":true, + "allDeclaredClasses":true, + "queryAllDeclaredMethods":true, + "queryAllPublicMethods":true, + "queryAllDeclaredConstructors":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.newsclub.net.unix.jep380.SocketChannelTest", + "allDeclaredFields":true, + "allDeclaredClasses":true, + "queryAllDeclaredMethods":true, + "queryAllPublicMethods":true, + "queryAllDeclaredConstructors":true, + "methods":[{"name":"","parameterTypes":[] }] +}, { "name":"org.newsclub.net.unix.rmi.AFRMIService", "queryAllPublicMethods":true diff --git a/junixsocket-selftest/src/main/resources/META-INF/native-image/com.kohlschutter.junixsocket/junixsocket-selftest/reflect-config.json b/junixsocket-selftest/src/main/resources/META-INF/native-image/com.kohlschutter.junixsocket/junixsocket-selftest/reflect-config.json index 73267ef1d..ec1c1649d 100644 --- a/junixsocket-selftest/src/main/resources/META-INF/native-image/com.kohlschutter.junixsocket/junixsocket-selftest/reflect-config.json +++ b/junixsocket-selftest/src/main/resources/META-INF/native-image/com.kohlschutter.junixsocket/junixsocket-selftest/reflect-config.json @@ -60,6 +60,10 @@ "name":"org.junit.jupiter.api.Test", "queryAllPublicMethods":true }, +{ + "name":"org.junit.jupiter.api.TestInstance", + "queryAllPublicMethods":true +}, { "name":"org.junit.jupiter.api.TestMethodOrder", "queryAllPublicMethods":true @@ -530,6 +534,15 @@ "allPublicMethods":true, "allDeclaredConstructors":true }, +{ + "name":"org.newsclub.net.unix.java.SocketChannelTest", + "allDeclaredMethods":true, + "allDeclaredFields":true, + "allDeclaredClasses":true, + "queryAllDeclaredMethods":true, + "allPublicMethods":true, + "allDeclaredConstructors":true +}, { "name":"org.newsclub.net.unix.java.ThroughputTest", "allDeclaredFields":true, @@ -538,6 +551,15 @@ "allPublicMethods":true, "allDeclaredConstructors":true }, +{ + "name":"org.newsclub.net.unix.jep380.SocketChannelTest", + "allDeclaredMethods":true, + "allDeclaredFields":true, + "allDeclaredClasses":true, + "queryAllDeclaredMethods":true, + "allPublicMethods":true, + "allDeclaredConstructors":true +}, { "name":"org.newsclub.net.unix.java.JavaInetStackCondition", "methods":[{"name":"","parameterTypes":[] }] @@ -1039,6 +1061,16 @@ "name":"org.junit.jupiter.params.provider.EnumSource", "queryAllPublicMethods":true }, +{ + "name":"org.junit.jupiter.params.provider.MethodArgumentsProvider", + "queryAllDeclaredMethods":true, + "queryAllPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.junit.jupiter.params.provider.MethodSource", + "queryAllPublicMethods":true +}, { "name":"org.junit.jupiter.params.support.AnnotationConsumer", "queryAllPublicMethods":true @@ -1071,6 +1103,39 @@ "queryAllPublicMethods":true, "queryAllDeclaredConstructors":true }, +{ + "name":"org.newsclub.net.unix.InterruptIssue158Test", + "allDeclaredConstructors" : true, + "allPublicConstructors" : true, + "allDeclaredMethods":true, + "allDeclaredFields":true, + "allDeclaredClasses":true, + "queryAllDeclaredMethods":true, + "queryAllPublicMethods":true, + "queryAllDeclaredConstructors":true +}, +{ + "name":"org.newsclub.net.unix.domain.InterruptIssue158Test", + "allDeclaredConstructors" : true, + "allPublicConstructors" : true, + "allDeclaredMethods":true, + "allDeclaredFields":true, + "allDeclaredClasses":true, + "queryAllDeclaredMethods":true, + "queryAllPublicMethods":true, + "queryAllDeclaredConstructors":true +}, +{ + "name":"org.newsclub.net.unix.jep380.InterruptIssue158Test", + "allDeclaredConstructors" : true, + "allPublicConstructors" : true, + "allDeclaredMethods":true, + "allDeclaredFields":true, + "allDeclaredClasses":true, + "queryAllDeclaredMethods":true, + "queryAllPublicMethods":true, + "queryAllDeclaredConstructors":true +}, { "name":"org.newsclub.net.unix.rmi.NaiveFileInputStreamRemote", "allDeclaredConstructors" : true,