/
PortUtilsTest.scala
46 lines (37 loc) · 1.38 KB
/
PortUtilsTest.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package com.twitter.inject.server.tests
import com.twitter.finagle.builder.Server
import com.twitter.inject.Test
import com.twitter.inject.server.PortUtils
import com.twitter.util.Awaitable.CanAwait
import com.twitter.util.{Time, Duration}
import java.net.InetSocketAddress
class PortUtilsTest extends Test {
"PortUtils" should {
"getPort for Server" in {
PortUtils.getPort(new Server {
/**
* The address to which this server is bound.
*/
override def boundAddress = new InetSocketAddress(9999)
override protected def closeServer(deadline: Time) = ???
/**
* Support for `Await.result`. The use of the implicit permit is an
* access control mechanism: only `Await.result` may call this
* method.
*/
override def result(timeout: Duration)(implicit permit: CanAwait) = ???
/**
* Is this Awaitable ready? In other words: would calling
* [[com.twitter.util.Awaitable.ready Awaitable.ready]] block?
*/
override def isReady(implicit permit: CanAwait) = ???
/**
* Support for `Await.ready`. The use of the implicit permit is an
* access control mechanism: only `Await.ready` may call this
* method.
*/
override def ready(timeout: Duration)(implicit permit: CanAwait) = ???
}) should be(9999)
}
}
}