Differences

This shows you the differences between two versions of the page.

Link to this comparison view

irc:1484262000 [2017/05/27 13:44]
irc:1484262000 [2017/05/27 13:44] (current)
Line 1: Line 1:
 +[16:40:34] <​pikajude>​ will vertx support junit 5 soon?
 +
 +[16:53:48] <​tsegismont>​ pikajude, have you tried? does it fail? how?
 +
 +[16:54:06] <​pikajude>​ junit 5 doesn'​t use a test runner class in the same way junit 4 does afaict
 +
 +[16:54:16] <​pikajude>​ so yeah, it fails with a runtime error saying there'​s no ParameterResolver for TestContext
 +
 +[19:01:53] <​temporalfox>​ pikajude I believe that it could be contributed in a vertx-junit specific project
 +
 +[19:02:03] <​pikajude>​ okay
 +
 +[19:37:04] <​pikajude>​ is it possible to block the current thread until a Future completes, then get the result of the future?
 +
 +[19:37:12] <​pikajude>​ this is in tests, where I don't need or want everything to be async
 +
 +[19:46:39] <​pikajude>​ awaitResult no good, apparently tests have to be run within a fiber
 +
 +[19:46:46] <​pikajude>​ and the documentation only provides a way to do that for verticles
 +
 +[23:05:59] <​AlexLehm>​ pikajude: you cannot use a blocking wait in a vertx-unit test, but you can use Async objects to synchronize the execution in a way
 +
 +[23:06:10] <​pikajude>​ i found CompletableFuture to be useful
 +
 +[23:06:14] <​pikajude>​ which is what Async uses apparently
 +
 +[23:07:10] <​AlexLehm>​ not sure how Async is implemented,​ but it takes care not to finished the test until all are completed
 +
 +[23:07:53] <​AlexLehm>​ if you are in a normal unit test without vertx-unit, you can use CountDownLatch and await
 +
 +[23:22:48] <​AlexLehm>​ should take a look at CompletableFuture probably
 +
 +[23:26:47] <​pikajude>​ yeah, i used completable futures