8
8
import java .nio .channels .SocketChannel ;
9
9
import java .nio .file .Files ;
10
10
import java .nio .file .Path ;
11
+ import java .time .Duration ;
11
12
import java .util .concurrent .atomic .AtomicBoolean ;
12
13
import org .junit .jupiter .api .Test ;
13
14
@@ -19,16 +20,16 @@ public class TunnelingJdkSocketTest {
19
20
20
21
@ Test
21
22
public void testTimeout () throws Exception {
22
- // Path socketPath = getSocketPath();
23
- // UnixDomainSocketAddress socketAddress = UnixDomainSocketAddress.of(socketPath);
24
- // startServer(socketAddress);
25
- // TunnelingJdkSocket clientSocket = createClient(socketPath);
26
- //
27
- // assertTimeoutPreemptively(
28
- // Duration.ofMillis(testTimeout), () -> clientSocket.getInputStream().read());
29
- //
30
- // clientSocket.close();
31
- // isServerRunning.set(false);
23
+ Path socketPath = getSocketPath ();
24
+ UnixDomainSocketAddress socketAddress = UnixDomainSocketAddress .of (socketPath );
25
+ startServer (socketAddress );
26
+ TunnelingJdkSocket clientSocket = createClient (socketPath );
27
+
28
+ assertTimeoutPreemptively (
29
+ Duration .ofMillis (testTimeout ), () -> clientSocket .getInputStream ().read ());
30
+
31
+ clientSocket .close ();
32
+ isServerRunning .set (false );
32
33
}
33
34
34
35
private Path getSocketPath () throws IOException {
0 commit comments