2012-09-26 17:12:30 +02:00
|
|
|
/**
|
2014-02-02 19:05:45 -06:00
|
|
|
* Copyright (C) 2009-2014 Typesafe Inc. <http://www.typesafe.com>
|
2012-09-26 17:12:30 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
package akka.camel
|
2013-12-17 14:25:56 +01:00
|
|
|
import org.scalatest.Matchers
|
2012-09-26 17:12:30 +02:00
|
|
|
import org.scalatest.WordSpec
|
|
|
|
|
import akka.actor.ActorSystem
|
2012-10-12 14:21:54 +02:00
|
|
|
import scala.concurrent.duration.Duration
|
2012-09-26 17:12:30 +02:00
|
|
|
import java.util.concurrent.TimeUnit._
|
2013-05-02 17:12:36 +02:00
|
|
|
import akka.testkit.TestKit
|
2014-01-09 14:09:52 +01:00
|
|
|
import akka.util.Helpers.ConfigOps
|
2012-09-26 17:12:30 +02:00
|
|
|
|
2013-12-17 14:25:56 +01:00
|
|
|
class CamelConfigSpec extends WordSpec with Matchers {
|
2012-09-26 17:12:30 +02:00
|
|
|
|
2012-09-26 17:30:09 +02:00
|
|
|
val (settings, config) = {
|
|
|
|
|
val system = ActorSystem("CamelConfigSpec")
|
|
|
|
|
val result = (CamelExtension(system).settings, system.settings.config)
|
2013-05-02 17:12:36 +02:00
|
|
|
TestKit.shutdownActorSystem(system)
|
2012-09-26 17:30:09 +02:00
|
|
|
result
|
|
|
|
|
}
|
2012-09-26 17:12:30 +02:00
|
|
|
"CamelConfigSpec" must {
|
2012-09-26 17:30:09 +02:00
|
|
|
"have correct activationTimeout config" in {
|
2014-01-31 11:14:13 +01:00
|
|
|
settings.ActivationTimeout should be(config.getMillisDuration("akka.camel.consumer.activation-timeout"))
|
2012-09-26 17:30:09 +02:00
|
|
|
}
|
2012-09-26 17:12:30 +02:00
|
|
|
|
2012-09-26 17:30:09 +02:00
|
|
|
"have correct autoAck config" in {
|
2014-01-31 11:14:13 +01:00
|
|
|
settings.AutoAck should be(config.getBoolean("akka.camel.consumer.auto-ack"))
|
2012-09-26 17:30:09 +02:00
|
|
|
}
|
2012-09-26 17:12:30 +02:00
|
|
|
|
2012-09-26 17:30:09 +02:00
|
|
|
"have correct replyTimeout config" in {
|
2014-01-31 11:14:13 +01:00
|
|
|
settings.ReplyTimeout should be(config.getMillisDuration("akka.camel.consumer.reply-timeout"))
|
2012-09-26 17:30:09 +02:00
|
|
|
}
|
2012-09-26 17:12:30 +02:00
|
|
|
|
2012-09-26 17:30:09 +02:00
|
|
|
"have correct streamingCache config" in {
|
2014-01-31 11:14:13 +01:00
|
|
|
settings.StreamingCache should be(config.getBoolean("akka.camel.streamingCache"))
|
2012-09-26 17:30:09 +02:00
|
|
|
}
|
2012-09-26 17:12:30 +02:00
|
|
|
|
2012-09-26 17:30:09 +02:00
|
|
|
"have correct jmxStatistics config" in {
|
2014-01-31 11:14:13 +01:00
|
|
|
settings.JmxStatistics should be(config.getBoolean("akka.camel.jmx"))
|
2012-09-26 17:30:09 +02:00
|
|
|
}
|
2012-09-26 17:12:30 +02:00
|
|
|
|
2012-09-26 17:30:09 +02:00
|
|
|
"have correct body conversions config" in {
|
|
|
|
|
val conversions = config.getConfig("akka.camel.conversions")
|
2012-09-26 17:12:30 +02:00
|
|
|
|
2014-01-31 11:14:13 +01:00
|
|
|
conversions.getString("file") should be("java.io.InputStream")
|
|
|
|
|
conversions.entrySet.size should be(1)
|
2012-09-26 17:12:30 +02:00
|
|
|
}
|
2014-02-14 16:14:04 +01:00
|
|
|
|
|
|
|
|
"have correct Context Provider" in {
|
|
|
|
|
settings.ContextProvider.isInstanceOf[DefaultContextProvider] should be(true)
|
|
|
|
|
}
|
2012-09-26 17:12:30 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|