You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@pekko.apache.org by "He-Pin (via GitHub)" <gi...@apache.org> on 2024/01/15 16:48:43 UTC

[PR] feat: Add expectNextN to StreamTestKit. [incubator-pekko]

He-Pin opened a new pull request, #962:
URL: https://github.com/apache/incubator-pekko/pull/962

   Motivation:
   Add an expectN to StreamTestKit which support java List


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] feat: Add expectNextN to StreamTestKit for javadsl. [incubator-pekko]

Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin commented on code in PR #962:
URL: https://github.com/apache/incubator-pekko/pull/962#discussion_r1452650464


##########
stream-testkit/src/main/scala/org/apache/pekko/stream/testkit/StreamTestKit.scala:
##########
@@ -462,6 +463,16 @@ object TestSubscriber {
       self
     }
 
+    /**
+     * Fluent DSL
+     * Expect the given elements to be signalled in order.
+     * @since 1.1.0
+     */
+    def expectNextN(elems: java.util.List[I]): Self = {

Review Comment:
   I think the Iterable not mean sequence/keep the order?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] feat: Add expectNextN to StreamTestKit for javadsl. [incubator-pekko]

Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin merged PR #962:
URL: https://github.com/apache/incubator-pekko/pull/962


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] feat: Add expectNextN to StreamTestKit for javadsl. [incubator-pekko]

Posted by "nvollmar (via GitHub)" <gi...@apache.org>.
nvollmar commented on code in PR #962:
URL: https://github.com/apache/incubator-pekko/pull/962#discussion_r1452722417


##########
stream-testkit/src/main/scala/org/apache/pekko/stream/testkit/StreamTestKit.scala:
##########
@@ -462,6 +463,16 @@ object TestSubscriber {
       self
     }
 
+    /**
+     * Fluent DSL
+     * Expect the given elements to be signalled in order.
+     * @since 1.1.0
+     */
+    def expectNextN(elems: java.util.List[I]): Self = {

Review Comment:
   `java.util.Set` implements `Iterable` but would not keep the order. In this context a `List` would probably make most sense to guide the user.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] feat: Add expectNextN to StreamTestKit for javadsl. [incubator-pekko]

Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin commented on code in PR #962:
URL: https://github.com/apache/incubator-pekko/pull/962#discussion_r1452650464


##########
stream-testkit/src/main/scala/org/apache/pekko/stream/testkit/StreamTestKit.scala:
##########
@@ -462,6 +463,16 @@ object TestSubscriber {
       self
     }
 
+    /**
+     * Fluent DSL
+     * Expect the given elements to be signalled in order.
+     * @since 1.1.0
+     */
+    def expectNextN(elems: java.util.List[I]): Self = {

Review Comment:
   I think the Iterable does not mean sequence/keep the order?



##########
stream-testkit/src/main/scala/org/apache/pekko/stream/testkit/StreamTestKit.scala:
##########
@@ -462,6 +463,16 @@ object TestSubscriber {
       self
     }
 
+    /**
+     * Fluent DSL
+     * Expect the given elements to be signalled in order.
+     * @since 1.1.0
+     */
+    def expectNextN(elems: java.util.List[I]): Self = {

Review Comment:
   I think the Iterable does not mean sequenced/keep the order?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] feat: Add expectNextN to StreamTestKit for javadsl. [incubator-pekko]

Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin commented on code in PR #962:
URL: https://github.com/apache/incubator-pekko/pull/962#discussion_r1452607178


##########
stream-testkit/src/main/scala/org/apache/pekko/stream/testkit/StreamTestKit.scala:
##########
@@ -462,6 +463,15 @@ object TestSubscriber {
       self
     }
 
+    /**
+     * Fluent DSL
+     * Expect the given elements to be signalled in order.
+     */
+    def expectNextN(elems: java.util.List[I]): Self = {
+      elems.forEach(e => probe.expectMsg(OnNext(e)))
+      self

Review Comment:
   Again I will need a `@since 1.1.0`. this is for javadsl



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] feat: Add expectNextN to StreamTestKit for javadsl. [incubator-pekko]

Posted by "nvollmar (via GitHub)" <gi...@apache.org>.
nvollmar commented on code in PR #962:
URL: https://github.com/apache/incubator-pekko/pull/962#discussion_r1452722417


##########
stream-testkit/src/main/scala/org/apache/pekko/stream/testkit/StreamTestKit.scala:
##########
@@ -462,6 +463,16 @@ object TestSubscriber {
       self
     }
 
+    /**
+     * Fluent DSL
+     * Expect the given elements to be signalled in order.
+     * @since 1.1.0
+     */
+    def expectNextN(elems: java.util.List[I]): Self = {

Review Comment:
   `java.util.Set` implements `Iterable` but would not keep the order. In this context, since `SequencedCollection` is not available to us, a `List` would probably make most sense to guide the user.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] feat: Add expectNextN to StreamTestKit for javadsl. [incubator-pekko]

Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on PR #962:
URL: https://github.com/apache/incubator-pekko/pull/962#issuecomment-1892740472

   is there a test that could be added here or elsewhere in the repo that uses this method?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] feat: Add expectNextN to StreamTestKit for javadsl. [incubator-pekko]

Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on code in PR #962:
URL: https://github.com/apache/incubator-pekko/pull/962#discussion_r1452645519


##########
stream-testkit/src/main/scala/org/apache/pekko/stream/testkit/StreamTestKit.scala:
##########
@@ -462,6 +463,16 @@ object TestSubscriber {
       self
     }
 
+    /**
+     * Fluent DSL
+     * Expect the given elements to be signalled in order.
+     * @since 1.1.0
+     */
+    def expectNextN(elems: java.util.List[I]): Self = {

Review Comment:
   any chance this could be `java.util.Iterable`?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] feat: Add expectNextN to StreamTestKit for javadsl. [incubator-pekko]

Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin commented on code in PR #962:
URL: https://github.com/apache/incubator-pekko/pull/962#discussion_r1452651097


##########
stream-testkit/src/main/scala/org/apache/pekko/stream/testkit/StreamTestKit.scala:
##########
@@ -462,6 +463,16 @@ object TestSubscriber {
       self
     }
 
+    /**
+     * Fluent DSL
+     * Expect the given elements to be signalled in order.
+     * @since 1.1.0
+     */
+    def expectNextN(elems: java.util.List[I]): Self = {

Review Comment:
   https://openjdk.org/jeps/431 was only added in JDK21



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] feat: Add expectNextN to StreamTestKit for javadsl. [incubator-pekko]

Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on code in PR #962:
URL: https://github.com/apache/incubator-pekko/pull/962#discussion_r1452726703


##########
stream-testkit/src/main/scala/org/apache/pekko/stream/testkit/StreamTestKit.scala:
##########
@@ -462,6 +463,16 @@ object TestSubscriber {
       self
     }
 
+    /**
+     * Fluent DSL
+     * Expect the given elements to be signalled in order.
+     * @since 1.1.0
+     */
+    def expectNextN(elems: java.util.List[I]): Self = {

Review Comment:
   fair points - stick with List



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org