package scaladsl
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- scaladsl
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- All
Type Members
-
final
case class
AkkaStreamletTestKit extends BaseAkkaStreamletTestKit[AkkaStreamletTestKit] with Product with Serializable
Testkit for testing akka streamlets.
Testkit for testing akka streamlets.
API:
// instantiate the testkit val testkit = AkkaStreamletTestKit(system) // setup inlet and outlet val in = testkit.inletAsQueue(SimpleFlowProcessor.shape.inlet) val out = testkit.outletAsProbe(SimpleFlowProcessor.shape.outlet) // put data in.queue.offer(Data(1, "a")) in.queue.offer(Data(2, "b")) // run the testkit testkit.run(SimpleFlowProcessor, in, out, () => { out.probe.expectMsg(("2", Data(2, "b"))) })
The following point is from
akka.testkit.Testkit
and is valid mostly for this testkit as well:Beware of two points:
- the ActorSystem passed into the constructor needs to be shutdown, otherwise thread pools and memory will be leaked
- this class is not thread-safe (only one actor with one queue, one stack
of
within
blocks); it is expected that the code is executed from a constructor as shown above, which makes this a non-issue, otherwise take care not to run tests within a single test class instance in parallel.
It should be noted that for CI servers and the like all maximum Durations are scaled using their Duration.dilated method, which uses the TestKitExtension.Settings.TestTimeFactor settable via akka.conf entry "akka.test.timefactor".
- final case class ConfigParameterValueImpl extends ConfigParameterValue with Product with Serializable
- case class Failed(e: Throwable) extends Product with Serializable
- type InletTap[T] = testkit.InletTap[T]
- type OutletTap[T] = testkit.OutletTap[T]
- case class ProbeOutletTap[T](outlet: CodecOutlet[T])(implicit system: ActorSystem) extends OutletTap[T] with Product with Serializable
- case class QueueInletTap[T](inlet: CodecInlet[T])(implicit system: ActorSystem) extends InletTap[T] with Product with Serializable
- case class SinkOutletTap[T](outlet: CodecOutlet[T], snk: Sink[(String, T), NotUsed]) extends OutletTap[T] with Product with Serializable
- case class SourceInletTap[T](inlet: CodecInlet[T], source: Source[(T, Committable), NotUsed]) extends InletTap[T] with Product with Serializable
Value Members
- object AkkaStreamletTestKit extends Serializable
- object Completed extends Completed with Product with Serializable
- object ConfigParameterValue