Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RB_ID=757326
- Loading branch information
Showing
13 changed files
with
145 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
inject/inject-server/src/test/scala/com/twitter/inject/server/tests/PortUtilsTest.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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) | ||
} | ||
} | ||
|
||
} |
22 changes: 22 additions & 0 deletions
22
inject/inject-server/src/test/scala/com/twitter/server/tests/FinagleBuildRevisionTest.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.twitter.server.tests | ||
|
||
import com.twitter.inject.Test | ||
import com.twitter.server.internal.FinagleBuildRevision | ||
import org.apache.commons.lang.RandomStringUtils | ||
|
||
class FinagleBuildRevisionTest extends Test { | ||
|
||
val revision = "e748e2fe89da63923e525b71f82f398b18c9a60c" | ||
|
||
"build revision" should { | ||
|
||
"parse revision" in { | ||
FinagleBuildRevision.convertBuildRevision(revision) should be(993360281225L) | ||
} | ||
|
||
"fail revision parsing" in { | ||
FinagleBuildRevision.convertBuildRevision(RandomStringUtils.randomAlphanumeric(20)) should be(-1L) | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters