mirror of
https://github.com/corda/corda.git
synced 2025-06-18 07:08:15 +00:00
Refactor :client module into :client:javafx and :client:mock (#388)
* CORDA-304: Refactor :client modules into :client:javafx and :client:mock. * CORDA-304: Add :client:mock to Dokka tasks, and remove unused integrationTest task. * CORDA-304: Migrate DriverBasedTest from node into test-utils. * CORDA-304: Rename .fx. package to .jfx. to prevent confusion with "exchange rate". * CORDA-304: Rename module to ':client:jfx'.
This commit is contained in:
@ -13,12 +13,12 @@ import net.corda.core.node.NodeInfo
|
||||
import net.corda.core.serialization.OpaqueBytes
|
||||
import net.corda.flows.CashIssueFlow
|
||||
import net.corda.flows.CashPaymentFlow
|
||||
import net.corda.node.driver.DriverBasedTest
|
||||
import net.corda.node.driver.NodeHandle
|
||||
import net.corda.node.driver.driver
|
||||
import net.corda.node.services.transactions.RaftValidatingNotaryService
|
||||
import net.corda.testing.expect
|
||||
import net.corda.testing.expectEvents
|
||||
import net.corda.testing.node.DriverBasedTest
|
||||
import net.corda.testing.replicate
|
||||
import org.junit.Test
|
||||
import rx.Observable
|
||||
|
@ -1,39 +0,0 @@
|
||||
package net.corda.node.driver
|
||||
|
||||
import org.junit.After
|
||||
import org.junit.Before
|
||||
import java.util.concurrent.CountDownLatch
|
||||
import kotlin.concurrent.thread
|
||||
|
||||
abstract class DriverBasedTest {
|
||||
private val stopDriver = CountDownLatch(1)
|
||||
private var driverThread: Thread? = null
|
||||
private lateinit var driverStarted: CountDownLatch
|
||||
|
||||
protected sealed class RunTestToken {
|
||||
internal object Token : RunTestToken()
|
||||
}
|
||||
|
||||
protected abstract fun setup(): RunTestToken
|
||||
|
||||
protected fun DriverDSLExposedInterface.runTest(): RunTestToken {
|
||||
driverStarted.countDown()
|
||||
stopDriver.await()
|
||||
return RunTestToken.Token
|
||||
}
|
||||
|
||||
@Before
|
||||
fun start() {
|
||||
driverStarted = CountDownLatch(1)
|
||||
driverThread = thread {
|
||||
setup()
|
||||
}
|
||||
driverStarted.await()
|
||||
}
|
||||
|
||||
@After
|
||||
fun stop() {
|
||||
stopDriver.countDown()
|
||||
driverThread?.join()
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user