You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pekko.apache.org by he...@apache.org on 2023/12/28 09:07:44 UTC
(incubator-pekko) 01/01: chore: Fix RecipeAdhocSource test.
This is an automated email from the ASF dual-hosted git repository.
hepin pushed a commit to branch fixRecipeAdhocSource
in repository https://gitbox.apache.org/repos/asf/incubator-pekko.git
commit ff09b28f72e8e5876360a88b3fbdd198ddcc6e88
Author: He-Pin <he...@gmail.com>
AuthorDate: Thu Dec 28 17:07:27 2023 +0800
chore: Fix RecipeAdhocSource test.
---
.../stream/javadsl/cookbook/RecipeAdhocSourceTest.java | 3 ++-
.../scala/docs/stream/cookbook/RecipeAdhocSource.scala | 14 ++++++++------
2 files changed, 10 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..ac047c06ee 100644
--- a/docs/src/test/scala/docs/stream/cookbook/RecipeAdhocSource.scala
+++ b/docs/src/test/scala/docs/stream/cookbook/RecipeAdhocSource.scala
@@ -13,12 +13,14 @@
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 java.util.concurrent.atomic.{AtomicBoolean, AtomicInteger}
+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 +129,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: commits-unsubscribe@pekko.apache.org
For additional commands, e-mail: commits-help@pekko.apache.org