Merge pull request #996 from akka/wip-make-fsmdocspec-use-bytestring-√
Switching to ByteString in FSMDocSpec to get rid of warnings in pattern ...
This commit is contained in:
commit
d719a6809c
1 changed files with 5 additions and 5 deletions
|
|
@ -6,6 +6,8 @@ package docs.actor
|
||||||
import language.postfixOps
|
import language.postfixOps
|
||||||
|
|
||||||
import akka.testkit.{ AkkaSpec ⇒ MyFavoriteTestFrameWorkPlusAkkaTestKit }
|
import akka.testkit.{ AkkaSpec ⇒ MyFavoriteTestFrameWorkPlusAkkaTestKit }
|
||||||
|
import akka.util.ByteString
|
||||||
|
|
||||||
//#test-code
|
//#test-code
|
||||||
import akka.actor.Props
|
import akka.actor.Props
|
||||||
import scala.collection.immutable
|
import scala.collection.immutable
|
||||||
|
|
@ -129,8 +131,7 @@ class FSMDocSpec extends MyFavoriteTestFrameWorkPlusAkkaTestKit {
|
||||||
|
|
||||||
//#transform-syntax
|
//#transform-syntax
|
||||||
when(SomeState)(transform {
|
when(SomeState)(transform {
|
||||||
case Event(bytes: Array[Byte], read) ⇒ stay using (read + bytes.length)
|
case Event(bytes: ByteString, read) ⇒ stay using (read + bytes.length)
|
||||||
case Event(bytes: List[Byte], read) ⇒ stay using (read + bytes.size)
|
|
||||||
} using {
|
} using {
|
||||||
case s @ FSM.State(state, read, timeout, stopReason, replies) if read > 1000 ⇒
|
case s @ FSM.State(state, read, timeout, stopReason, replies) if read > 1000 ⇒
|
||||||
goto(Processing)
|
goto(Processing)
|
||||||
|
|
@ -144,8 +145,7 @@ class FSMDocSpec extends MyFavoriteTestFrameWorkPlusAkkaTestKit {
|
||||||
}
|
}
|
||||||
|
|
||||||
when(SomeState)(transform {
|
when(SomeState)(transform {
|
||||||
case Event(bytes: Array[Byte], read) ⇒ stay using (read + bytes.length)
|
case Event(bytes: ByteString, read) ⇒ stay using (read + bytes.length)
|
||||||
case Event(bytes: List[Byte], read) ⇒ stay using (read + bytes.size)
|
|
||||||
} using processingTrigger)
|
} using processingTrigger)
|
||||||
//#alt-transform-syntax
|
//#alt-transform-syntax
|
||||||
|
|
||||||
|
|
@ -211,7 +211,7 @@ class FSMDocSpec extends MyFavoriteTestFrameWorkPlusAkkaTestKit {
|
||||||
expectMsg(Batch(immutable.Seq(45)))
|
expectMsg(Batch(immutable.Seq(45)))
|
||||||
}
|
}
|
||||||
|
|
||||||
"batch not if uninitialized" in {
|
"not batch if uninitialized" in {
|
||||||
val buncher = system.actorOf(Props(new Buncher))
|
val buncher = system.actorOf(Props(new Buncher))
|
||||||
buncher ! Queue(42)
|
buncher ! Queue(42)
|
||||||
expectNoMsg
|
expectNoMsg
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue