Merge pull request #16550 from akka/wip-16400-javadsl-stream-io-patriknw

!str #16400 Add Java API for StreamTcp
This commit is contained in:
Patrik Nordwall 2014-12-18 13:19:20 +01:00
commit ef2835d60e
18 changed files with 548 additions and 167 deletions

View file

@ -12,7 +12,6 @@ import akka.event.LoggingAdapter
import akka.util.ByteString
import akka.io.Inet
import akka.stream.FlowMaterializer
import akka.stream.io.StreamTcp
import akka.stream.scaladsl._
import akka.http.engine.client.{ HttpClient, ClientConnectionSettings }
import akka.http.engine.server.{ HttpServer, ServerSettings }
@ -201,7 +200,7 @@ object Http extends ExtensionId[HttpExt] with ExtensionIdProvider {
* A flow representing the HTTP server on a single HTTP connection.
* This flow can be materialized several times, every materialization will open a new connection to the `remoteAddress`.
* If the connection cannot be established the materialized stream will immediately be terminated
* with a [[StreamTcp.ConnectionAttemptFailedException]].
* with a [[akka.stream.StreamTcpException]].
*/
def flow: Flow[HttpRequest, HttpResponse]
}

View file

@ -12,7 +12,8 @@ import scala.concurrent.Await
import scala.concurrent.duration._
import org.scalatest.{ BeforeAndAfterAll, Matchers, WordSpec }
import akka.actor.ActorSystem
import akka.stream.io.StreamTcp
import akka.stream.scaladsl.StreamTcp
import akka.stream.BindFailedException
import akka.stream.FlowMaterializer
import akka.stream.testkit.StreamTestKit
import akka.stream.testkit.StreamTestKit.{ PublisherProbe, SubscriberProbe }
@ -55,7 +56,7 @@ class ClientServerSpec extends WordSpec with Matchers with BeforeAndAfterAll {
val probe2 = StreamTestKit.SubscriberProbe[Http.IncomingConnection]()
binding.connections.runWith(Sink(probe2))
probe2.expectError(StreamTcp.BindFailedException)
probe2.expectError(BindFailedException)
Await.result(binding.unbind(mm1), 1.second)
val probe3 = StreamTestKit.SubscriberProbe[Http.IncomingConnection]()