This is an automated email from the ASF dual-hosted git repository.
hepin pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-pekko.git
The following commit(s) were added to refs/heads/main by this push:
new d829637ef2 chore: Fix RecipeAdhocSource test.
d829637ef2 is described below
commit d829637ef28c5adcc88e2e97d13c15a5b11162cf
Author: He-Pin <[email protected]>
AuthorDate: Thu Dec 28 17:07:27 2023 +0800
chore: Fix RecipeAdhocSource test.
---
.../stream/javadsl/cookbook/RecipeAdhocSourceTest.java | 3 ++-
.../test/scala/docs/stream/cookbook/RecipeAdhocSource.scala | 13 +++++++------
2 files changed, 9 insertions(+), 7 deletions(-)
diff --git
a/docs/src/test/java/jdocs/stream/javadsl/cookbook/RecipeAdhocSourceTest.java
b/docs/src/test/java/jdocs/stream/javadsl/cookbook/RecipeAdhocSourceTest.java
index ddf45401f9..da9e244c0e 100644
---
a/docs/src/test/java/jdocs/stream/javadsl/cookbook/RecipeAdhocSourceTest.java
+++
b/docs/src/test/java/jdocs/stream/javadsl/cookbook/RecipeAdhocSourceTest.java
@@ -18,6 +18,7 @@ import org.apache.pekko.NotUsed;
import org.apache.pekko.actor.ActorSystem;
import org.apache.pekko.dispatch.Futures;
import org.apache.pekko.japi.pf.PFBuilder;
+import org.apache.pekko.stream.BackpressureTimeoutException;
import org.apache.pekko.stream.javadsl.Keep;
import org.apache.pekko.stream.javadsl.Source;
import org.apache.pekko.stream.testkit.TestSubscriber;
@@ -232,7 +233,7 @@ public class RecipeAdhocSourceTest extends RecipeTest {
assertEquals(4, startedCount.get()); // startCount == 4, which means
"re"-tried 3 times
Thread.sleep(500);
- assertEquals(TimeoutException.class, probe.expectError().getClass());
+ assertEquals(BackpressureTimeoutException.class,
probe.expectError().getClass());
probe.request(1); // send demand
probe.expectNoMessage(FiniteDuration.create(200, "milliseconds")); //
but no more restart
}
diff --git a/docs/src/test/scala/docs/stream/cookbook/RecipeAdhocSource.scala
b/docs/src/test/scala/docs/stream/cookbook/RecipeAdhocSource.scala
index b6e1831828..6360e2f4fe 100644
--- a/docs/src/test/scala/docs/stream/cookbook/RecipeAdhocSource.scala
+++ b/docs/src/test/scala/docs/stream/cookbook/RecipeAdhocSource.scala
@@ -14,11 +14,12 @@
package docs.stream.cookbook
import java.util.concurrent.atomic.{ AtomicBoolean, AtomicInteger }
-
-import org.apache.pekko.stream.scaladsl.Source
-import org.apache.pekko.stream.testkit.scaladsl.TestSink
-import org.apache.pekko.testkit.TimingTest
-import org.apache.pekko.{ Done, NotUsed }
+import org.apache.pekko
+import pekko.stream.scaladsl.Source
+import pekko.stream.testkit.scaladsl.TestSink
+import pekko.stream.BackpressureTimeoutException
+import pekko.testkit.TimingTest
+import pekko.{ Done, NotUsed }
import scala.concurrent._
import scala.concurrent.duration._
@@ -127,7 +128,7 @@ class RecipeAdhocSource extends RecipeSpec {
startedCount.get() should be(4) // startCount == 4, which means
"re"-tried 3 times
Thread.sleep(500)
- sink.expectError().getClass should be(classOf[TimeoutException])
+ sink.expectError().getClass should
be(classOf[BackpressureTimeoutException])
sink.request(1) // send demand
sink.expectNoMessage(200.milliseconds) // but no more restart
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]