From df2ec0ca9b8b6a6bd53c40e0be122f44fda40865 Mon Sep 17 00:00:00 2001 From: Andrzej Cichocki Date: Tue, 5 Sep 2017 17:17:33 +0100 Subject: [PATCH] Suppress output of jarsigner and friends. (#1426) --- .../net/corda/core/internal/AbstractAttachmentTest.kt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/core/src/test/kotlin/net/corda/core/internal/AbstractAttachmentTest.kt b/core/src/test/kotlin/net/corda/core/internal/AbstractAttachmentTest.kt index 338cbfdb19..3c3f224091 100644 --- a/core/src/test/kotlin/net/corda/core/internal/AbstractAttachmentTest.kt +++ b/core/src/test/kotlin/net/corda/core/internal/AbstractAttachmentTest.kt @@ -15,8 +15,15 @@ class AbstractAttachmentTest { companion object { private val dir = Files.createTempDirectory(AbstractAttachmentTest::class.simpleName) private val bin = Paths.get(System.getProperty("java.home")).let { if (it.endsWith("jre")) it.parent else it } / "bin" + private val shredder = (dir / "_shredder").toFile() // No need to delete after each test. fun execute(vararg command: String) { - assertEquals(0, ProcessBuilder().inheritIO().directory(dir.toFile()).command((bin / command[0]).toString(), *command.sliceArray(1 until command.size)).start().waitFor()) + assertEquals(0, ProcessBuilder() + .inheritIO() + .redirectOutput(shredder) + .directory(dir.toFile()) + .command((bin / command[0]).toString(), *command.sliceArray(1 until command.size)) + .start() + .waitFor()) } @BeforeClass @@ -45,7 +52,7 @@ class AbstractAttachmentTest { dir.toFile().listFiles().forEach { if (!it.name.startsWith("_")) it.deleteRecursively() } - assertEquals(4, dir.toFile().listFiles().size) + assertEquals(5, dir.toFile().listFiles().size) } @Test