mirror of
https://github.com/corda/corda.git
synced 2025-05-02 08:43:15 +00:00
Tests now fail if spawned processes take too long to finish.
This commit is contained in:
parent
9a2a7165a5
commit
ad45b5deaf
1
.idea/modules.xml
generated
1
.idea/modules.xml
generated
@ -22,6 +22,7 @@
|
|||||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/node/node_test.iml" filepath="$PROJECT_DIR$/.idea/modules/node/node_test.iml" group="node" />
|
<module fileurl="file://$PROJECT_DIR$/.idea/modules/node/node_test.iml" filepath="$PROJECT_DIR$/.idea/modules/node/node_test.iml" group="node" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/r3prototyping.iml" filepath="$PROJECT_DIR$/.idea/modules/r3prototyping.iml" />
|
<module fileurl="file://$PROJECT_DIR$/.idea/modules/r3prototyping.iml" filepath="$PROJECT_DIR$/.idea/modules/r3prototyping.iml" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/r3prototyping_integrationTest.iml" filepath="$PROJECT_DIR$/.idea/modules/r3prototyping_integrationTest.iml" group="r3prototyping" />
|
<module fileurl="file://$PROJECT_DIR$/.idea/modules/r3prototyping_integrationTest.iml" filepath="$PROJECT_DIR$/.idea/modules/r3prototyping_integrationTest.iml" group="r3prototyping" />
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/.idea/modules/r3prototyping_integrationTest.iml" filepath="$PROJECT_DIR$/.idea/modules/r3prototyping_integrationTest.iml" group="r3prototyping" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/r3prototyping_main.iml" filepath="$PROJECT_DIR$/.idea/modules/r3prototyping_main.iml" group="r3prototyping" />
|
<module fileurl="file://$PROJECT_DIR$/.idea/modules/r3prototyping_main.iml" filepath="$PROJECT_DIR$/.idea/modules/r3prototyping_main.iml" group="r3prototyping" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/r3prototyping_test.iml" filepath="$PROJECT_DIR$/.idea/modules/r3prototyping_test.iml" group="r3prototyping" />
|
<module fileurl="file://$PROJECT_DIR$/.idea/modules/r3prototyping_test.iml" filepath="$PROJECT_DIR$/.idea/modules/r3prototyping_test.iml" group="r3prototyping" />
|
||||||
</modules>
|
</modules>
|
||||||
|
@ -6,6 +6,7 @@ import kotlin.test.assertEquals
|
|||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import java.nio.file.Path
|
import java.nio.file.Path
|
||||||
import java.nio.file.Paths
|
import java.nio.file.Paths
|
||||||
|
import java.util.concurrent.TimeUnit
|
||||||
|
|
||||||
class IRSDemoTest {
|
class IRSDemoTest {
|
||||||
@Test fun `runs IRS demo`() {
|
@Test fun `runs IRS demo`() {
|
||||||
@ -31,7 +32,7 @@ class IRSDemoTest {
|
|||||||
private fun setupNode(dir: Path, nodeType: String) {
|
private fun setupNode(dir: Path, nodeType: String) {
|
||||||
val args = listOf("--role", "Setup" + nodeType, "--dir", dir.toString())
|
val args = listOf("--role", "Setup" + nodeType, "--dir", dir.toString())
|
||||||
val proc = spawn("com.r3corda.demos.IRSDemoKt", args)
|
val proc = spawn("com.r3corda.demos.IRSDemoKt", args)
|
||||||
proc.waitFor();
|
assertEquals(proc.waitFor(30, TimeUnit.SECONDS), true);
|
||||||
assertEquals(proc.exitValue(), 0)
|
assertEquals(proc.exitValue(), 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -45,14 +46,14 @@ private fun startNode(dir: Path, nodeType: String, nodeAddr: String): Process {
|
|||||||
private fun runTrade() {
|
private fun runTrade() {
|
||||||
val args = listOf("--role", "Trade", "trade1")
|
val args = listOf("--role", "Trade", "trade1")
|
||||||
val proc = spawn("com.r3corda.demos.IRSDemoKt", args)
|
val proc = spawn("com.r3corda.demos.IRSDemoKt", args)
|
||||||
proc.waitFor();
|
assertEquals(proc.waitFor(30, TimeUnit.SECONDS), true);
|
||||||
assertEquals(proc.exitValue(), 0)
|
assertEquals(proc.exitValue(), 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun runDateChange() {
|
private fun runDateChange() {
|
||||||
val args = listOf("--role", "Date", "2017-01-02")
|
val args = listOf("--role", "Date", "2017-01-02")
|
||||||
val proc = spawn("com.r3corda.demos.IRSDemoKt", args)
|
val proc = spawn("com.r3corda.demos.IRSDemoKt", args)
|
||||||
proc.waitFor();
|
assertEquals(proc.waitFor(30, TimeUnit.SECONDS), true);
|
||||||
assertEquals(proc.exitValue(), 0)
|
assertEquals(proc.exitValue(), 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ import com.r3corda.core.testing.utilities.spawn
|
|||||||
import com.r3corda.core.testing.utilities.waitForNodeStartup
|
import com.r3corda.core.testing.utilities.waitForNodeStartup
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import java.nio.file.Paths
|
import java.nio.file.Paths
|
||||||
|
import java.util.concurrent.TimeUnit
|
||||||
import kotlin.test.assertEquals
|
import kotlin.test.assertEquals
|
||||||
|
|
||||||
class TraderDemoTest {
|
class TraderDemoTest {
|
||||||
@ -29,7 +30,7 @@ private fun runBuyer(): Process {
|
|||||||
private fun runSeller() {
|
private fun runSeller() {
|
||||||
val args = listOf("--role", "SELLER")
|
val args = listOf("--role", "SELLER")
|
||||||
val proc = spawn("com.r3corda.demos.TraderDemoKt", args)
|
val proc = spawn("com.r3corda.demos.TraderDemoKt", args)
|
||||||
proc.waitFor();
|
assertEquals(proc.waitFor(30, TimeUnit.SECONDS), true);
|
||||||
assertEquals(proc.exitValue(), 0)
|
assertEquals(proc.exitValue(), 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user