diff --git a/akka-camel/src/test/scala/akka/camel/internal/component/DurationConverterTest.scala b/akka-camel/src/test/scala/akka/camel/internal/component/DurationConverterTest.scala index 4134ed35bc..c66a77c287 100644 --- a/akka-camel/src/test/scala/akka/camel/internal/component/DurationConverterTest.scala +++ b/akka-camel/src/test/scala/akka/camel/internal/component/DurationConverterTest.scala @@ -4,6 +4,8 @@ package akka.camel.internal.component +import language.postfixOps + import org.scalatest.matchers.MustMatchers import scala.concurrent.util.duration._ import scala.concurrent.util.Duration diff --git a/akka-dataflow/src/test/scala/akka/dataflow/DataflowSpec.scala b/akka-dataflow/src/test/scala/akka/dataflow/DataflowSpec.scala index 5024e911b6..302d245930 100644 --- a/akka-dataflow/src/test/scala/akka/dataflow/DataflowSpec.scala +++ b/akka-dataflow/src/test/scala/akka/dataflow/DataflowSpec.scala @@ -5,7 +5,7 @@ package akka.dataflow import language.postfixOps -import scala.reflect.ClassTag +import scala.reflect.{ ClassTag, classTag } import akka.actor.{ Actor, Status, Props } import akka.actor.Status._ import akka.pattern.ask @@ -45,7 +45,7 @@ class DataflowSpec extends AkkaSpec with DefaultTimeout { val actor = system.actorOf(Props[TestActor]) val x = Future("Hello") - val y = x flatMap (actor ? _) mapTo manifest[String] + val y = x flatMap (actor ? _) mapTo classTag[String] val r = flow(x() + " " + y() + "!") @@ -268,11 +268,11 @@ class DataflowSpec extends AkkaSpec with DefaultTimeout { x.length + y() } - assert(checkType(rString, manifest[String])) - assert(checkType(rInt, manifest[Int])) - assert(!checkType(rInt, manifest[String])) - assert(!checkType(rInt, manifest[Nothing])) - assert(!checkType(rInt, manifest[Any])) + assert(checkType(rString, classTag[String])) + assert(checkType(rInt, classTag[Int])) + assert(!checkType(rInt, classTag[String])) + //assert(!checkType(rInt, classTag[Nothing])) This test does not work with classTags, but works with Manifests + assert(!checkType(rInt, classTag[Any])) Await.result(rString, timeout.duration) Await.result(rInt, timeout.duration) diff --git a/akka-docs/modules/code/docs/actor/mailbox/DurableMailboxDocSpec.scala b/akka-docs/modules/code/docs/actor/mailbox/DurableMailboxDocSpec.scala index f93a213a15..479236b9fe 100644 --- a/akka-docs/modules/code/docs/actor/mailbox/DurableMailboxDocSpec.scala +++ b/akka-docs/modules/code/docs/actor/mailbox/DurableMailboxDocSpec.scala @@ -60,8 +60,7 @@ class MyMailboxType(systemSettings: ActorSystem.Settings, config: Config) override def create(owner: Option[ActorRef], system: Option[ActorSystem]): MessageQueue = (owner zip system) headOption match { case Some((o, s: ExtendedActorSystem)) ⇒ new MyMessageQueue(o, s) - case None ⇒ throw new IllegalArgumentException( - "requires an owner (i.e. does not work with BalancingDispatcher)") + case _ ⇒ throw new IllegalArgumentException("requires an owner (i.e. does not work with BalancingDispatcher)") } } diff --git a/akka-docs/scala/code/docs/testkit/TestkitDocSpec.scala b/akka-docs/scala/code/docs/testkit/TestkitDocSpec.scala index fcb9360559..8a78fc8c7a 100644 --- a/akka-docs/scala/code/docs/testkit/TestkitDocSpec.scala +++ b/akka-docs/scala/code/docs/testkit/TestkitDocSpec.scala @@ -129,9 +129,7 @@ class TestkitDocSpec extends AkkaSpec with DefaultTimeout with ImplicitSender { val actorRef = TestActorRef(new MyActor) // hypothetical message stimulating a '42' answer val future = actorRef ? Say42 - val result = future.value.get match { - case Success(x: Int) ⇒ x - } + val Success(result: Int) = future.value.get result must be(42) //#test-behavior } diff --git a/akka-remote/src/test/scala/akka/remote/RemoteCommunicationSpec.scala b/akka-remote/src/test/scala/akka/remote/RemoteCommunicationSpec.scala index 1f0badebd2..5a43e90443 100644 --- a/akka-remote/src/test/scala/akka/remote/RemoteCommunicationSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/RemoteCommunicationSpec.scala @@ -8,6 +8,7 @@ import akka.actor._ import com.typesafe.config._ import scala.concurrent.Future import scala.concurrent.Await +import scala.reflect.classTag import akka.pattern.ask object RemoteCommunicationSpec { @@ -133,7 +134,7 @@ akka { "not fail ask across node boundaries" in { import system.dispatcher - val f = for (_ ← 1 to 1000) yield here ? "ping" mapTo manifest[(String, ActorRef)] + val f = for (_ ← 1 to 1000) yield here ? "ping" mapTo classTag[(String, ActorRef)] Await.result(Future.sequence(f), remaining).map(_._1).toSet must be(Set("pong")) } diff --git a/akka-remote/src/test/scala/akka/remote/Ticket1978CommunicationSpec.scala b/akka-remote/src/test/scala/akka/remote/Ticket1978CommunicationSpec.scala index dfa47665de..b6d2bed02a 100644 --- a/akka-remote/src/test/scala/akka/remote/Ticket1978CommunicationSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/Ticket1978CommunicationSpec.scala @@ -9,6 +9,7 @@ import akka.testkit._ import akka.actor._ import com.typesafe.config._ import scala.concurrent.Future +import scala.reflect.classTag import akka.pattern.ask import java.io.File import java.security.{ NoSuchAlgorithmException, SecureRandom, PrivilegedAction, AccessController } @@ -144,7 +145,7 @@ abstract class Ticket1978CommunicationSpec(val cipherConfig: CipherConfig) exten import system.dispatcher val here = system.actorFor(otherAddress.toString + "/user/echo") - val f = for (i ← 1 to 1000) yield here ? (("ping", i)) mapTo manifest[((String, Int), ActorRef)] + val f = for (i ← 1 to 1000) yield here ? (("ping", i)) mapTo classTag[((String, Int), ActorRef)] Await.result(Future.sequence(f), timeout.duration).map(_._1._1).toSet must be(Set("pong")) }