format the code

* just a clean test:compile
* and fixing the tweets Source
This commit is contained in:
Patrik Nordwall 2016-05-10 11:38:46 +02:00
parent 10a252d9ed
commit d5a3b26291
5 changed files with 13 additions and 12 deletions

View file

@ -3,7 +3,7 @@ package akka.cluster.pubsub
import akka.testkit._ import akka.testkit._
import akka.routing.{ ConsistentHashingRoutingLogic, RouterEnvelope } import akka.routing.{ ConsistentHashingRoutingLogic, RouterEnvelope }
import org.scalatest.WordSpecLike import org.scalatest.WordSpecLike
import akka.actor.{DeadLetter, ActorRef} import akka.actor.{ DeadLetter, ActorRef }
import com.typesafe.config.ConfigFactory import com.typesafe.config.ConfigFactory
case class WrappedMessage(msg: String) extends RouterEnvelope { case class WrappedMessage(msg: String) extends RouterEnvelope {

View file

@ -7,7 +7,7 @@ package docs.http.scaladsl.server.directives
import akka.http.scaladsl.model.ContentTypes._ import akka.http.scaladsl.model.ContentTypes._
import akka.http.scaladsl.model._ import akka.http.scaladsl.model._
import akka.http.scaladsl.model.headers.`Content-Type` import akka.http.scaladsl.model.headers.`Content-Type`
import akka.http.scaladsl.server.{Route, ValidationRejection} import akka.http.scaladsl.server.{ Route, ValidationRejection }
import akka.testkit.EventFilter import akka.testkit.EventFilter
import docs.http.scaladsl.server.RoutingSpec import docs.http.scaladsl.server.RoutingSpec

View file

@ -31,12 +31,13 @@ object TwitterStreamQuickstartDocSpec {
val akka = Hashtag("#akka") val akka = Hashtag("#akka")
//#model //#model
// format: OFF abstract class TweetSourceDecl {
//#tweet-source //#tweet-source
val tweets: Source[Tweet, NotUsed] val tweets: Source[Tweet, NotUsed]
//#tweet-source //#tweet-source
// format: ON }
= Source(
val tweets: Source[Tweet, NotUsed] = Source(
Tweet(Author("rolandkuhn"), System.currentTimeMillis, "#akka rocks!") :: Tweet(Author("rolandkuhn"), System.currentTimeMillis, "#akka rocks!") ::
Tweet(Author("patriknw"), System.currentTimeMillis, "#akka !") :: Tweet(Author("patriknw"), System.currentTimeMillis, "#akka !") ::
Tweet(Author("bantonsson"), System.currentTimeMillis, "#akka !") :: Tweet(Author("bantonsson"), System.currentTimeMillis, "#akka !") ::

View file

@ -444,7 +444,7 @@ object PersistentFSMSpec {
reportActor ! ShoppingCardDiscarded reportActor ! ShoppingCardDiscarded
saveStateSnapshot() saveStateSnapshot()
} }
//#customer-snapshot-example //#customer-snapshot-example
case Event(GetCurrentCart, data) case Event(GetCurrentCart, data)
stay replying data stay replying data
case Event(StateTimeout, _) case Event(StateTimeout, _)

View file

@ -133,7 +133,7 @@ class TimeoutsSpec extends AkkaSpec {
"BackpressureTimeout" must { "BackpressureTimeout" must {
"pass through elements unmodified" in assertAllStagesStopped { "pass through elements unmodified" in assertAllStagesStopped {
Await.result(Source(1 to 100).backpressureTimeout(1.second).grouped(200).runWith(Sink.head), 3.seconds) should === (1 to 100) Await.result(Source(1 to 100).backpressureTimeout(1.second).grouped(200).runWith(Sink.head), 3.seconds) should ===(1 to 100)
} }
"succeed if subscriber demand arrives" in assertAllStagesStopped { "succeed if subscriber demand arrives" in assertAllStagesStopped {
@ -203,7 +203,7 @@ class TimeoutsSpec extends AkkaSpec {
Thread.sleep(3000) Thread.sleep(3000)
subscriber.expectError().getMessage should === ("No demand signalled in the last 1 second.") subscriber.expectError().getMessage should ===("No demand signalled in the last 1 second.")
} }
"throw if subscriber never generate demand" in assertAllStagesStopped { "throw if subscriber never generate demand" in assertAllStagesStopped {
@ -218,7 +218,7 @@ class TimeoutsSpec extends AkkaSpec {
Thread.sleep(3000) Thread.sleep(3000)
subscriber.expectError().getMessage should === ("No demand signalled in the last 1 second.") subscriber.expectError().getMessage should ===("No demand signalled in the last 1 second.")
} }
"not throw if publisher completes without fulfilling subscriber's demand" in assertAllStagesStopped { "not throw if publisher completes without fulfilling subscriber's demand" in assertAllStagesStopped {