1
1
package com.mongodb.internal.connection
2
2
3
- import util.spock.annotations.Slow
4
3
import com.mongodb.MongoSocketException
5
4
import com.mongodb.MongoSocketOpenException
6
5
import com.mongodb.ServerAddress
@@ -9,10 +8,9 @@ import com.mongodb.connection.SocketSettings
9
8
import com.mongodb.connection.SslSettings
10
9
import spock.lang.IgnoreIf
11
10
import spock.lang.Specification
11
+ import util.spock.annotations.Slow
12
12
13
- import java.nio.channels.AsynchronousChannelGroup
14
13
import java.util.concurrent.CountDownLatch
15
- import java.util.concurrent.Executors
16
14
17
15
import static com.mongodb.ClusterFixture.getSslSettings
18
16
import static java.util.concurrent.TimeUnit.MILLISECONDS
@@ -26,8 +24,7 @@ class AsyncSocketChannelStreamSpecification extends Specification {
26
24
def port = 27017
27
25
def socketSettings = SocketSettings . builder(). connectTimeout(100 , MILLISECONDS ). build()
28
26
def sslSettings = SslSettings . builder(). build()
29
- def channelGroup = AsynchronousChannelGroup . withThreadPool(Executors . newFixedThreadPool(5 ))
30
- def factoryFactory = AsynchronousSocketChannelStreamFactoryFactory . builder(). group(channelGroup). build()
27
+ def factoryFactory = new AsynchronousSocketChannelStreamFactoryFactory ()
31
28
def factory = factoryFactory. create(socketSettings, sslSettings)
32
29
def inetAddresses = [new InetSocketAddress (InetAddress . getByName(' 192.168.255.255' ), port),
33
30
new InetSocketAddress (InetAddress . getByName(' 127.0.0.1' ), port)]
@@ -51,9 +48,7 @@ class AsyncSocketChannelStreamSpecification extends Specification {
51
48
def port = 27017
52
49
def socketSettings = SocketSettings . builder(). connectTimeout(100 , MILLISECONDS ). build()
53
50
def sslSettings = SslSettings . builder(). build()
54
- def factoryFactory = AsynchronousSocketChannelStreamFactoryFactory . builder()
55
- .group(AsynchronousChannelGroup . withThreadPool(Executors . newFixedThreadPool(5 )))
56
- .build()
51
+ def factoryFactory = new AsynchronousSocketChannelStreamFactoryFactory ()
57
52
58
53
def factory = factoryFactory. create(socketSettings, sslSettings)
59
54
@@ -81,7 +76,7 @@ class AsyncSocketChannelStreamSpecification extends Specification {
81
76
82
77
def stream = new AsynchronousSocketChannelStream (serverAddress,
83
78
SocketSettings . builder(). connectTimeout(100 , MILLISECONDS ). build(),
84
- new PowerOfTwoBufferPool (), null )
79
+ new PowerOfTwoBufferPool ())
85
80
def callback = new CallbackErrorHolder ()
86
81
87
82
when :
0 commit comments