Merge pull request #17117 from akka/wip-16910-doc-master-patriknw

=doc #16910 Fix include sections in fault tolerance docs (for validation)
This commit is contained in:
Konrad Malawski 2015-04-02 15:46:21 +02:00
commit 4e8daf19ea
3 changed files with 18 additions and 14 deletions

View file

@ -20,7 +20,6 @@ import scala.collection.immutable.Seq;
import scala.concurrent.Await;
import static akka.pattern.Patterns.ask;
import scala.concurrent.duration.Duration;
import akka.testkit.AkkaSpec;
import akka.testkit.TestProbe;
//#testkit
@ -151,7 +150,7 @@ public class FaultHandlingTest {
@BeforeClass
public static void start() {
system = ActorSystem.create("test", AkkaSpec.testConf());
system = ActorSystem.create("test");
}
@AfterClass

View file

@ -4,12 +4,13 @@
package docs.actor
import language.postfixOps
import akka.actor.{ ActorSystem, ActorRef, Props, Terminated }
import FaultHandlingDocSpec._
//#testkit
import akka.testkit.{ TestKit, ImplicitSender, EventFilter }
import akka.actor.{ ActorRef, Props, ActorSystem, Terminated }
import org.scalatest._
import com.typesafe.config.{ Config, ConfigFactory }
import org.scalatest.{ FlatSpecLike, Matchers, BeforeAndAfterAll }
import akka.testkit.{ TestActors, TestKit, ImplicitSender, EventFilter }
//#testkit
object FaultHandlingDocSpec {
@ -97,14 +98,20 @@ object FaultHandlingDocSpec {
}
""")
}
import FaultHandlingDocSpec._
//#testkit
class FaultHandlingDocSpec extends TestKit(ActorSystem("FaultHandlingDocSpec", testConf))
with FlatSpecLike with BeforeAndAfterAll with ImplicitSender {
class FaultHandlingDocSpec(_system: ActorSystem) extends TestKit(_system)
with ImplicitSender with FlatSpecLike with Matchers with BeforeAndAfterAll {
override def afterAll() {
system.terminate()
def this() = this(ActorSystem("FaultHandlingDocSpec",
ConfigFactory.parseString("""
akka {
loggers = ["akka.testkit.TestEventListener"]
loglevel = "WARNING"
}
""")))
override def afterAll {
TestKit.shutdownActorSystem(system)
}
"A supervisor" must "apply the chosen strategy for its child" in {

View file

@ -126,9 +126,7 @@ This supervisor will be used to create a child, with which we can experiment:
.. includecode:: code/docs/actor/FaultHandlingDocSpec.scala
:include: child
The test is easier by using the utilities described in :ref:`akka-testkit`,
where ``AkkaSpec`` is a convenient mixture of
``TestKit with WordSpec with MustMatchers``
The test is easier by using the utilities described in :ref:`akka-testkit`.
.. includecode:: code/docs/actor/FaultHandlingDocSpec.scala
:include: testkit