You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@pekko.apache.org by "naosense (via GitHub)" <gi...@apache.org> on 2024/01/26 09:09:49 UTC
[PR] Add missing java api for StreamTestKit [incubator-pekko]
naosense opened a new pull request, #1049:
URL: https://github.com/apache/incubator-pekko/pull/1049
To resolve #970
--
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] Add missing java api for StreamTestKit [incubator-pekko]
Posted by "naosense (via GitHub)" <gi...@apache.org>.
naosense commented on PR #1049:
URL: https://github.com/apache/incubator-pekko/pull/1049#issuecomment-1913868358
> If you not sure how to write the test cases, I can do a following pr for your pr with tests.
yes please, master pin @He-Pin
--
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] Add missing java api for StreamTestKit [incubator-pekko]
Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin commented on PR #1049:
URL: https://github.com/apache/incubator-pekko/pull/1049#issuecomment-1981459653
> @naosense @kerr any interest in finishing this? - we might still fit this into 1.1.0-M1 if it can be finished soon
I think I can took this on weekend.
--
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] Add missing java api for StreamTestKit [incubator-pekko]
Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin commented on code in PR #1049:
URL: https://github.com/apache/incubator-pekko/pull/1049#discussion_r1467431643
##########
stream-testkit/src/main/scala/org/apache/pekko/stream/testkit/StreamTestKit.scala:
##########
@@ -818,11 +886,35 @@ object TestSubscriber {
*/
def within[T](min: FiniteDuration, max: FiniteDuration)(f: => T): T = probe.within(min, max)(f)
+ /**
+ * Execute code block while bounding its execution time between `min` and
+ * `max`. `within` blocks may be nested. All methods in this trait which
+ * take maximum wait times are available in a version which implicitly uses
+ * the remaining time governed by the innermost enclosing `within` block.
+ *
+ * Note that the timeout is scaled using Duration.dilated, which uses the
+ * configuration entry "pekko.test.timefactor", while the min Duration is not.
+ *
+ * {{{
+ * val ret = within(50 millis) {
+ * test ! "ping"
+ * expectMsgClass(classOf[String])
+ * }
+ * }}}
+ */
+ def within[T](min: java.time.Duration, max: java.time.Duration)(f: => T): T =
Review Comment:
`(f: => T)` should be `f( function.Creator<T> )` or `function.Function[Unit, T]`
--
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] Add missing java api for StreamTestKit [incubator-pekko]
Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin commented on code in PR #1049:
URL: https://github.com/apache/incubator-pekko/pull/1049#discussion_r1467431643
##########
stream-testkit/src/main/scala/org/apache/pekko/stream/testkit/StreamTestKit.scala:
##########
@@ -818,11 +886,35 @@ object TestSubscriber {
*/
def within[T](min: FiniteDuration, max: FiniteDuration)(f: => T): T = probe.within(min, max)(f)
+ /**
+ * Execute code block while bounding its execution time between `min` and
+ * `max`. `within` blocks may be nested. All methods in this trait which
+ * take maximum wait times are available in a version which implicitly uses
+ * the remaining time governed by the innermost enclosing `within` block.
+ *
+ * Note that the timeout is scaled using Duration.dilated, which uses the
+ * configuration entry "pekko.test.timefactor", while the min Duration is not.
+ *
+ * {{{
+ * val ret = within(50 millis) {
+ * test ! "ping"
+ * expectMsgClass(classOf[String])
+ * }
+ * }}}
+ */
+ def within[T](min: java.time.Duration, max: java.time.Duration)(f: => T): T =
Review Comment:
`(f: => T)` should be `f( function.Function<T>)`
--
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] Add missing java api for StreamTestKit [incubator-pekko]
Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin commented on code in PR #1049:
URL: https://github.com/apache/incubator-pekko/pull/1049#discussion_r1467431643
##########
stream-testkit/src/main/scala/org/apache/pekko/stream/testkit/StreamTestKit.scala:
##########
@@ -818,11 +886,35 @@ object TestSubscriber {
*/
def within[T](min: FiniteDuration, max: FiniteDuration)(f: => T): T = probe.within(min, max)(f)
+ /**
+ * Execute code block while bounding its execution time between `min` and
+ * `max`. `within` blocks may be nested. All methods in this trait which
+ * take maximum wait times are available in a version which implicitly uses
+ * the remaining time governed by the innermost enclosing `within` block.
+ *
+ * Note that the timeout is scaled using Duration.dilated, which uses the
+ * configuration entry "pekko.test.timefactor", while the min Duration is not.
+ *
+ * {{{
+ * val ret = within(50 millis) {
+ * test ! "ping"
+ * expectMsgClass(classOf[String])
+ * }
+ * }}}
+ */
+ def within[T](min: java.time.Duration, max: java.time.Duration)(f: => T): T =
Review Comment:
`(f: => T)` should be `f( function.Creator<T> )`
--
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] Add missing java api for StreamTestKit [incubator-pekko]
Posted by "naosense (via GitHub)" <gi...@apache.org>.
naosense commented on PR #1049:
URL: https://github.com/apache/incubator-pekko/pull/1049#issuecomment-1911917406
> 3. If you can write some spec to tests this api, then what would be nice too.
@He-Pin there is no java testcase?
<img width="348" alt="image" src="https://github.com/apache/incubator-pekko/assets/2225426/eb724570-525b-4730-b2d6-60c7826b2535">
--
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] Add missing java api for StreamTestKit [incubator-pekko]
Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on PR #1049:
URL: https://github.com/apache/incubator-pekko/pull/1049#issuecomment-1981446734
@naosense @kerr any interest in finishing this? - we might still fit this into 1.1.0-M1 if it can be finished soon
--
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] Add missing java api for StreamTestKit [incubator-pekko]
Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin commented on PR #1049:
URL: https://github.com/apache/incubator-pekko/pull/1049#issuecomment-1987189093
Will continue at : https://github.com/apache/incubator-pekko/pull/1186
--
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] Add missing java api for StreamTestKit [incubator-pekko]
Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin closed pull request #1049: Add missing java api for StreamTestKit
URL: https://github.com/apache/incubator-pekko/pull/1049
--
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] Add missing java api for StreamTestKit [incubator-pekko]
Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin commented on PR #1049:
URL: https://github.com/apache/incubator-pekko/pull/1049#issuecomment-1911773075
Thanks: here is some of my feedback:
1. no curried method in Java dsl
2. use the functions in `japi.function.Function` instead.
3. If you can write some spec to tests this api, then what would be nice too.
--
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] Add missing java api for StreamTestKit [incubator-pekko]
Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin commented on PR #1049:
URL: https://github.com/apache/incubator-pekko/pull/1049#issuecomment-1912213224
> > 3. If you can write some spec to tests this api, then what would be nice too.
>
> @He-Pin there is no java testcase?
> <img width="348" alt="image" src="https://github.com/apache/incubator-pekko/assets/2225426/eb724570-525b-4730-b2d6-60c7826b2535">
>
If you not sure how to write the test cases, I can do a following pr for your pr with tests.
--
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] Add missing java api for StreamTestKit [incubator-pekko]
Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin commented on code in PR #1049:
URL: https://github.com/apache/incubator-pekko/pull/1049#discussion_r1467434267
##########
stream-testkit/src/main/scala/org/apache/pekko/stream/testkit/StreamTestKit.scala:
##########
@@ -818,11 +886,35 @@ object TestSubscriber {
*/
def within[T](min: FiniteDuration, max: FiniteDuration)(f: => T): T = probe.within(min, max)(f)
+ /**
+ * Execute code block while bounding its execution time between `min` and
+ * `max`. `within` blocks may be nested. All methods in this trait which
+ * take maximum wait times are available in a version which implicitly uses
+ * the remaining time governed by the innermost enclosing `within` block.
+ *
+ * Note that the timeout is scaled using Duration.dilated, which uses the
+ * configuration entry "pekko.test.timefactor", while the min Duration is not.
+ *
+ * {{{
+ * val ret = within(50 millis) {
+ * test ! "ping"
+ * expectMsgClass(classOf[String])
+ * }
+ * }}}
+ */
+ def within[T](min: java.time.Duration, max: java.time.Duration)(f: => T): T =
+ probe.within(min.asScala, max.asScala)(f)
+
/**
* Same as calling `within(0 seconds, max)(f)`.
*/
def within[T](max: FiniteDuration)(f: => T): T = probe.within(max)(f)
+ /**
+ * Same as calling `within(0 seconds, max)(f)`.
+ */
+ def within[T](max: java.time.Duration)(f: => T): T = probe.within(max.asScala)(f)
Review Comment:
f => T should be `function.Function[Unit, T]`
--
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] Add missing java api for StreamTestKit [incubator-pekko]
Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin commented on code in PR #1049:
URL: https://github.com/apache/incubator-pekko/pull/1049#discussion_r1467430680
##########
stream-testkit/src/main/scala/org/apache/pekko/stream/testkit/StreamTestKit.scala:
##########
@@ -818,11 +886,35 @@ object TestSubscriber {
*/
def within[T](min: FiniteDuration, max: FiniteDuration)(f: => T): T = probe.within(min, max)(f)
+ /**
+ * Execute code block while bounding its execution time between `min` and
+ * `max`. `within` blocks may be nested. All methods in this trait which
+ * take maximum wait times are available in a version which implicitly uses
+ * the remaining time governed by the innermost enclosing `within` block.
+ *
+ * Note that the timeout is scaled using Duration.dilated, which uses the
+ * configuration entry "pekko.test.timefactor", while the min Duration is not.
+ *
+ * {{{
+ * val ret = within(50 millis) {
Review Comment:
delete or rewrite this code as java:)
--
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