package javadsl
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- javadsl
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- All
Type Members
-
final
case class
AkkaStreamletTestKit extends BaseAkkaStreamletTestKit[AkkaStreamletTestKit] with Product with Serializable
Java testkit for testing akkastreams streamlets.
Java testkit for testing akkastreams streamlets.
API:
// instantiate the testkit AkkaStreamletTestKit testkit = AkkaStreamletTestKit.create(system, mat); // setup inlet and outlet SimpleFlowProcessor sfp = new SimpleFlowProcessor(); QueueInletTap<Data> in = testkit.makeInletAsTap(sfp.shape().inlet()); ProbeOutletTap<Data> out = testkit.makeOutletAsTap(sfp.shape().outlet()); // put data in.<Data>queue().offer(new Data(1, "a")); in.<Data>queue().offer(new Data(2, "b")); // run the testkit testkit.<Data, scala.Tuple2<String, Data>>run(sfp, in, out, () -> { return out.probe().expectMsg(new akka.japi.Pair<String, Data>("2", new Data(2, "b"))); });
The following point is from
akka.testkit.Testkitand 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
withinblocks); 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
- 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 mat: ActorMaterializer) extends InletTap[T] with Product with Serializable
- case class SinkOutletTap[T](outlet: CodecOutlet[T], snk: Sink[Pair[String, T], NotUsed]) extends OutletTap[T] with Product with Serializable
- case class SourceInletTap[T] extends InletTap[T] with Product with Serializable
Value Members
- object AkkaStreamletTestKit extends Serializable
- object Completed extends Completed with Product with Serializable
- object ConfigParameterValue