Merge pull request #718 from akka/wip-remwarn-√
Removing compilation warnings.
This commit is contained in:
commit
20c2daf74d
6 changed files with 17 additions and 14 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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,13 @@ 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(intercept[java.lang.Exception] {
|
||||
assert(!checkType(rInt, classTag[Nothing]))
|
||||
}.getMessage == "Nothing is a bottom type, therefore its erasure does not return a value") // When this fails, remove the intercept
|
||||
assert(!checkType(rInt, classTag[Any]))
|
||||
|
||||
Await.result(rString, timeout.duration)
|
||||
Await.result(rInt, timeout.duration)
|
||||
|
|
|
|||
|
|
@ -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)")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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"))
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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"))
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue