From c1034f5214d2f0eccf9d79f7e2c865d923b4335c Mon Sep 17 00:00:00 2001 From: Mike Hearn Date: Fri, 3 Feb 2017 12:48:22 +0100 Subject: [PATCH] Print out exceptions in the attachment demo test. --- .../net/corda/attachmentdemo/AttachmentDemoTest.kt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/samples/attachment-demo/src/integration-test/kotlin/net/corda/attachmentdemo/AttachmentDemoTest.kt b/samples/attachment-demo/src/integration-test/kotlin/net/corda/attachmentdemo/AttachmentDemoTest.kt index 616fa3acd2..e1ddf1de70 100644 --- a/samples/attachment-demo/src/integration-test/kotlin/net/corda/attachmentdemo/AttachmentDemoTest.kt +++ b/samples/attachment-demo/src/integration-test/kotlin/net/corda/attachmentdemo/AttachmentDemoTest.kt @@ -19,20 +19,21 @@ class AttachmentDemoTest { startNode("Notary", setOf(ServiceInfo(SimpleNotaryService.Companion.type))) ).getOrThrow() - val senderThread = CompletableFuture.runAsync { + val senderThread = CompletableFuture.supplyAsync { nodeA.rpcClientToNode().use(demoUser[0].username, demoUser[0].password) { sender(this) } - } - val recipientThread = CompletableFuture.runAsync { + }.exceptionally { it.printStackTrace() } + + val recipientThread = CompletableFuture.supplyAsync{ nodeB.rpcClientToNode().use(demoUser[0].username, demoUser[0].password) { recipient(this) } - } + }.exceptionally { it.printStackTrace() } - // Just check they don't throw any exceptions.d - recipientThread.get() + // Just check they finish and don't throw any exceptions. senderThread.get() + recipientThread.get() }, isDebug = true) } }