Packages

package javadsl

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. javadsl
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. final case class AkkaStreamletTestKit extends BaseAkkaStreamletTestKit[AkkaStreamletTestKit] with Product with Serializable

    Java testkit for testing akka streamlets.

    Java testkit for testing akka streamlets.

    API:

    // instantiate the testkit
    AkkaStreamletTestKit testkit = AkkaStreamletTestKit.create(system);
    
    // 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.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".

  2. final case class ConfigParameterValueImpl extends ConfigParameterValue with Product with Serializable
  3. case class Failed(e: Throwable) extends Product with Serializable
  4. type InletTap[T] = testkit.InletTap[T]
  5. type OutletTap[T] = testkit.OutletTap[T]
  6. case class ProbeOutletTap[T](outlet: CodecOutlet[T])(implicit system: ActorSystem) extends OutletTap[T] with Product with Serializable
  7. case class QueueInletTap[T](inlet: CodecInlet[T])(implicit system: ActorSystem) extends InletTap[T] with Product with Serializable
  8. case class SinkOutletTap[T](outlet: CodecOutlet[T], snk: Sink[Pair[String, T], NotUsed]) extends OutletTap[T] with Product with Serializable
  9. case class SourceInletTap[T] extends InletTap[T] with Product with Serializable

Value Members

  1. object AkkaStreamletTestKit extends Serializable
  2. object Completed extends Completed with Product with Serializable
  3. object ConfigParameterValue

Inherited from AnyRef

Inherited from Any

Ungrouped