mirror of
https://github.com/corda/corda.git
synced 2024-12-28 00:38:55 +00:00
Suppress output of jarsigner and friends. (#1426)
This commit is contained in:
parent
349692f831
commit
df2ec0ca9b
@ -15,8 +15,15 @@ class AbstractAttachmentTest {
|
|||||||
companion object {
|
companion object {
|
||||||
private val dir = Files.createTempDirectory(AbstractAttachmentTest::class.simpleName)
|
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 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) {
|
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
|
@BeforeClass
|
||||||
@ -45,7 +52,7 @@ class AbstractAttachmentTest {
|
|||||||
dir.toFile().listFiles().forEach {
|
dir.toFile().listFiles().forEach {
|
||||||
if (!it.name.startsWith("_")) it.deleteRecursively()
|
if (!it.name.startsWith("_")) it.deleteRecursively()
|
||||||
}
|
}
|
||||||
assertEquals(4, dir.toFile().listFiles().size)
|
assertEquals(5, dir.toFile().listFiles().size)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
Loading…
Reference in New Issue
Block a user