Merge pull request #1928 from corda/kat/amqp/amqpTestFix3

CORDA-435 - AMQP enablement fixes
This commit is contained in:
Katelyn Baker 2017-10-23 17:37:38 +01:00 committed by GitHub
commit 70a7eb8bae

View File

@ -39,7 +39,7 @@ import java.util.concurrent.atomic.AtomicBoolean
import kotlin.reflect.jvm.jvmName import kotlin.reflect.jvm.jvmName
import kotlin.test.assertEquals import kotlin.test.assertEquals
private class NodePair(private val mockNet: MockNetwork) { class NodePair(private val mockNet: MockNetwork) {
private class ServerLogic(private val session: FlowSession, private val running: AtomicBoolean) : FlowLogic<Unit>() { private class ServerLogic(private val session: FlowSession, private val running: AtomicBoolean) : FlowLogic<Unit>() {
@Suspendable @Suspendable
override fun call() { override fun call() {
@ -102,8 +102,8 @@ class VaultSoftLockManagerTest {
mockNet.stopNodes() mockNet.stopNodes()
} }
private object CommandDataImpl : CommandData object CommandDataImpl : CommandData
private class ClientLogic(nodePair: NodePair, private val state: ContractState) : NodePair.AbstractClientLogic<List<ContractState>>(nodePair) { class ClientLogic(nodePair: NodePair, val state: ContractState) : NodePair.AbstractClientLogic<List<ContractState>>(nodePair) {
override fun callImpl() = run { override fun callImpl() = run {
subFlow(FinalityFlow(serviceHub.signInitialTransaction(TransactionBuilder(notary = ourIdentity).apply { subFlow(FinalityFlow(serviceHub.signInitialTransaction(TransactionBuilder(notary = ourIdentity).apply {
addOutputState(state, ContractImpl::class.jvmName) addOutputState(state, ContractImpl::class.jvmName)
@ -115,12 +115,15 @@ class VaultSoftLockManagerTest {
} }
} }
private abstract class SingleParticipantState(nodePair: NodePair) : ContractState { private abstract class ParticipantState(override val participants: List<AbstractParty>) : ContractState
override val participants = listOf(nodePair.client.info.chooseIdentity())
private class PlainOldState(participants: List<AbstractParty>) : ParticipantState(participants) {
constructor(nodePair: NodePair) : this(listOf(nodePair.client.info.chooseIdentity()))
} }
private class PlainOldState(nodePair: NodePair) : SingleParticipantState(nodePair) private class FungibleAssetImpl(participants: List<AbstractParty>) : ParticipantState(participants), FungibleAsset<Unit> {
private class FungibleAssetImpl(nodePair: NodePair) : SingleParticipantState(nodePair), FungibleAsset<Unit> { constructor(nodePair: NodePair) : this(listOf(nodePair.client.info.chooseIdentity()))
override val owner get() = participants[0] override val owner get() = participants[0]
override fun withNewOwner(newOwner: AbstractParty) = throw UnsupportedOperationException() override fun withNewOwner(newOwner: AbstractParty) = throw UnsupportedOperationException()
override val amount get() = Amount(1, Issued(PartyAndReference(owner, OpaqueBytes.of(1)), Unit)) override val amount get() = Amount(1, Issued(PartyAndReference(owner, OpaqueBytes.of(1)), Unit))