#2469 - Switching to scala.util.Try instead of Either[Throwable, T] in the codebase

This commit is contained in:
Viktor Klang 2012-09-06 03:17:51 +02:00
parent 6e4b0dc3de
commit 4eee04cb60
21 changed files with 123 additions and 249 deletions

View file

@ -79,15 +79,7 @@ class DaemonMsgCreateSerializerSpec extends AkkaSpec {
}
def verifySerialization(msg: DaemonMsgCreate): Unit = {
val bytes = ser.serialize(msg) match {
case Left(exception) fail(exception)
case Right(bytes) bytes
}
ser.deserialize(bytes.asInstanceOf[Array[Byte]], classOf[DaemonMsgCreate]) match {
case Left(exception) fail(exception)
case Right(m: DaemonMsgCreate) assertDaemonMsgCreate(msg, m)
case other throw new MatchError(other)
}
assertDaemonMsgCreate(msg, ser.deserialize(ser.serialize(msg).get, classOf[DaemonMsgCreate]).get.asInstanceOf[DaemonMsgCreate])
}
def assertDaemonMsgCreate(expected: DaemonMsgCreate, got: DaemonMsgCreate): Unit = {