Include imports in the GraphStage logging snippets (#23378)
This commit is contained in:
parent
d083fcffd8
commit
aec87a94c4
2 changed files with 10 additions and 3 deletions
|
|
@ -9,7 +9,13 @@ import akka.stream.Attributes;
|
||||||
import akka.stream.Materializer;
|
import akka.stream.Materializer;
|
||||||
import akka.stream.Outlet;
|
import akka.stream.Outlet;
|
||||||
import akka.stream.SourceShape;
|
import akka.stream.SourceShape;
|
||||||
import akka.stream.stage.*;
|
//#stage-with-logging
|
||||||
|
import akka.stream.stage.AbstractOutHandler;
|
||||||
|
import akka.stream.stage.GraphStage;
|
||||||
|
import akka.stream.stage.GraphStageLogic;
|
||||||
|
import akka.stream.stage.GraphStageLogicWithLogging;
|
||||||
|
|
||||||
|
//#stage-with-logging
|
||||||
import jdocs.AbstractJavaTest;
|
import jdocs.AbstractJavaTest;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
|
|
@ -21,7 +27,7 @@ public class GraphStageLoggingDocTest extends AbstractJavaTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void compileOnlyTestClass() throws Exception { }
|
public void compileOnlyTestClass() throws Exception { }
|
||||||
|
|
||||||
//#stage-with-logging
|
//#stage-with-logging
|
||||||
public class RandomLettersSource extends GraphStage<SourceShape<String>> {
|
public class RandomLettersSource extends GraphStage<SourceShape<String>> {
|
||||||
public final Outlet<String> out = Outlet.create("RandomLettersSource.in");
|
public final Outlet<String> out = Outlet.create("RandomLettersSource.in");
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ import java.util.concurrent.ThreadLocalRandom
|
||||||
|
|
||||||
import akka.stream._
|
import akka.stream._
|
||||||
import akka.stream.scaladsl._
|
import akka.stream.scaladsl._
|
||||||
import akka.stream.stage.{ GraphStage, GraphStageLogic, OutHandler, StageLogging }
|
|
||||||
import akka.testkit.{ AkkaSpec, EventFilter }
|
import akka.testkit.{ AkkaSpec, EventFilter }
|
||||||
|
|
||||||
class GraphStageLoggingDocSpec extends AkkaSpec("akka.loglevel = DEBUG") {
|
class GraphStageLoggingDocSpec extends AkkaSpec("akka.loglevel = DEBUG") {
|
||||||
|
|
@ -16,6 +15,8 @@ class GraphStageLoggingDocSpec extends AkkaSpec("akka.loglevel = DEBUG") {
|
||||||
implicit val ec = system.dispatcher
|
implicit val ec = system.dispatcher
|
||||||
|
|
||||||
//#stage-with-logging
|
//#stage-with-logging
|
||||||
|
import akka.stream.stage.{ GraphStage, GraphStageLogic, OutHandler, StageLogging }
|
||||||
|
|
||||||
final class RandomLettersSource extends GraphStage[SourceShape[String]] {
|
final class RandomLettersSource extends GraphStage[SourceShape[String]] {
|
||||||
val out = Outlet[String]("RandomLettersSource.out")
|
val out = Outlet[String]("RandomLettersSource.out")
|
||||||
override val shape: SourceShape[String] = SourceShape(out)
|
override val shape: SourceShape[String] = SourceShape(out)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue