You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by GitBox <gi...@apache.org> on 2022/06/03 14:14:08 UTC
[GitHub] [httpcomponents-core] lacinoire opened a new pull request, #349: (test) Add test for BasicFuture.failed and ComplexFuture.failed
lacinoire opened a new pull request, #349:
URL: https://github.com/apache/httpcomponents-core/pull/349
Hey 😊
I want to contribute the following test:
Test that `future.failed(new java.lang.Exception())` is false when `failed` is called with the parameter `exception = new java.lang.Exception()`.
This tests the methods [`BasicFuture.failed`](https://github.com/apache/httpcomponents-core/blob/ece5876b65fad1a5ea0bf7985abc1b9aba1e08ac/httpcore5/src/main/java/org/apache/hc/core5/concurrent/BasicFuture.java#L128) and [`ComplexFuture.failed`](https://github.com/apache/httpcomponents-core/blob/ece5876b65fad1a5ea0bf7985abc1b9aba1e08ac/httpcore5/src/main/java/org/apache/hc/core5/concurrent/ComplexFuture.java#L78).
This test is based on the test [`testCancelled`](https://github.com/apache/httpcomponents-core/blob/ece5876b65fad1a5ea0bf7985abc1b9aba1e08ac/httpcore5/src/test/java/org/apache/hc/core5/concurrent/TestComplexFuture.java#L40).
Curious to hear what you think!
(I wrote this test as part of a research study at TU Delft. [Find out more](https://github.com/lacinoire/lacinoire/blob/main/README.md))
--
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: dev-unsubscribe@hc.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org
[GitHub] [httpcomponents-core] carterkozak commented on a diff in pull request #349: (test) Add test for BasicFuture.failed and ComplexFuture.failed
Posted by GitBox <gi...@apache.org>.
carterkozak commented on code in PR #349:
URL: https://github.com/apache/httpcomponents-core/pull/349#discussion_r889000388
##########
httpcore5/src/test/java/org/apache/hc/core5/concurrent/TestComplexFuture.java:
##########
@@ -96,4 +96,11 @@ public void completed(final Object result) {
assertThat(dependency2.isCancelled(), CoreMatchers.is(true));
}
+ @Test
+ public void testFailedAndFailed() {
+ final ComplexFuture<Object> future = new ComplexFuture<>(null);
+ future.cancel();
Review Comment:
Perhaps worth asserting that `cancel()` returns true?
--
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: dev-unsubscribe@hc.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org
[GitHub] [httpcomponents-core] lacinoire commented on pull request #349: (test) Add test for BasicFuture.failed and ComplexFuture.failed
Posted by GitBox <gi...@apache.org>.
lacinoire commented on PR #349:
URL: https://github.com/apache/httpcomponents-core/pull/349#issuecomment-1149645827
Thank you for looking over it 🙂
I incorporated both suggestions
--
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: dev-unsubscribe@hc.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org
[GitHub] [httpcomponents-core] carterkozak commented on a diff in pull request #349: (test) Add test for BasicFuture.failed and ComplexFuture.failed
Posted by GitBox <gi...@apache.org>.
carterkozak commented on code in PR #349:
URL: https://github.com/apache/httpcomponents-core/pull/349#discussion_r889001054
##########
httpcore5/src/test/java/org/apache/hc/core5/concurrent/TestComplexFuture.java:
##########
@@ -96,4 +96,11 @@ public void completed(final Object result) {
assertThat(dependency2.isCancelled(), CoreMatchers.is(true));
}
+ @Test
+ public void testFailedAndFailed() {
Review Comment:
No strong preference, but we might prefer naming this more specifically `testCanceledAndFailed`
--
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: dev-unsubscribe@hc.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org
[GitHub] [httpcomponents-core] ok2c merged pull request #349: (test) Add test for BasicFuture.failed and ComplexFuture.failed
Posted by GitBox <gi...@apache.org>.
ok2c merged PR #349:
URL: https://github.com/apache/httpcomponents-core/pull/349
--
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: dev-unsubscribe@hc.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org