mirror of
https://github.com/corda/corda.git
synced 2024-12-18 12:46:29 +00:00
add timeouts to all tests (#5875)
This commit is contained in:
parent
1d0918cdde
commit
b23af5f0d2
3
.ci/Dockerfile
Normal file
3
.ci/Dockerfile
Normal file
@ -0,0 +1,3 @@
|
||||
FROM amazoncorretto:8u242
|
||||
RUN yum install -y shadow-utils
|
||||
RUN useradd -m buildUser
|
@ -18,68 +18,68 @@ class AmountTest {
|
||||
private val yamlMapper: ObjectMapper = ObjectMapper(YAMLFactory()).registerModule(CordaModule())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Amount(Currency) JSON deserialization`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Amount(Currency) JSON deserialization`() {
|
||||
val str = """{ "quantity": 100, "token": "USD" }"""
|
||||
val amount = jsonMapper.readValue<Amount<Currency>>(str, object : TypeReference<Amount<Currency>>() {})
|
||||
assertThat(amount.quantity).isEqualTo(100)
|
||||
assertThat(amount.token).isEqualTo(Currency.getInstance("USD"))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Amount(Currency) YAML deserialization`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Amount(Currency) YAML deserialization`() {
|
||||
val str = """{ quantity: 100, token: USD }"""
|
||||
val amount = yamlMapper.readValue<Amount<Currency>>(str, object : TypeReference<Amount<Currency>>() {})
|
||||
assertThat(amount.quantity).isEqualTo(100)
|
||||
assertThat(amount.token).isEqualTo(Currency.getInstance("USD"))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Amount(CarbonCredit) JSON deserialization`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Amount(CarbonCredit) JSON deserialization`() {
|
||||
val str = """{ "quantity": 200, "token": { "type": "CO2" } }"""
|
||||
val amount = jsonMapper.readValue<Amount<CarbonCredit>>(str, object : TypeReference<Amount<CarbonCredit>>() {})
|
||||
assertThat(amount.quantity).isEqualTo(200)
|
||||
assertThat(amount.token).isEqualTo(CO2)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Amount(CarbonCredit) YAML deserialization`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Amount(CarbonCredit) YAML deserialization`() {
|
||||
val str = """{ quantity: 250, token: { type: CO2 } }"""
|
||||
val amount = yamlMapper.readValue<Amount<CarbonCredit>>(str, object : TypeReference<Amount<CarbonCredit>>() {})
|
||||
assertThat(amount.quantity).isEqualTo(250)
|
||||
assertThat(amount.token).isEqualTo(CO2)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Amount(Unknown) JSON deserialization`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Amount(Unknown) JSON deserialization`() {
|
||||
val str = """{ "quantity": 100, "token": "USD" }"""
|
||||
val amount = jsonMapper.readValue<Amount<*>>(str, object : TypeReference<Amount<*>>() {})
|
||||
assertThat(amount.quantity).isEqualTo(100)
|
||||
assertThat(amount.token).isEqualTo(Currency.getInstance("USD"))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Amount(Unknown) YAML deserialization`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Amount(Unknown) YAML deserialization`() {
|
||||
val str = """{ quantity: 100, token: USD }"""
|
||||
val amount = yamlMapper.readValue<Amount<*>>(str, object : TypeReference<Amount<*>>() {})
|
||||
assertThat(amount.quantity).isEqualTo(100)
|
||||
assertThat(amount.token).isEqualTo(Currency.getInstance("USD"))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Amount(Currency) YAML serialization`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Amount(Currency) YAML serialization`() {
|
||||
assertThat(yamlMapper.valueToTree<TextNode>(Amount.parseCurrency("£25000000"))).isEqualTo(TextNode("25000000.00 GBP"))
|
||||
assertThat(yamlMapper.valueToTree<TextNode>(Amount.parseCurrency("$250000"))).isEqualTo(TextNode("250000.00 USD"))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Amount(CarbonCredit) JSON serialization`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Amount(CarbonCredit) JSON serialization`() {
|
||||
assertThat(jsonMapper.writeValueAsString(Amount(123456, CO2)).trim())
|
||||
.isEqualTo(""""123456 CarbonCredit(type=CO2)"""")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Amount(CarbonCredit) YAML serialization`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Amount(CarbonCredit) YAML serialization`() {
|
||||
assertThat(yamlMapper.writeValueAsString(Amount(123456, CO2)).trim())
|
||||
.isEqualTo("""--- "123456 CarbonCredit(type=CO2)"""")
|
||||
}
|
||||
|
@ -107,14 +107,14 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory:
|
||||
doReturn(attachments).whenever(services).attachments
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Amount(Currency) serialization`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Amount(Currency) serialization`() {
|
||||
assertThat(mapper.valueToTree<TextNode>(Amount.parseCurrency("£25000000")).textValue()).isEqualTo("25000000.00 GBP")
|
||||
assertThat(mapper.valueToTree<TextNode>(Amount.parseCurrency("$250000")).textValue()).isEqualTo("250000.00 USD")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Amount(Currency) deserialization`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Amount(Currency) deserialization`() {
|
||||
val old = mapOf(
|
||||
"quantity" to 2500000000,
|
||||
"token" to "USD"
|
||||
@ -122,13 +122,13 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory:
|
||||
assertThat(mapper.convertValue<Amount<Currency>>(old)).isEqualTo(Amount(2_500_000_000, USD))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Amount(Currency) Text deserialization`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Amount(Currency) Text deserialization`() {
|
||||
assertThat(mapper.convertValue<Amount<Currency>>(TextNode("$25000000"))).isEqualTo(Amount(2_500_000_000, USD))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun ByteSequence() {
|
||||
@Test(timeout=300_000)
|
||||
fun ByteSequence() {
|
||||
val byteSequence: ByteSequence = OpaqueBytes.of(1, 2, 3, 4).subSequence(0, 2)
|
||||
val json = mapper.valueToTree<BinaryNode>(byteSequence)
|
||||
assertThat(json.binaryValue()).containsExactly(1, 2)
|
||||
@ -136,22 +136,22 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory:
|
||||
assertThat(mapper.convertValue<ByteSequence>(json)).isEqualTo(byteSequence)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `OpaqueBytes serialization`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `OpaqueBytes serialization`() {
|
||||
val opaqueBytes = OpaqueBytes(secureRandomBytes(128))
|
||||
val json = mapper.valueToTree<BinaryNode>(opaqueBytes)
|
||||
assertThat(json.binaryValue()).isEqualTo(opaqueBytes.bytes)
|
||||
assertThat(json.asText()).isEqualTo(opaqueBytes.bytes.toBase64())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `OpaqueBytes deserialization`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `OpaqueBytes deserialization`() {
|
||||
assertThat(mapper.convertValue<OpaqueBytes>(TextNode("1234"))).isEqualTo(OpaqueBytes("1234".toByteArray(UTF_8)))
|
||||
assertThat(mapper.convertValue<OpaqueBytes>(BinaryNode(byteArrayOf(1, 2, 3, 4)))).isEqualTo(OpaqueBytes.of(1, 2, 3, 4))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun SerializedBytes() {
|
||||
@Test(timeout=300_000)
|
||||
fun SerializedBytes() {
|
||||
val data = TestData(BOB_NAME, "Summary", SubTestData(1234))
|
||||
val serializedBytes = data.serialize()
|
||||
val json = mapper.valueToTree<ObjectNode>(serializedBytes)
|
||||
@ -168,8 +168,8 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory:
|
||||
// @CordaSerializable
|
||||
// data class ClassNotOnClasspath(val name: CordaX500Name, val value: Int)
|
||||
|
||||
@Test
|
||||
fun `SerializedBytes of class not on classpath`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `SerializedBytes of class not on classpath`() {
|
||||
// The contents of the file were written out as follows:
|
||||
// ClassNotOnClasspath(BOB_NAME, 54321).serialize().open().copyTo("build" / "class-not-on-classpath-data")
|
||||
|
||||
@ -184,8 +184,8 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory:
|
||||
assertThat(mapper.convertValue<SerializedBytes<*>>(BinaryNode(serializedBytes.bytes))).isEqualTo(serializedBytes)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun DigitalSignature() {
|
||||
@Test(timeout=300_000)
|
||||
fun DigitalSignature() {
|
||||
val digitalSignature = DigitalSignature(secureRandomBytes(128))
|
||||
val json = mapper.valueToTree<BinaryNode>(digitalSignature)
|
||||
assertThat(json.binaryValue()).isEqualTo(digitalSignature.bytes)
|
||||
@ -193,8 +193,8 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory:
|
||||
assertThat(mapper.convertValue<DigitalSignature>(json)).isEqualTo(digitalSignature)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `DigitalSignature WithKey`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `DigitalSignature WithKey`() {
|
||||
val digitalSignature = DigitalSignature.WithKey(BOB_PUBKEY, secureRandomBytes(128))
|
||||
val json = mapper.valueToTree<ObjectNode>(digitalSignature)
|
||||
val (by, bytes) = json.assertHasOnlyFields("by", "bytes")
|
||||
@ -203,8 +203,8 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory:
|
||||
assertThat(mapper.convertValue<DigitalSignature.WithKey>(json)).isEqualTo(digitalSignature)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun DigitalSignatureWithCert() {
|
||||
@Test(timeout=300_000)
|
||||
fun DigitalSignatureWithCert() {
|
||||
val digitalSignature = DigitalSignatureWithCert(MINI_CORP.identity.certificate, secureRandomBytes(128))
|
||||
val json = mapper.valueToTree<ObjectNode>(digitalSignature)
|
||||
val (by, bytes) = json.assertHasOnlyFields("by", "bytes", "parentCertsChain")
|
||||
@ -213,8 +213,8 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory:
|
||||
assertThat(mapper.convertValue<DigitalSignatureWithCert>(json)).isEqualTo(digitalSignature)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun TransactionSignature() {
|
||||
@Test(timeout=300_000)
|
||||
fun TransactionSignature() {
|
||||
val signatureMetadata = SignatureMetadata(1, 1)
|
||||
val partialMerkleTree = PartialMerkleTree(PartialTree.Node(
|
||||
left = PartialTree.Leaf(SecureHash.randomSHA256()),
|
||||
@ -235,8 +235,8 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory:
|
||||
assertThat(mapper.convertValue<TransactionSignature>(json)).isEqualTo(transactionSignature)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `SignedTransaction (WireTransaction)`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `SignedTransaction (WireTransaction)`() {
|
||||
val attachmentId = SecureHash.randomSHA256()
|
||||
doReturn(attachmentId).whenever(cordappProvider).getContractAttachmentID(DummyContract.PROGRAM_ID)
|
||||
val attachmentStorage = rigorousMock<AttachmentStorage>()
|
||||
@ -279,8 +279,8 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory:
|
||||
assertThat(mapper.convertValue<SignedTransaction>(json)).isEqualTo(stx)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun TransactionState() {
|
||||
@Test(timeout=300_000)
|
||||
fun TransactionState() {
|
||||
val txState = createTransactionState()
|
||||
val json = mapper.valueToTree<ObjectNode>(txState)
|
||||
println(mapper.writeValueAsString(json))
|
||||
@ -288,44 +288,44 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory:
|
||||
assertThat(mapper.convertValue<TransactionState<*>>(json)).isEqualTo(txState)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun Command() {
|
||||
@Test(timeout=300_000)
|
||||
fun Command() {
|
||||
val command = Command(DummyCommandData, listOf(BOB_PUBKEY))
|
||||
val json = mapper.valueToTree<ObjectNode>(command)
|
||||
assertThat(mapper.convertValue<Command<*>>(json)).isEqualTo(command)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `TimeWindow - fromOnly`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `TimeWindow - fromOnly`() {
|
||||
val fromOnly = TimeWindow.fromOnly(Instant.now())
|
||||
val json = mapper.valueToTree<ObjectNode>(fromOnly)
|
||||
assertThat(mapper.convertValue<TimeWindow>(json)).isEqualTo(fromOnly)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `TimeWindow - untilOnly`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `TimeWindow - untilOnly`() {
|
||||
val untilOnly = TimeWindow.untilOnly(Instant.now())
|
||||
val json = mapper.valueToTree<ObjectNode>(untilOnly)
|
||||
assertThat(mapper.convertValue<TimeWindow>(json)).isEqualTo(untilOnly)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `TimeWindow - between`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `TimeWindow - between`() {
|
||||
val between = TimeWindow.between(Instant.now(), Instant.now() + 1.days)
|
||||
val json = mapper.valueToTree<ObjectNode>(between)
|
||||
assertThat(mapper.convertValue<TimeWindow>(json)).isEqualTo(between)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun PrivacySalt() {
|
||||
@Test(timeout=300_000)
|
||||
fun PrivacySalt() {
|
||||
val privacySalt = net.corda.core.contracts.PrivacySalt()
|
||||
val json = mapper.valueToTree<TextNode>(privacySalt)
|
||||
assertThat(json.textValue()).isEqualTo(privacySalt.bytes.toHexString())
|
||||
assertThat(mapper.convertValue<PrivacySalt>(json)).isEqualTo(privacySalt)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun SignatureMetadata() {
|
||||
@Test(timeout=300_000)
|
||||
fun SignatureMetadata() {
|
||||
val signatureMetadata = SignatureMetadata(2, Crypto.ECDSA_SECP256R1_SHA256.schemeNumberID)
|
||||
val json = mapper.valueToTree<ObjectNode>(signatureMetadata)
|
||||
val (platformVersion, scheme) = json.assertHasOnlyFields("platformVersion", "scheme")
|
||||
@ -334,44 +334,44 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory:
|
||||
assertThat(mapper.convertValue<SignatureMetadata>(json)).isEqualTo(signatureMetadata)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `SignatureMetadata on unknown schemeNumberID`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `SignatureMetadata on unknown schemeNumberID`() {
|
||||
val signatureMetadata = SignatureMetadata(2, Int.MAX_VALUE)
|
||||
val json = mapper.valueToTree<ObjectNode>(signatureMetadata)
|
||||
assertThat(json["scheme"].intValue()).isEqualTo(Int.MAX_VALUE)
|
||||
assertThat(mapper.convertValue<SignatureMetadata>(json)).isEqualTo(signatureMetadata)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `SignatureScheme serialization`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `SignatureScheme serialization`() {
|
||||
val json = mapper.valueToTree<TextNode>(Crypto.ECDSA_SECP256R1_SHA256)
|
||||
assertThat(json.textValue()).isEqualTo("ECDSA_SECP256R1_SHA256")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `SignatureScheme deserialization`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `SignatureScheme deserialization`() {
|
||||
assertThat(mapper.convertValue<SignatureScheme>(TextNode("EDDSA_ED25519_SHA512"))).isSameAs(Crypto.EDDSA_ED25519_SHA512)
|
||||
assertThat(mapper.convertValue<SignatureScheme>(IntNode(4))).isSameAs(Crypto.EDDSA_ED25519_SHA512)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `PartialTree IncludedLeaf`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `PartialTree IncludedLeaf`() {
|
||||
val includedLeaf = PartialTree.IncludedLeaf(SecureHash.randomSHA256())
|
||||
val json = mapper.valueToTree<ObjectNode>(includedLeaf)
|
||||
assertThat(json.assertHasOnlyFields("includedLeaf")[0].textValue()).isEqualTo(includedLeaf.hash.toString())
|
||||
assertThat(mapper.convertValue<PartialTree.IncludedLeaf>(json)).isEqualTo(includedLeaf)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `PartialTree Leaf`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `PartialTree Leaf`() {
|
||||
val leaf = PartialTree.Leaf(SecureHash.randomSHA256())
|
||||
val json = mapper.valueToTree<ObjectNode>(leaf)
|
||||
assertThat(json.assertHasOnlyFields("leaf")[0].textValue()).isEqualTo(leaf.hash.toString())
|
||||
assertThat(mapper.convertValue<PartialTree.Leaf>(json)).isEqualTo(leaf)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `simple PartialTree Node`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `simple PartialTree Node`() {
|
||||
val node = PartialTree.Node(
|
||||
left = PartialTree.Leaf(SecureHash.randomSHA256()),
|
||||
right = PartialTree.IncludedLeaf(SecureHash.randomSHA256())
|
||||
@ -384,8 +384,8 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory:
|
||||
assertThat(mapper.convertValue<PartialTree.Node>(json)).isEqualTo(node)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `complex PartialTree Node`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `complex PartialTree Node`() {
|
||||
val node = PartialTree.Node(
|
||||
left = PartialTree.IncludedLeaf(SecureHash.randomSHA256()),
|
||||
right = PartialTree.Node(
|
||||
@ -401,8 +401,8 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory:
|
||||
// TODO Issued
|
||||
// TODO PartyAndReference
|
||||
|
||||
@Test
|
||||
fun CordaX500Name() {
|
||||
@Test(timeout=300_000)
|
||||
fun CordaX500Name() {
|
||||
testToStringSerialisation(CordaX500Name(
|
||||
commonName = "COMMON",
|
||||
organisationUnit = "ORG UNIT",
|
||||
@ -413,42 +413,42 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory:
|
||||
))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `SecureHash SHA256`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `SecureHash SHA256`() {
|
||||
testToStringSerialisation(SecureHash.randomSHA256())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun NetworkHostAndPort() {
|
||||
@Test(timeout=300_000)
|
||||
fun NetworkHostAndPort() {
|
||||
testToStringSerialisation(NetworkHostAndPort("localhost", 9090))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun UUID() {
|
||||
@Test(timeout=300_000)
|
||||
fun UUID() {
|
||||
testToStringSerialisation(UUID.randomUUID())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun Instant() {
|
||||
@Test(timeout=300_000)
|
||||
fun Instant() {
|
||||
testToStringSerialisation(Instant.now())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Date is treated as Instant`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Date is treated as Instant`() {
|
||||
val date = Date()
|
||||
val json = mapper.valueToTree<TextNode>(date)
|
||||
assertThat(json.textValue()).isEqualTo(date.toInstant().toString())
|
||||
assertThat(mapper.convertValue<Date>(json)).isEqualTo(date)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Party serialization`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Party serialization`() {
|
||||
val json = mapper.valueToTree<TextNode>(MINI_CORP.party)
|
||||
assertThat(json.textValue()).isEqualTo(MINI_CORP.name.toString())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Party serialization with isFullParty = true`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Party serialization with isFullParty = true`() {
|
||||
partyObjectMapper.isFullParties = true
|
||||
val json = mapper.valueToTree<ObjectNode>(MINI_CORP.party)
|
||||
val (name, owningKey) = json.assertHasOnlyFields("name", "owningKey")
|
||||
@ -456,8 +456,8 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory:
|
||||
assertThat(owningKey.valueAs<PublicKey>(mapper)).isEqualTo(MINI_CORP.publicKey)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Party deserialization on full name`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Party deserialization on full name`() {
|
||||
fun convertToParty() = mapper.convertValue<Party>(TextNode(MINI_CORP.name.toString()))
|
||||
|
||||
// Check that it fails if it can't find the party
|
||||
@ -467,8 +467,8 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory:
|
||||
assertThat(convertToParty()).isEqualTo(MINI_CORP.party)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Party deserialization on part of name`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Party deserialization on part of name`() {
|
||||
fun convertToParty() = mapper.convertValue<Party>(TextNode(MINI_CORP.name.organisation))
|
||||
|
||||
// Check that it fails if it can't find the party
|
||||
@ -478,8 +478,8 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory:
|
||||
assertThat(convertToParty()).isEqualTo(MINI_CORP.party)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Party deserialization on public key`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Party deserialization on public key`() {
|
||||
fun convertToParty() = mapper.convertValue<Party>(TextNode(MINI_CORP.publicKey.toBase58String()))
|
||||
|
||||
// Check that it fails if it can't find the party
|
||||
@ -489,8 +489,8 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory:
|
||||
assertThat(convertToParty()).isEqualTo(MINI_CORP.party)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Party deserialization on name and key`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Party deserialization on name and key`() {
|
||||
val party = mapper.convertValue<Party>(mapOf(
|
||||
"name" to MINI_CORP.name,
|
||||
"owningKey" to MINI_CORP.publicKey
|
||||
@ -500,23 +500,23 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory:
|
||||
assertThat(party.owningKey).isEqualTo(MINI_CORP.publicKey)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun PublicKey() {
|
||||
@Test(timeout=300_000)
|
||||
fun PublicKey() {
|
||||
val json = mapper.valueToTree<TextNode>(MINI_CORP.publicKey)
|
||||
assertThat(json.textValue()).isEqualTo(MINI_CORP.publicKey.toBase58String())
|
||||
assertThat(mapper.convertValue<PublicKey>(json)).isEqualTo(MINI_CORP.publicKey)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `EdDSA public key`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `EdDSA public key`() {
|
||||
val publicKey = Crypto.deriveKeyPairFromEntropy(Crypto.EDDSA_ED25519_SHA512, SEED).public
|
||||
val json = mapper.valueToTree<TextNode>(publicKey)
|
||||
assertThat(json.textValue()).isEqualTo(publicKey.toBase58String())
|
||||
assertThat(mapper.convertValue<PublicKey>(json)).isEqualTo(publicKey)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun CompositeKey() {
|
||||
@Test(timeout=300_000)
|
||||
fun CompositeKey() {
|
||||
val innerKeys = (1..3).map { i ->
|
||||
Crypto.deriveKeyPairFromEntropy(Crypto.EDDSA_ED25519_SHA512, SEED + i.toBigInteger()).public
|
||||
}
|
||||
@ -530,22 +530,22 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory:
|
||||
assertThat(mapper.convertValue<CompositeKey>(json)).isEqualTo(publicKey)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun AnonymousParty() {
|
||||
@Test(timeout=300_000)
|
||||
fun AnonymousParty() {
|
||||
val anonymousParty = AnonymousParty(ALICE_PUBKEY)
|
||||
val json = mapper.valueToTree<TextNode>(anonymousParty)
|
||||
assertThat(json.textValue()).isEqualTo(ALICE_PUBKEY.toBase58String())
|
||||
assertThat(mapper.convertValue<AnonymousParty>(json)).isEqualTo(anonymousParty)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `PartyAndCertificate serialization`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `PartyAndCertificate serialization`() {
|
||||
val json = mapper.valueToTree<TextNode>(MINI_CORP.identity)
|
||||
assertThat(json.textValue()).isEqualTo(MINI_CORP.name.toString())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `PartyAndCertificate serialization with isFullParty = true`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `PartyAndCertificate serialization with isFullParty = true`() {
|
||||
partyObjectMapper.isFullParties = true
|
||||
val json = mapper.valueToTree<ObjectNode>(MINI_CORP.identity)
|
||||
println(mapper.writeValueAsString(json))
|
||||
@ -554,16 +554,16 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory:
|
||||
assertThat(certPath.valueAs<CertPath>(mapper)).isEqualTo(MINI_CORP.identity.certPath)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `PartyAndCertificate deserialization on cert path`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `PartyAndCertificate deserialization on cert path`() {
|
||||
val certPathJson = mapper.valueToTree<JsonNode>(MINI_CORP.identity.certPath)
|
||||
val partyAndCert = mapper.convertValue<PartyAndCertificate>(mapOf("certPath" to certPathJson))
|
||||
// PartyAndCertificate.equals is defined on the Party so we must check the certPath directly
|
||||
assertThat(partyAndCert.certPath).isEqualTo(MINI_CORP.identity.certPath)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `NodeInfo serialization`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `NodeInfo serialization`() {
|
||||
val (nodeInfo) = createNodeInfoAndSigned(ALICE_NAME)
|
||||
val json = mapper.valueToTree<ObjectNode>(nodeInfo)
|
||||
val (addresses, legalIdentitiesAndCerts, platformVersion, serial) = json.assertHasOnlyFields(
|
||||
@ -584,8 +584,8 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory:
|
||||
assertThat(serial.longValue()).isEqualTo(nodeInfo.serial)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `NodeInfo deserialization on name`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `NodeInfo deserialization on name`() {
|
||||
val (nodeInfo) = createNodeInfoAndSigned(ALICE_NAME)
|
||||
|
||||
fun convertToNodeInfo() = mapper.convertValue<NodeInfo>(TextNode(ALICE_NAME.toString()))
|
||||
@ -597,8 +597,8 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory:
|
||||
assertThat(convertToNodeInfo()).isEqualTo(nodeInfo)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `NodeInfo deserialization on public key`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `NodeInfo deserialization on public key`() {
|
||||
val (nodeInfo) = createNodeInfoAndSigned(ALICE_NAME)
|
||||
|
||||
fun convertToNodeInfo() = mapper.convertValue<NodeInfo>(TextNode(nodeInfo.legalIdentities[0].owningKey.toBase58String()))
|
||||
@ -610,8 +610,8 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory:
|
||||
assertThat(convertToNodeInfo()).isEqualTo(nodeInfo)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun CertPath() {
|
||||
@Test(timeout=300_000)
|
||||
fun CertPath() {
|
||||
val certPath = MINI_CORP.identity.certPath
|
||||
val json = mapper.valueToTree<ObjectNode>(certPath)
|
||||
println(mapper.writeValueAsString(json))
|
||||
@ -624,8 +624,8 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory:
|
||||
assertThat(mapper.convertValue<CertPath>(json).encoded).isEqualTo(certPath.encoded)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `X509Certificate serialization`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `X509Certificate serialization`() {
|
||||
val cert: X509Certificate = MINI_CORP.identity.certificate
|
||||
val json = mapper.valueToTree<ObjectNode>(cert)
|
||||
println(mapper.writeValueAsString(json))
|
||||
@ -639,28 +639,28 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory:
|
||||
assertThat(json["encoded"].binaryValue()).isEqualTo(cert.encoded)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `X509Certificate serialization when extendedKeyUsage is null`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `X509Certificate serialization when extendedKeyUsage is null`() {
|
||||
val cert: X509Certificate = spy(MINI_CORP.identity.certificate)
|
||||
whenever(cert.extendedKeyUsage).thenReturn(null)
|
||||
// should work even if extendedKeyUsage is null
|
||||
mapper.valueToTree<ObjectNode>(cert)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `X509Certificate deserialization`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `X509Certificate deserialization`() {
|
||||
val cert: X509Certificate = MINI_CORP.identity.certificate
|
||||
assertThat(mapper.convertValue<X509Certificate>(mapOf("encoded" to cert.encoded))).isEqualTo(cert)
|
||||
assertThat(mapper.convertValue<X509Certificate>(BinaryNode(cert.encoded))).isEqualTo(cert)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun X500Principal() {
|
||||
@Test(timeout=300_000)
|
||||
fun X500Principal() {
|
||||
testToStringSerialisation(X500Principal("CN=Common,L=London,O=Org,C=UK"))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `@CordaSerializable class which has non-c'tor properties`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `@CordaSerializable class which has non-c'tor properties`() {
|
||||
val data = NonCtorPropertiesData(4434)
|
||||
val json = mapper.valueToTree<ObjectNode>(data)
|
||||
val (value) = json.assertHasOnlyFields("value")
|
||||
@ -668,8 +668,8 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory:
|
||||
assertThat(mapper.convertValue<NonCtorPropertiesData>(json)).isEqualTo(data)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `LinearState where the linearId property does not match the backing field`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `LinearState where the linearId property does not match the backing field`() {
|
||||
val funkyLinearState = FunkyLinearState(UniqueIdentifier())
|
||||
// As a sanity check, show that this is a valid CordaSerializable class
|
||||
assertThat(funkyLinearState.serialize().deserialize()).isEqualTo(funkyLinearState)
|
||||
@ -677,14 +677,14 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory:
|
||||
assertThat(mapper.convertValue<FunkyLinearState>(json)).isEqualTo(funkyLinearState)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `kotlin object`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `kotlin object`() {
|
||||
val json = mapper.valueToTree<ObjectNode>(KotlinObject)
|
||||
assertThat(mapper.convertValue<KotlinObject>(json)).isSameAs(KotlinObject)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `@CordaSerializable kotlin object`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `@CordaSerializable kotlin object`() {
|
||||
val json = mapper.valueToTree<ObjectNode>(CordaSerializableKotlinObject)
|
||||
assertThat(mapper.convertValue<CordaSerializableKotlinObject>(json)).isSameAs(CordaSerializableKotlinObject)
|
||||
}
|
||||
|
@ -13,15 +13,15 @@ class StateMachineRunIdTest {
|
||||
private val jsonMapper: ObjectMapper = ObjectMapper().registerModule(CordaModule())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `state machine run ID deserialise`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `state machine run ID deserialise`() {
|
||||
val str = """"$ID""""
|
||||
val runID = jsonMapper.readValue(str, StateMachineRunId::class.java)
|
||||
assertEquals(StateMachineRunId(UUID.fromString(ID)), runID)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `state machine run ID serialise`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `state machine run ID serialise`() {
|
||||
val runId = StateMachineRunId(UUID.fromString(ID))
|
||||
val str = jsonMapper.writeValueAsString(runId)
|
||||
assertEquals(""""$ID"""", str)
|
||||
|
@ -32,8 +32,8 @@ class StringToMethodCallParserTest {
|
||||
"overload a: A, b: B" to "AB"
|
||||
)
|
||||
|
||||
@Test
|
||||
fun calls() {
|
||||
@Test(timeout=300_000)
|
||||
fun calls() {
|
||||
val parser = StringToMethodCallParser(Target::class)
|
||||
val target = Target()
|
||||
for ((input, output) in tests) {
|
||||
@ -45,8 +45,8 @@ class StringToMethodCallParserTest {
|
||||
* It would be unreasonable to expect "[ A, B, C ]" to deserialise as "Deque<Char>" by default.
|
||||
* Deque is chosen as we still expect it to preserve the order of its elements.
|
||||
*/
|
||||
@Test
|
||||
fun complexNestedGenericMethod() {
|
||||
@Test(timeout=300_000)
|
||||
fun complexNestedGenericMethod() {
|
||||
val parser = StringToMethodCallParser(Target::class)
|
||||
val result = parser.parse(Target(), "complexNestedObject pairs: { first: 101, second: [ A, B, C ] }").invoke()
|
||||
|
||||
@ -66,8 +66,8 @@ class StringToMethodCallParserTest {
|
||||
constructor(numbers: List<Long>) : this(numbers.map(Long::toString).joinToString("+"), numbers.size)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun ctor1() {
|
||||
@Test(timeout=300_000)
|
||||
fun ctor1() {
|
||||
val clazz = ConstructorTarget::class.java
|
||||
val parser = StringToMethodCallParser(clazz)
|
||||
val ctor = clazz.getDeclaredConstructor(String::class.java, Int::class.java)
|
||||
@ -77,8 +77,8 @@ class StringToMethodCallParserTest {
|
||||
assertArrayEquals(arrayOf("Blah blah blah", 12), args)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun ctor2() {
|
||||
@Test(timeout=300_000)
|
||||
fun ctor2() {
|
||||
val clazz = ConstructorTarget::class.java
|
||||
val parser = StringToMethodCallParser(clazz)
|
||||
val ctor = clazz.getDeclaredConstructor(String::class.java)
|
||||
@ -88,8 +88,8 @@ class StringToMethodCallParserTest {
|
||||
assertArrayEquals(arrayOf("Foo bar!"), args)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun constructorWithGenericArgs() {
|
||||
@Test(timeout=300_000)
|
||||
fun constructorWithGenericArgs() {
|
||||
val clazz = ConstructorTarget::class.java
|
||||
val ctor = clazz.getDeclaredConstructor(List::class.java)
|
||||
StringToMethodCallParser(clazz).apply {
|
||||
|
@ -23,8 +23,8 @@ class ExchangeRateModelTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `perform fx testing`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `perform fx testing`() {
|
||||
val tenSwissies = Amount(10, BigDecimal.ONE, CHF)
|
||||
assertEquals(instance.exchangeAmount(tenSwissies, CHF), tenSwissies)
|
||||
|
||||
|
@ -20,8 +20,8 @@ class AggregatedListTest {
|
||||
replayedList = ReplayedList(aggregatedList)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun addWorks() {
|
||||
@Test(timeout=300_000)
|
||||
fun addWorks() {
|
||||
assertEquals(replayedList.size, 0)
|
||||
|
||||
sourceList.add(9)
|
||||
@ -43,8 +43,8 @@ class AggregatedListTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun removeWorks() {
|
||||
@Test(timeout=300_000)
|
||||
fun removeWorks() {
|
||||
sourceList.addAll(0, 1, 2, 3, 4)
|
||||
|
||||
assertEquals(replayedList.size, 3)
|
||||
@ -82,8 +82,8 @@ class AggregatedListTest {
|
||||
assertEquals(replayedList.size, 0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun multipleElementsWithSameHashWorks() {
|
||||
@Test(timeout=300_000)
|
||||
fun multipleElementsWithSameHashWorks() {
|
||||
sourceList.addAll(0, 0)
|
||||
assertEquals(replayedList.size, 1)
|
||||
replayedList.forEach {
|
||||
|
@ -20,8 +20,8 @@ class AssociatedListTest {
|
||||
replayedMap = ReplayedMap(associatedList)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun addWorks() {
|
||||
@Test(timeout=300_000)
|
||||
fun addWorks() {
|
||||
assertEquals(replayedMap.size, 1)
|
||||
assertEquals(replayedMap[0], 0)
|
||||
|
||||
@ -37,8 +37,8 @@ class AssociatedListTest {
|
||||
assertEquals(replayedMap[1], 4)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun removeWorks() {
|
||||
@Test(timeout=300_000)
|
||||
fun removeWorks() {
|
||||
sourceList.addAll(2, 4)
|
||||
assertEquals(replayedMap.size, 3)
|
||||
|
||||
@ -57,8 +57,8 @@ class AssociatedListTest {
|
||||
assertEquals(replayedMap.size, 0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun updateWorks() {
|
||||
@Test(timeout=300_000)
|
||||
fun updateWorks() {
|
||||
sourceList.addAll(2, 4)
|
||||
assertEquals(replayedMap.size, 3)
|
||||
|
||||
|
@ -42,8 +42,8 @@ class ConcatenatedListTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun addWorks() {
|
||||
@Test(timeout=300_000)
|
||||
fun addWorks() {
|
||||
concatenatedList.checkInvariants()
|
||||
assertEquals(replayedList.size, 1)
|
||||
assertEquals(replayedList[0], "hello")
|
||||
@ -85,8 +85,8 @@ class ConcatenatedListTest {
|
||||
assertEquals(replayedList[6], "b")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun removeWorks() {
|
||||
@Test(timeout=300_000)
|
||||
fun removeWorks() {
|
||||
sourceList.add(FXCollections.observableArrayList("a", "b"))
|
||||
sourceList.add(1, FXCollections.observableArrayList("c"))
|
||||
sourceList[0].addAll("d", "e")
|
||||
@ -113,8 +113,8 @@ class ConcatenatedListTest {
|
||||
assertEquals(replayedList[0], "b")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun permutationWorks() {
|
||||
@Test(timeout=300_000)
|
||||
fun permutationWorks() {
|
||||
sourceList.addAll(FXCollections.observableArrayList("a", "b"), FXCollections.observableArrayList("c"))
|
||||
concatenatedList.checkInvariants()
|
||||
assertEquals(replayedList.size, 4)
|
||||
|
@ -21,8 +21,8 @@ class FlattenedListTest {
|
||||
replayedList = ReplayedList(flattenedList)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun addWorks() {
|
||||
@Test(timeout=300_000)
|
||||
fun addWorks() {
|
||||
assertEquals(replayedList.size, 1)
|
||||
assertEquals(replayedList[0], 1234)
|
||||
|
||||
@ -54,8 +54,8 @@ class FlattenedListTest {
|
||||
assertEquals(replayedList[5], 34)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun removeWorks() {
|
||||
@Test(timeout=300_000)
|
||||
fun removeWorks() {
|
||||
val firstRemoved = sourceList.removeAt(0)
|
||||
assertEquals(firstRemoved.get(), 1234)
|
||||
assertEquals(replayedList.size, 0)
|
||||
@ -76,8 +76,8 @@ class FlattenedListTest {
|
||||
assertEquals(replayedList.size, 0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun updatingObservableWorks() {
|
||||
@Test(timeout=300_000)
|
||||
fun updatingObservableWorks() {
|
||||
assertEquals(replayedList[0], 1234)
|
||||
sourceList[0].set(4321)
|
||||
assertEquals(replayedList[0], 4321)
|
||||
@ -92,8 +92,8 @@ class FlattenedListTest {
|
||||
assertEquals(replayedList[1], 8765)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun reusingObservableWorks() {
|
||||
@Test(timeout=300_000)
|
||||
fun reusingObservableWorks() {
|
||||
val observable = SimpleObjectProperty(12)
|
||||
sourceList.add(observable)
|
||||
sourceList.add(observable)
|
||||
|
@ -26,8 +26,8 @@ class LeftOuterJoinedMapTest {
|
||||
}
|
||||
|
||||
// TODO perhaps these are too brittle because they test indices that are not stable. Use Expect dsl?
|
||||
@Test
|
||||
fun addWorks() {
|
||||
@Test(timeout=300_000)
|
||||
fun addWorks() {
|
||||
assertEquals(replayedList.size, 1)
|
||||
assertEquals(replayedList[0].first.name, "Alice")
|
||||
assertEquals(replayedList[0].second.size, 0)
|
||||
@ -73,8 +73,8 @@ class LeftOuterJoinedMapTest {
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
fun removeWorks() {
|
||||
@Test(timeout=300_000)
|
||||
fun removeWorks() {
|
||||
dogs.add(Dog("Scooby", owner = "Alice"))
|
||||
people.add(Person("Bob", 34))
|
||||
dogs.add(Dog("Bella", owner = "Bob"))
|
||||
|
@ -19,8 +19,8 @@ class MappedListTest {
|
||||
replayedList = ReplayedList(mappedList)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun addWorks() {
|
||||
@Test(timeout=300_000)
|
||||
fun addWorks() {
|
||||
assertEquals(replayedList.size, 1)
|
||||
assertEquals(replayedList[0], 5)
|
||||
|
||||
@ -36,8 +36,8 @@ class MappedListTest {
|
||||
assertEquals(replayedList[2], 3)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun removeWorks() {
|
||||
@Test(timeout=300_000)
|
||||
fun removeWorks() {
|
||||
sourceList.add("Bob")
|
||||
sourceList.add(0, "Charlie")
|
||||
assertEquals(replayedList.size, 3)
|
||||
@ -48,8 +48,8 @@ class MappedListTest {
|
||||
assertEquals(replayedList[1], 3)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun permuteWorks() {
|
||||
@Test(timeout=300_000)
|
||||
fun permuteWorks() {
|
||||
sourceList.add("Bob")
|
||||
sourceList.add(0, "Charlie")
|
||||
|
||||
|
@ -17,8 +17,8 @@ class ReplayedListTest {
|
||||
replayedList = ReplayedList(sourceList)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun addWorks() {
|
||||
@Test(timeout=300_000)
|
||||
fun addWorks() {
|
||||
assertEquals(replayedList.size, 1)
|
||||
assertEquals(replayedList[0], 1234)
|
||||
|
||||
@ -50,8 +50,8 @@ class ReplayedListTest {
|
||||
assertEquals(replayedList[5], 34)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun removeWorks() {
|
||||
@Test(timeout=300_000)
|
||||
fun removeWorks() {
|
||||
val firstRemoved = sourceList.removeAt(0)
|
||||
assertEquals(firstRemoved, 1234)
|
||||
assertEquals(replayedList.size, 0)
|
||||
@ -70,8 +70,8 @@ class ReplayedListTest {
|
||||
assertEquals(replayedList.size, 0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun updateWorks() {
|
||||
@Test(timeout=300_000)
|
||||
fun updateWorks() {
|
||||
assertEquals(replayedList[0], 1234)
|
||||
sourceList[0] = 4321
|
||||
assertEquals(replayedList[0], 4321)
|
||||
|
@ -28,8 +28,8 @@ class BlacklistKotlinClosureTest {
|
||||
@CordaSerializable
|
||||
data class Packet(val x: () -> Long)
|
||||
|
||||
@Test
|
||||
fun `closure sent via RPC`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `closure sent via RPC`() {
|
||||
driver(DriverParameters(startNodesInProcess = true, notarySpecs = emptyList(), cordappsForAllNodes = listOf(enclosedCordapp()))) {
|
||||
val rpc = startNode(providedName = ALICE_NAME).getOrThrow().rpc
|
||||
val packet = Packet { EVIL }
|
||||
|
@ -73,27 +73,27 @@ class CordaRPCClientTest : NodeBasedTest(listOf("net.corda.finance"), notaries =
|
||||
connection?.close()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `log in with valid username and password`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `log in with valid username and password`() {
|
||||
login(rpcUser.username, rpcUser.password)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `log in with unknown user`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `log in with unknown user`() {
|
||||
assertThatExceptionOfType(ActiveMQSecurityException::class.java).isThrownBy {
|
||||
login(random63BitValue().toString(), rpcUser.password)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `log in with incorrect password`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `log in with incorrect password`() {
|
||||
assertThatExceptionOfType(ActiveMQSecurityException::class.java).isThrownBy {
|
||||
login(rpcUser.username, random63BitValue().toString())
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `shutdown command stops the node`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `shutdown command stops the node`() {
|
||||
val nodeIsShut: PublishSubject<Unit> = PublishSubject.create()
|
||||
val latch = CountDownLatch(1)
|
||||
var successful = false
|
||||
@ -149,8 +149,8 @@ class CordaRPCClientTest : NodeBasedTest(listOf("net.corda.finance"), notaries =
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `close-send deadlock and premature shutdown on empty observable`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `close-send deadlock and premature shutdown on empty observable`() {
|
||||
println("Starting client")
|
||||
login(rpcUser.username, rpcUser.password)
|
||||
println("Creating proxy")
|
||||
@ -165,16 +165,16 @@ class CordaRPCClientTest : NodeBasedTest(listOf("net.corda.finance"), notaries =
|
||||
println("Result: ${flowHandle.returnValue.getOrThrow()}")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `check basic flow has no progress`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `check basic flow has no progress`() {
|
||||
login(rpcUser.username, rpcUser.password)
|
||||
connection!!.proxy.startFlow(::CashPaymentFlow, 100.DOLLARS, identity).use {
|
||||
assertFalse(it is FlowProgressHandle<*>)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `get cash balances`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `get cash balances`() {
|
||||
login(rpcUser.username, rpcUser.password)
|
||||
val proxy = connection!!.proxy
|
||||
val startCash = proxy.getCashBalances()
|
||||
@ -191,8 +191,8 @@ class CordaRPCClientTest : NodeBasedTest(listOf("net.corda.finance"), notaries =
|
||||
assertEquals(123.DOLLARS, cashDollars)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `flow initiator via RPC`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `flow initiator via RPC`() {
|
||||
val externalTrace = Trace.newInstance()
|
||||
val impersonatedActor = Actor(Actor.Id("Mark Dadada"), AuthServiceId("Test"), owningLegalIdentity = BOB_NAME)
|
||||
login(rpcUser.username, rpcUser.password, externalTrace, impersonatedActor)
|
||||
@ -230,8 +230,8 @@ class CordaRPCClientTest : NodeBasedTest(listOf("net.corda.finance"), notaries =
|
||||
// We run the client in a separate process, without the finance module on its system classpath to ensure that the
|
||||
// additional class loader that we give it is used. Cash.State objects are used as they can't be synthesised fully
|
||||
// by the carpenter, and thus avoiding any false-positive results.
|
||||
@Test
|
||||
fun `additional class loader used by WireTransaction when it deserialises its components`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `additional class loader used by WireTransaction when it deserialises its components`() {
|
||||
val financeLocation = Cash::class.java.location.toPath().toString()
|
||||
val classPathWithoutFinance = ProcessUtilities.defaultClassPath.filter { financeLocation !in it }
|
||||
|
||||
|
@ -27,8 +27,8 @@ class FlowsExecutionModeTests : NodeBasedTest(emptyList()) {
|
||||
client = CordaRPCClient(node.node.configuration.rpcOptions.address)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `flows draining mode can be enabled and queried`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `flows draining mode can be enabled and queried`() {
|
||||
asALoggerUser { rpcOps ->
|
||||
val newValue = true
|
||||
rpcOps.setFlowsDrainingModeEnabled(true)
|
||||
@ -39,8 +39,8 @@ class FlowsExecutionModeTests : NodeBasedTest(emptyList()) {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `flows draining mode can be disabled and queried`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `flows draining mode can be disabled and queried`() {
|
||||
asALoggerUser { rpcOps ->
|
||||
rpcOps.setFlowsDrainingModeEnabled(true)
|
||||
val newValue = false
|
||||
@ -52,8 +52,8 @@ class FlowsExecutionModeTests : NodeBasedTest(emptyList()) {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `node starts with flows draining mode disabled`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `node starts with flows draining mode disabled`() {
|
||||
asALoggerUser { rpcOps ->
|
||||
val defaultStartingMode = rpcOps.isFlowsDrainingModeEnabled()
|
||||
|
||||
|
@ -64,8 +64,8 @@ class RPCMultipleInterfacesTests {
|
||||
|
||||
interface ImaginaryFriend : RPCOps
|
||||
|
||||
@Test
|
||||
fun `can talk multiple interfaces`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `can talk multiple interfaces`() {
|
||||
rpcDriver {
|
||||
val server = startRpcServer(listOps = listOf(IntRPCOpsImpl(), StringRPCOpsImpl, MyCordaRpcOpsImpl)).get()
|
||||
|
||||
|
@ -83,8 +83,8 @@ class RPCStabilityTests {
|
||||
}.get()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `client and server dont leak threads`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `client and server dont leak threads`() {
|
||||
fun startAndStop() {
|
||||
rpcDriver {
|
||||
val server = startRpcServer<RPCOps>(ops = DummyOps).get()
|
||||
@ -115,8 +115,8 @@ class RPCStabilityTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `client doesnt leak threads when it fails to start`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `client doesnt leak threads when it fails to start`() {
|
||||
fun startAndStop() {
|
||||
rpcDriver {
|
||||
Try.on { startRpcClient<RPCOps>(NetworkHostAndPort("localhost", 9999)).get() }
|
||||
@ -142,8 +142,8 @@ class RPCStabilityTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `rpc server close doesnt leak broker resources`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `rpc server close doesnt leak broker resources`() {
|
||||
rpcDriver {
|
||||
fun startAndCloseServer(broker: RpcBrokerHandle) {
|
||||
startRpcServerWithBrokerRunning(
|
||||
@ -165,8 +165,8 @@ class RPCStabilityTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `rpc client close doesnt leak broker resources`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `rpc client close doesnt leak broker resources`() {
|
||||
rpcDriver {
|
||||
val server = startRpcServer(configuration = RPCServerConfiguration.DEFAULT, ops = DummyOps).get()
|
||||
RPCClient<RPCOps>(server.broker.hostAndPort!!).start(RPCOps::class.java, rpcTestUser.username, rpcTestUser.password).close()
|
||||
@ -181,8 +181,8 @@ class RPCStabilityTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `rpc server close is idempotent`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `rpc server close is idempotent`() {
|
||||
rpcDriver {
|
||||
val server = startRpcServer(ops = DummyOps).get()
|
||||
repeat(10) {
|
||||
@ -191,8 +191,8 @@ class RPCStabilityTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `rpc client close is idempotent`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `rpc client close is idempotent`() {
|
||||
rpcDriver {
|
||||
val serverShutdown = shutdownManager.follower()
|
||||
val server = startRpcServer(ops = DummyOps).get()
|
||||
@ -215,8 +215,8 @@ class RPCStabilityTests {
|
||||
fun leakObservable(): Observable<Nothing>
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `client cleans up leaked observables`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `client cleans up leaked observables`() {
|
||||
rpcDriver {
|
||||
val leakObservableOpsImpl = object : LeakObservableOps {
|
||||
val leakedUnsubscribedCount = AtomicInteger(0)
|
||||
@ -247,8 +247,8 @@ class RPCStabilityTests {
|
||||
fun ping(): String
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `client reconnects to rebooted server`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `client reconnects to rebooted server`() {
|
||||
rpcDriver {
|
||||
val ops = object : ReconnectOps {
|
||||
override val protocolVersion = 1000
|
||||
@ -274,8 +274,8 @@ class RPCStabilityTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `connection failover fails, rpc calls throw`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `connection failover fails, rpc calls throw`() {
|
||||
rpcDriver {
|
||||
val ops = object : ReconnectOps {
|
||||
override val protocolVersion = 1000
|
||||
@ -301,8 +301,8 @@ class RPCStabilityTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `connection exits when bad config means the exception is unrecoverable`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `connection exits when bad config means the exception is unrecoverable`() {
|
||||
rpcDriver {
|
||||
val ops = object : ReconnectOps {
|
||||
override val protocolVersion = 1000
|
||||
@ -330,8 +330,8 @@ class RPCStabilityTests {
|
||||
fun subscribe(): Observable<Nothing>
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `observables error when connection breaks`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `observables error when connection breaks`() {
|
||||
rpcDriver {
|
||||
val ops = object : NoOps {
|
||||
override val protocolVersion = 1000
|
||||
@ -371,8 +371,8 @@ class RPCStabilityTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `client throws RPCException after initial connection attempt fails`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `client throws RPCException after initial connection attempt fails`() {
|
||||
val client = CordaRPCClient(portAllocation.nextHostAndPort())
|
||||
var exceptionMessage: String? = null
|
||||
try {
|
||||
@ -390,8 +390,8 @@ class RPCStabilityTests {
|
||||
fun serverId(): String
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `client connects to first available server`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `client connects to first available server`() {
|
||||
rpcDriver {
|
||||
val ops = object : ServerOps {
|
||||
override val protocolVersion = 1000
|
||||
@ -411,8 +411,8 @@ class RPCStabilityTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `3 server failover`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `3 server failover`() {
|
||||
rpcDriver {
|
||||
val ops1 = object : ServerOps {
|
||||
override val protocolVersion = 1000
|
||||
@ -483,8 +483,8 @@ class RPCStabilityTests {
|
||||
/**
|
||||
* In this test we create a number of out of process RPC clients that call [TrackSubscriberOps.subscribe] in a loop.
|
||||
*/
|
||||
@Test
|
||||
fun `server cleans up queues after disconnected clients`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `server cleans up queues after disconnected clients`() {
|
||||
rpcDriver {
|
||||
val trackSubscriberOpsImpl = object : TrackSubscriberOps {
|
||||
override val protocolVersion = 1000
|
||||
@ -538,8 +538,8 @@ class RPCStabilityTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore // TODO: This is ignored because Artemis slow consumers are broken. I'm not deleting it in case we can get the feature fixed.
|
||||
@Test(timeout=300_000)
|
||||
@Ignore // TODO: This is ignored because Artemis slow consumers are broken. I'm not deleting it in case we can get the feature fixed.
|
||||
fun `slow consumers are kicked`() {
|
||||
rpcDriver {
|
||||
val server = startRpcServer(maxBufferedBytesPerClient = 10 * 1024 * 1024, ops = SlowConsumerRPCOpsImpl()).get()
|
||||
@ -576,8 +576,8 @@ class RPCStabilityTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `deduplication in the server`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `deduplication in the server`() {
|
||||
rpcDriver {
|
||||
val server = startRpcServer(ops = SlowConsumerRPCOpsImpl()).getOrThrow()
|
||||
|
||||
@ -617,8 +617,8 @@ class RPCStabilityTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `deduplication in the client`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `deduplication in the client`() {
|
||||
rpcDriver {
|
||||
val broker = startRpcBroker().getOrThrow()
|
||||
|
||||
|
@ -28,8 +28,8 @@ import java.io.NotSerializableException
|
||||
|
||||
class RpcCustomSerializersTest {
|
||||
|
||||
@Test
|
||||
fun `when custom serializers are not provided, the classpath is scanned to identify any existing ones`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `when custom serializers are not provided, the classpath is scanned to identify any existing ones`() {
|
||||
driver(DriverParameters(startNodesInProcess = true, cordappsForAllNodes = listOf(enclosedCordapp()))) {
|
||||
val server = startNode(providedName = ALICE_NAME).get()
|
||||
|
||||
@ -43,8 +43,8 @@ class RpcCustomSerializersTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `when an empty set of custom serializers is provided, no scanning is performed and this empty set is used instead`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `when an empty set of custom serializers is provided, no scanning is performed and this empty set is used instead`() {
|
||||
driver(DriverParameters(startNodesInProcess = true, cordappsForAllNodes = listOf(enclosedCordapp()))) {
|
||||
val server = startNode(providedName = ALICE_NAME).get()
|
||||
|
||||
@ -57,8 +57,8 @@ class RpcCustomSerializersTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `when a set of custom serializers is explicitly provided, these are used instead of scanning the classpath`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `when a set of custom serializers is explicitly provided, these are used instead of scanning the classpath`() {
|
||||
driver(DriverParameters(startNodesInProcess = true, cordappsForAllNodes = emptyList())) {
|
||||
val server = startNode(providedName = ALICE_NAME).get()
|
||||
|
||||
|
@ -48,7 +48,7 @@ class CordaRPCClientReconnectionTest {
|
||||
val rpcUser = User("user1", "test", permissions = setOf(Permissions.all()))
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test(timeout=300_000)
|
||||
fun `rpc client calls and returned observables continue working when the server crashes and restarts`() {
|
||||
driver(DriverParameters(cordappsForAllNodes = FINANCE_CORDAPPS)) {
|
||||
val latch = CountDownLatch(2)
|
||||
@ -86,7 +86,7 @@ class CordaRPCClientReconnectionTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test(timeout=300_000)
|
||||
fun `a client can successfully unsubscribe a reconnecting observable`() {
|
||||
driver(DriverParameters(cordappsForAllNodes = FINANCE_CORDAPPS)) {
|
||||
val latch = CountDownLatch(2)
|
||||
@ -124,7 +124,7 @@ class CordaRPCClientReconnectionTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test(timeout=300_000)
|
||||
fun `rpc client calls and returned observables continue working when there is failover between servers`() {
|
||||
driver(DriverParameters(cordappsForAllNodes = FINANCE_CORDAPPS)) {
|
||||
val latch = CountDownLatch(2)
|
||||
@ -163,7 +163,7 @@ class CordaRPCClientReconnectionTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test(timeout=300_000)
|
||||
fun `an RPC call fails, when the maximum number of attempts is exceeded`() {
|
||||
driver(DriverParameters(cordappsForAllNodes = emptyList())) {
|
||||
val address = NetworkHostAndPort("localhost", portAllocator.nextPort())
|
||||
@ -191,7 +191,7 @@ class CordaRPCClientReconnectionTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test(timeout = 60_000)
|
||||
@Test(timeout=300_000)
|
||||
fun `establishing an RPC connection fails if there is no node listening to the specified address`() {
|
||||
rpcDriver {
|
||||
assertThatThrownBy {
|
||||
@ -202,7 +202,7 @@ class CordaRPCClientReconnectionTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test(timeout = 120_000)
|
||||
@Test(timeout=300_000)
|
||||
fun `RPC connection can be shut down after being disconnected from the node`() {
|
||||
driver(DriverParameters(cordappsForAllNodes = emptyList())) {
|
||||
val address = NetworkHostAndPort("localhost", portAllocator.nextPort())
|
||||
@ -232,7 +232,7 @@ class CordaRPCClientReconnectionTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test(timeout=300_000)
|
||||
fun `RPC connection stops reconnecting after config number of retries`() {
|
||||
driver(DriverParameters(cordappsForAllNodes = emptyList())) {
|
||||
val address = NetworkHostAndPort("localhost", portAllocator.nextPort())
|
||||
|
@ -92,8 +92,8 @@ class StandaloneCordaRPClientTest {
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
fun `test attachments`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `test attachments`() {
|
||||
val attachment = InputStreamAndHash.createInMemoryTestZip(attachmentSize, 1)
|
||||
assertFalse(rpcProxy.attachmentExists(attachment.sha256))
|
||||
val id = attachment.inputStream.use { rpcProxy.uploadAttachment(it) }
|
||||
@ -107,8 +107,8 @@ class StandaloneCordaRPClientTest {
|
||||
}
|
||||
|
||||
@Ignore("CORDA-1520 - After switching from Kryo to AMQP this test won't work")
|
||||
@Test
|
||||
fun `test wrapped attachments`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `test wrapped attachments`() {
|
||||
val attachment = InputStreamAndHash.createInMemoryTestZip(attachmentSize, 1)
|
||||
assertFalse(rpcProxy.attachmentExists(attachment.sha256))
|
||||
val id = WrapperStream(attachment.inputStream).use { rpcProxy.uploadAttachment(it) }
|
||||
@ -121,14 +121,14 @@ class StandaloneCordaRPClientTest {
|
||||
assertEquals(attachment.sha256, hash)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `test starting flow`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `test starting flow`() {
|
||||
rpcProxy.startFlow(::CashIssueFlow, 127.POUNDS, OpaqueBytes.of(0), notaryNodeIdentity)
|
||||
.returnValue.getOrThrow(timeout)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `test starting tracked flow`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `test starting tracked flow`() {
|
||||
var trackCount = 0
|
||||
val handle = rpcProxy.startTrackedFlow(
|
||||
::CashIssueFlow, 429.DOLLARS, OpaqueBytes.of(0), notaryNodeIdentity
|
||||
@ -144,13 +144,13 @@ class StandaloneCordaRPClientTest {
|
||||
assertNotEquals(0, trackCount)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `test network map`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `test network map`() {
|
||||
assertEquals(notaryConfig.legalName, notaryNodeIdentity.name)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `test state machines`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `test state machines`() {
|
||||
val (stateMachines, updates) = rpcProxy.stateMachinesFeed()
|
||||
assertEquals(0, stateMachines.size)
|
||||
|
||||
@ -171,8 +171,8 @@ class StandaloneCordaRPClientTest {
|
||||
assertEquals(1, updateCount.get())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `test vault track by`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `test vault track by`() {
|
||||
val (vault, vaultUpdates) = rpcProxy.vaultTrackBy<Cash.State>(paging = PageSpecification(DEFAULT_PAGE_NUM))
|
||||
assertEquals(0, vault.totalStatesAvailable)
|
||||
|
||||
@ -194,8 +194,8 @@ class StandaloneCordaRPClientTest {
|
||||
assertEquals(629.POUNDS, cashBalance[Currency.getInstance("GBP")])
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `test vault query by`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `test vault query by`() {
|
||||
// Now issue some cash
|
||||
rpcProxy.startFlow(::CashIssueFlow, 629.POUNDS, OpaqueBytes.of(0), notaryNodeIdentity)
|
||||
.returnValue.getOrThrow(timeout)
|
||||
@ -220,8 +220,8 @@ class StandaloneCordaRPClientTest {
|
||||
assertEquals(629.POUNDS, cashBalances[Currency.getInstance("GBP")])
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `test cash balances`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `test cash balances`() {
|
||||
val startCash = rpcProxy.getCashBalances()
|
||||
println(startCash)
|
||||
assertTrue(startCash.isEmpty(), "Should not start with any cash")
|
||||
@ -235,8 +235,8 @@ class StandaloneCordaRPClientTest {
|
||||
assertEquals(629.DOLLARS, balance)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `test kill flow without killFlow permission`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `test kill flow without killFlow permission`() {
|
||||
exception.expect(PermissionException::class.java)
|
||||
exception.expectMessage("User not authorized to perform RPC call killFlow")
|
||||
|
||||
@ -247,8 +247,8 @@ class StandaloneCordaRPClientTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `test kill flow with killFlow permission`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `test kill flow with killFlow permission`() {
|
||||
val flowHandle = rpcProxy.startFlow(::CashIssueFlow, 83.DOLLARS, OpaqueBytes.of(0), notaryNodeIdentity)
|
||||
notary.connect(rpcUser).use { connection ->
|
||||
val rpcProxy = connection.proxy
|
||||
|
@ -72,8 +72,8 @@ class ClientRPCInfrastructureTests : AbstractRPCTest() {
|
||||
override fun captureUser(): String = rpcContext().invocation.principal().name
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `simple RPCs`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `simple RPCs`() {
|
||||
rpcDriver {
|
||||
val proxy = testProxy()
|
||||
// Does nothing, doesn't throw.
|
||||
@ -88,8 +88,8 @@ class ClientRPCInfrastructureTests : AbstractRPCTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `simple observable`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `simple observable`() {
|
||||
rpcDriver {
|
||||
val proxy = testProxy()
|
||||
// This tests that the observations are transmitted correctly, also completion is transmitted.
|
||||
@ -98,8 +98,8 @@ class ClientRPCInfrastructureTests : AbstractRPCTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `complex observables`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `complex observables`() {
|
||||
rpcDriver {
|
||||
val proxy = testProxy()
|
||||
// This checks that we can return an object graph with complex usage of observables, like an observable
|
||||
@ -143,8 +143,8 @@ class ClientRPCInfrastructureTests : AbstractRPCTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `simple ListenableFuture`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `simple ListenableFuture`() {
|
||||
rpcDriver {
|
||||
val proxy = testProxy()
|
||||
val value = proxy.makeListenableFuture().getOrThrow()
|
||||
@ -152,8 +152,8 @@ class ClientRPCInfrastructureTests : AbstractRPCTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `complex ListenableFuture`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `complex ListenableFuture`() {
|
||||
rpcDriver {
|
||||
val proxy = testProxy()
|
||||
val serverQuote = openFuture<Pair<String, CordaFuture<String>>>()
|
||||
@ -180,16 +180,16 @@ class ClientRPCInfrastructureTests : AbstractRPCTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun versioning() {
|
||||
@Test(timeout=300_000)
|
||||
fun versioning() {
|
||||
rpcDriver {
|
||||
val proxy = testProxy()
|
||||
assertFailsWith<UnsupportedOperationException> { proxy.addedLater() }
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `authenticated user is available to RPC`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `authenticated user is available to RPC`() {
|
||||
rpcDriver {
|
||||
val proxy = testProxy()
|
||||
assertThat(proxy.captureUser()).isEqualTo(rpcTestUser.username)
|
||||
|
@ -104,8 +104,8 @@ class RPCConcurrencyTests : AbstractRPCTest() {
|
||||
pool.shutdown()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `call multiple RPCs in parallel`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `call multiple RPCs in parallel`() {
|
||||
rpcDriver {
|
||||
val proxy = testProxy()
|
||||
val numberOfBlockedCalls = 2
|
||||
@ -140,8 +140,8 @@ class RPCConcurrencyTests : AbstractRPCTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `nested immediate observables sequence correctly`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `nested immediate observables sequence correctly`() {
|
||||
rpcDriver {
|
||||
// We construct a rose tree of immediate Observables and check that parent observations arrive before children.
|
||||
val proxy = testProxy()
|
||||
@ -164,8 +164,8 @@ class RPCConcurrencyTests : AbstractRPCTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `parallel nested observables`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `parallel nested observables`() {
|
||||
rpcDriver {
|
||||
val proxy = testProxy()
|
||||
val treeDepth = 2
|
||||
|
@ -46,28 +46,28 @@ class RPCFailureTests {
|
||||
proc(startRpcClient<Ops>(server.broker.hostAndPort!!).getOrThrow())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `kotlin NPE`() = rpc {
|
||||
@Test(timeout=300_000)
|
||||
fun `kotlin NPE`() = rpc {
|
||||
assertThatThrownBy { it.kotlinNPE() }.isInstanceOf(CordaRuntimeException::class.java)
|
||||
.hasMessageContaining("kotlin.KotlinNullPointerException")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `kotlin NPE async`() = rpc {
|
||||
@Test(timeout=300_000)
|
||||
fun `kotlin NPE async`() = rpc {
|
||||
val future = it.kotlinNPEAsync()
|
||||
assertThatThrownBy { future.getOrThrow() }.isInstanceOf(CordaRuntimeException::class.java)
|
||||
.hasMessageContaining("kotlin.KotlinNullPointerException")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun unserializable() = rpc {
|
||||
@Test(timeout=300_000)
|
||||
fun unserializable() = rpc {
|
||||
assertThatThrownBy { it.getUnserializable() }.isInstanceOf(CordaRuntimeException::class.java)
|
||||
.hasMessageContaining("java.io.NotSerializableException:")
|
||||
.hasMessageContaining("Unserializable\" is not on the whitelist or annotated with @CordaSerializable.")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `unserializable async`() = rpc {
|
||||
@Test(timeout=300_000)
|
||||
fun `unserializable async`() = rpc {
|
||||
val future = it.getUnserializableAsync()
|
||||
assertThatThrownBy { future.getOrThrow() }.isInstanceOf(CordaRuntimeException::class.java)
|
||||
.hasMessageContaining("java.io.NotSerializableException:")
|
||||
|
@ -29,8 +29,8 @@ class RPCHighThroughputObservableTests : AbstractRPCTest() {
|
||||
override fun makeObservable(): Observable<Int> = Observable.interval(0, TimeUnit.MICROSECONDS).map { it.toInt() + 1 }
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `simple observable`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `simple observable`() {
|
||||
rpcDriver {
|
||||
val proxy = testProxy()
|
||||
// This tests that the observations are transmitted correctly, also check that server side doesn't try to serialize the whole lot
|
||||
|
@ -76,8 +76,8 @@ class RPCPerformanceTests : AbstractRPCTest() {
|
||||
val Mbps: Double
|
||||
)
|
||||
|
||||
@Test
|
||||
fun `measure Megabytes per second for simple RPCs`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `measure Megabytes per second for simple RPCs`() {
|
||||
warmup()
|
||||
val inputOutputSizes = listOf(1024, 4096, 100 * 1024)
|
||||
val overallTraffic = 512 * 1024 * 1024L
|
||||
@ -118,8 +118,8 @@ class RPCPerformanceTests : AbstractRPCTest() {
|
||||
/**
|
||||
* Runs 20k RPCs per second for two minutes and publishes relevant stats to JMX.
|
||||
*/
|
||||
@Test
|
||||
fun `consumption rate`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `consumption rate`() {
|
||||
rpcDriver {
|
||||
val metricRegistry = startReporter(shutdownManager)
|
||||
val proxy = testProxy(
|
||||
@ -148,8 +148,8 @@ class RPCPerformanceTests : AbstractRPCTest() {
|
||||
val Mbps: Double
|
||||
)
|
||||
|
||||
@Test
|
||||
fun `big messages`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `big messages`() {
|
||||
warmup()
|
||||
measure(listOf(1)) { clientParallelism ->
|
||||
// TODO this hangs with more parallelism
|
||||
|
@ -46,8 +46,8 @@ class RPCPermissionsTests : AbstractRPCTest() {
|
||||
|
||||
private fun userOf(name: String, permissions: Set<String>) = User(name, "password", permissions)
|
||||
|
||||
@Test
|
||||
fun `empty user cannot use any flows`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `empty user cannot use any flows`() {
|
||||
rpcDriver {
|
||||
val emptyUser = userOf("empty", emptySet())
|
||||
val proxy = testProxyFor(emptyUser)
|
||||
@ -57,8 +57,8 @@ class RPCPermissionsTests : AbstractRPCTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `admin user can use any flow`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `admin user can use any flow`() {
|
||||
rpcDriver {
|
||||
val adminUser = userOf("admin", setOf(ALL_ALLOWED))
|
||||
val proxy = testProxyFor(adminUser)
|
||||
@ -67,8 +67,8 @@ class RPCPermissionsTests : AbstractRPCTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `joe user is allowed to use DummyFlow`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `joe user is allowed to use DummyFlow`() {
|
||||
rpcDriver {
|
||||
val joeUser = userOf("joe", setOf(DUMMY_FLOW))
|
||||
val proxy = testProxyFor(joeUser)
|
||||
@ -77,8 +77,8 @@ class RPCPermissionsTests : AbstractRPCTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `joe user is not allowed to use OtherFlow`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `joe user is not allowed to use OtherFlow`() {
|
||||
rpcDriver {
|
||||
val joeUser = userOf("joe", setOf(DUMMY_FLOW))
|
||||
val proxy = testProxyFor(joeUser)
|
||||
@ -91,8 +91,8 @@ class RPCPermissionsTests : AbstractRPCTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `joe user is not allowed to call other RPC methods`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `joe user is not allowed to call other RPC methods`() {
|
||||
rpcDriver {
|
||||
val joeUser = userOf("joe", setOf(DUMMY_FLOW))
|
||||
val proxy = testProxyFor(joeUser)
|
||||
@ -105,8 +105,8 @@ class RPCPermissionsTests : AbstractRPCTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `joe user can call different methods matching to a wildcard`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `joe user can call different methods matching to a wildcard`() {
|
||||
rpcDriver {
|
||||
val joeUser = userOf("joe", setOf(WILDCARD_FLOW))
|
||||
val proxy = testProxyFor(joeUser)
|
||||
@ -128,8 +128,8 @@ class RPCPermissionsTests : AbstractRPCTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `checking invokeRpc permissions entitlements`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `checking invokeRpc permissions entitlements`() {
|
||||
rpcDriver {
|
||||
val joeUser = userOf("joe", setOf("InvokeRpc.networkMapFeed"))
|
||||
val proxy = testProxyFor(joeUser)
|
||||
|
@ -8,8 +8,8 @@ import java.util.concurrent.atomic.AtomicLong
|
||||
|
||||
class PropertyTest {
|
||||
|
||||
@Test
|
||||
fun present_value_with_correct_type() {
|
||||
@Test(timeout=300_000)
|
||||
fun present_value_with_correct_type() {
|
||||
|
||||
val key = "a.b.c"
|
||||
val value = 1L
|
||||
@ -25,8 +25,8 @@ class PropertyTest {
|
||||
assertThat(configuration[property]).isEqualTo(value)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun present_value_with_wrong_type() {
|
||||
@Test(timeout=300_000)
|
||||
fun present_value_with_wrong_type() {
|
||||
|
||||
val key = "a.b.c"
|
||||
val value = 1
|
||||
@ -41,8 +41,8 @@ class PropertyTest {
|
||||
assertThatThrownBy { property.valueIn(configuration) }.isInstanceOf(ConfigException.WrongType::class.java)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun present_value_of_list_type() {
|
||||
@Test(timeout=300_000)
|
||||
fun present_value_of_list_type() {
|
||||
|
||||
val key = "a.b.c"
|
||||
val value = listOf(1L, 2L, 3L)
|
||||
@ -57,8 +57,8 @@ class PropertyTest {
|
||||
assertThat(property.valueIn(configuration)).isEqualTo(value)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun present_value_of_list_type_with_whole_list_mapping() {
|
||||
@Test(timeout=300_000)
|
||||
fun present_value_of_list_type_with_whole_list_mapping() {
|
||||
|
||||
val key = "a.b.c"
|
||||
val value = listOf(1L, 3L, 2L)
|
||||
@ -73,8 +73,8 @@ class PropertyTest {
|
||||
assertThat(property.valueIn(configuration)).isEqualTo(value.max())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun absent_value_of_list_type_with_whole_list_mapping() {
|
||||
@Test(timeout=300_000)
|
||||
fun absent_value_of_list_type_with_whole_list_mapping() {
|
||||
|
||||
val key = "a.b.c"
|
||||
val configuration = configObject().toConfig()
|
||||
@ -88,8 +88,8 @@ class PropertyTest {
|
||||
assertThat(property.valueIn(configuration)).isEqualTo(null)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun present_value_of_list_type_with_single_element_and_whole_list_mapping() {
|
||||
@Test(timeout=300_000)
|
||||
fun present_value_of_list_type_with_single_element_and_whole_list_mapping() {
|
||||
|
||||
val key = "a.b.c"
|
||||
val value = listOf(1L, 3L, 2L)
|
||||
@ -104,8 +104,8 @@ class PropertyTest {
|
||||
assertThat(property.valueIn(configuration)).isEqualTo(value.max())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun absent_value_of_list_type_with_single_element_and_whole_list_mapping() {
|
||||
@Test(timeout=300_000)
|
||||
fun absent_value_of_list_type_with_single_element_and_whole_list_mapping() {
|
||||
|
||||
val key = "a.b.c"
|
||||
val configuration = configObject().toConfig()
|
||||
@ -119,8 +119,8 @@ class PropertyTest {
|
||||
assertThat(property.valueIn(configuration)).isEqualTo(null)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun optional_present_value_of_list_type() {
|
||||
@Test(timeout=300_000)
|
||||
fun optional_present_value_of_list_type() {
|
||||
|
||||
val key = "a.b.c"
|
||||
val value = listOf(1L, 2L, 3L)
|
||||
@ -135,8 +135,8 @@ class PropertyTest {
|
||||
assertThat(property.valueIn(configuration)).isEqualTo(value)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun optional_absent_value_of_list_type() {
|
||||
@Test(timeout=300_000)
|
||||
fun optional_absent_value_of_list_type() {
|
||||
|
||||
val key = "a.b.c"
|
||||
val configuration = configObject(key to null).toConfig()
|
||||
@ -151,8 +151,8 @@ class PropertyTest {
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
fun optional_absent_value_of_list_type_with_default_value() {
|
||||
@Test(timeout=300_000)
|
||||
fun optional_absent_value_of_list_type_with_default_value() {
|
||||
|
||||
val key = "a.b.c"
|
||||
val configuration = configObject(key to null).toConfig()
|
||||
@ -167,8 +167,8 @@ class PropertyTest {
|
||||
assertThat(property.valueIn(configuration)).isEqualTo(defaultValue)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun absent_value() {
|
||||
@Test(timeout=300_000)
|
||||
fun absent_value() {
|
||||
|
||||
val key = "a.b.c"
|
||||
val configuration = configObject(key to null).toConfig()
|
||||
@ -182,8 +182,8 @@ class PropertyTest {
|
||||
assertThatThrownBy { property.valueIn(configuration) }.isInstanceOf(ConfigException.Missing::class.java)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun optional_present_value_with_correct_type() {
|
||||
@Test(timeout=300_000)
|
||||
fun optional_present_value_with_correct_type() {
|
||||
|
||||
val key = "a.b.c"
|
||||
val value = 1L
|
||||
@ -198,8 +198,8 @@ class PropertyTest {
|
||||
assertThat(property.valueIn(configuration)).isEqualTo(value)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun optional_present_value_with_wrong_type() {
|
||||
@Test(timeout=300_000)
|
||||
fun optional_present_value_with_wrong_type() {
|
||||
|
||||
val key = "a.b.c"
|
||||
val value = 1
|
||||
@ -214,8 +214,8 @@ class PropertyTest {
|
||||
assertThatThrownBy { property.valueIn(configuration) }.isInstanceOf(ConfigException.WrongType::class.java)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun optional_absent_value() {
|
||||
@Test(timeout=300_000)
|
||||
fun optional_absent_value() {
|
||||
|
||||
val key = "a.b.c"
|
||||
val configuration = configObject(key to null).toConfig()
|
||||
@ -229,8 +229,8 @@ class PropertyTest {
|
||||
assertThat(property.valueIn(configuration)).isNull()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun optional_absent_with_default_value() {
|
||||
@Test(timeout=300_000)
|
||||
fun optional_absent_with_default_value() {
|
||||
|
||||
val key = "a.b.c"
|
||||
val configuration = configObject(key to null).toConfig()
|
||||
|
@ -7,8 +7,8 @@ import org.junit.Test
|
||||
|
||||
class PropertyValidationTest {
|
||||
|
||||
@Test
|
||||
fun absent_value() {
|
||||
@Test(timeout=300_000)
|
||||
fun absent_value() {
|
||||
|
||||
val key = "a.b.c"
|
||||
val configuration = configObject().toConfig()
|
||||
@ -26,8 +26,8 @@ class PropertyValidationTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun missing_value() {
|
||||
@Test(timeout=300_000)
|
||||
fun missing_value() {
|
||||
|
||||
val key = "a.b.c"
|
||||
val configuration = configObject(key to null).toConfig()
|
||||
@ -45,8 +45,8 @@ class PropertyValidationTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun absent_list_value() {
|
||||
@Test(timeout=300_000)
|
||||
fun absent_list_value() {
|
||||
|
||||
val key = "a.b.c"
|
||||
val configuration = configObject().toConfig()
|
||||
@ -64,8 +64,8 @@ class PropertyValidationTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun missing_list_value() {
|
||||
@Test(timeout=300_000)
|
||||
fun missing_list_value() {
|
||||
|
||||
val key = "a.b.c"
|
||||
val configuration = configObject(key to null).toConfig()
|
||||
@ -83,8 +83,8 @@ class PropertyValidationTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun whole_list_validation_valid_value() {
|
||||
@Test(timeout=300_000)
|
||||
fun whole_list_validation_valid_value() {
|
||||
|
||||
val key = "a.b.c"
|
||||
val value = listOf(1L, 2L, 3L)
|
||||
@ -97,8 +97,8 @@ class PropertyValidationTest {
|
||||
assertThat(property.validate(configuration).errors).isEmpty()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun whole_list_validation_invalid_value() {
|
||||
@Test(timeout=300_000)
|
||||
fun whole_list_validation_invalid_value() {
|
||||
|
||||
val key = "a.b.c"
|
||||
val value = listOf(1L, 2L, 3L)
|
||||
@ -125,8 +125,8 @@ class PropertyValidationTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun wrong_type() {
|
||||
@Test(timeout=300_000)
|
||||
fun wrong_type() {
|
||||
|
||||
val key = "a.b.c"
|
||||
|
||||
@ -145,8 +145,8 @@ class PropertyValidationTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun wrong_floating_numeric_type_when_integer_expected() {
|
||||
@Test(timeout=300_000)
|
||||
fun wrong_floating_numeric_type_when_integer_expected() {
|
||||
|
||||
val key = "a.b.c"
|
||||
|
||||
@ -165,8 +165,8 @@ class PropertyValidationTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun integer_numeric_type_when_floating_expected_works() {
|
||||
@Test(timeout=300_000)
|
||||
fun integer_numeric_type_when_floating_expected_works() {
|
||||
|
||||
val key = "a.b.c"
|
||||
|
||||
@ -177,8 +177,8 @@ class PropertyValidationTest {
|
||||
assertThat(property.validate(configuration).isValid).isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun wrong_element_type_for_list() {
|
||||
@Test(timeout=300_000)
|
||||
fun wrong_element_type_for_list() {
|
||||
|
||||
val key = "a.b.c"
|
||||
|
||||
@ -197,8 +197,8 @@ class PropertyValidationTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun list_type_when_declared_single() {
|
||||
@Test(timeout=300_000)
|
||||
fun list_type_when_declared_single() {
|
||||
|
||||
val key = "a.b.c"
|
||||
|
||||
@ -217,8 +217,8 @@ class PropertyValidationTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun single_type_when_declared_list() {
|
||||
@Test(timeout=300_000)
|
||||
fun single_type_when_declared_list() {
|
||||
|
||||
val key = "a.b.c"
|
||||
|
||||
@ -237,8 +237,8 @@ class PropertyValidationTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun wrong_type_in_nested_property() {
|
||||
@Test(timeout=300_000)
|
||||
fun wrong_type_in_nested_property() {
|
||||
|
||||
val key = "a.b.c"
|
||||
|
||||
@ -260,8 +260,8 @@ class PropertyValidationTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun absent_value_in_nested_property() {
|
||||
@Test(timeout=300_000)
|
||||
fun absent_value_in_nested_property() {
|
||||
|
||||
val key = "a.b.c"
|
||||
|
||||
@ -283,8 +283,8 @@ class PropertyValidationTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun missing_value_in_nested_property() {
|
||||
@Test(timeout=300_000)
|
||||
fun missing_value_in_nested_property() {
|
||||
|
||||
val key = "a.b.c"
|
||||
|
||||
@ -306,8 +306,8 @@ class PropertyValidationTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun nested_property_without_schema_does_not_validate() {
|
||||
@Test(timeout=300_000)
|
||||
fun nested_property_without_schema_does_not_validate() {
|
||||
|
||||
val key = "a.b.c"
|
||||
|
||||
@ -320,8 +320,8 @@ class PropertyValidationTest {
|
||||
assertThat(property.validate(configuration).isValid).isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun valid_mapped_property() {
|
||||
@Test(timeout=300_000)
|
||||
fun valid_mapped_property() {
|
||||
|
||||
val key = "a"
|
||||
|
||||
@ -336,8 +336,8 @@ class PropertyValidationTest {
|
||||
assertThat(property.validate(configuration).isValid).isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun invalid_mapped_property() {
|
||||
@Test(timeout=300_000)
|
||||
fun invalid_mapped_property() {
|
||||
|
||||
val key = "a.b.c"
|
||||
|
||||
|
@ -7,8 +7,8 @@ import org.junit.Test
|
||||
|
||||
class SchemaTest {
|
||||
|
||||
@Test
|
||||
fun validation_with_nested_properties() {
|
||||
@Test(timeout=300_000)
|
||||
fun validation_with_nested_properties() {
|
||||
|
||||
val prop1 = "prop1"
|
||||
val prop1Value = "value1"
|
||||
@ -35,8 +35,8 @@ class SchemaTest {
|
||||
assertThat(result.isValid).isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun validation_with_unknown_properties() {
|
||||
@Test(timeout=300_000)
|
||||
fun validation_with_unknown_properties() {
|
||||
|
||||
val prop1 = "prop1"
|
||||
val prop1Value = "value1"
|
||||
@ -74,8 +74,8 @@ class SchemaTest {
|
||||
assertThat(errorsWithDefaultOptions).isEmpty()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun validation_with_unknown_properties_non_strict() {
|
||||
@Test(timeout=300_000)
|
||||
fun validation_with_unknown_properties_non_strict() {
|
||||
|
||||
val prop1 = "prop1"
|
||||
val prop1Value = "value1"
|
||||
@ -103,8 +103,8 @@ class SchemaTest {
|
||||
assertThat(result.isValid).isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun validation_with_wrong_nested_properties() {
|
||||
@Test(timeout=300_000)
|
||||
fun validation_with_wrong_nested_properties() {
|
||||
|
||||
val prop1 = "prop1"
|
||||
val prop1Value = "value1"
|
||||
@ -133,8 +133,8 @@ class SchemaTest {
|
||||
assertThat(errors).hasSize(2)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun describe_with_nested_properties_does_not_show_sensitive_values() {
|
||||
@Test(timeout=300_000)
|
||||
fun describe_with_nested_properties_does_not_show_sensitive_values() {
|
||||
|
||||
val prop1 = "prop1"
|
||||
val prop1Value = "value1"
|
||||
@ -164,8 +164,8 @@ class SchemaTest {
|
||||
assertThat(description).doesNotContain(prop5Value)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun describe_with_nested_properties_list_does_not_show_sensitive_values() {
|
||||
@Test(timeout=300_000)
|
||||
fun describe_with_nested_properties_list_does_not_show_sensitive_values() {
|
||||
|
||||
val prop1 = "prop1"
|
||||
val prop1Value = "value1"
|
||||
|
@ -30,8 +30,8 @@ class SpecificationTest {
|
||||
override fun parseValid(configuration: Config) = valid<RpcSettings>(RpcSettingsImpl(configuration[addresses], configuration[useSsl]))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun parse() {
|
||||
@Test(timeout=300_000)
|
||||
fun parse() {
|
||||
|
||||
val useSslValue = true
|
||||
val principalAddressValue = Address("localhost", 8080)
|
||||
@ -53,8 +53,8 @@ class SpecificationTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun parse_list_aggregation() {
|
||||
@Test(timeout=300_000)
|
||||
fun parse_list_aggregation() {
|
||||
|
||||
val spec = object : Configuration.Specification<AtomicLong>("AtomicLong") {
|
||||
|
||||
@ -75,8 +75,8 @@ class SpecificationTest {
|
||||
assertThat(result.value().get()).isEqualTo(elements.max())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun validate() {
|
||||
@Test(timeout=300_000)
|
||||
fun validate() {
|
||||
|
||||
val principalAddressValue = Address("localhost", 8080)
|
||||
val adminAddressValue = Address("127.0.0.1", 8081)
|
||||
@ -93,8 +93,8 @@ class SpecificationTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun validate_list_aggregation() {
|
||||
@Test(timeout=300_000)
|
||||
fun validate_list_aggregation() {
|
||||
|
||||
fun parseMax(elements: List<Long>): Valid<Long> {
|
||||
|
||||
@ -130,8 +130,8 @@ class SpecificationTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun validate_with_domain_specific_errors() {
|
||||
@Test(timeout=300_000)
|
||||
fun validate_with_domain_specific_errors() {
|
||||
|
||||
val useSslValue = true
|
||||
val principalAddressValue = Address("localhost", 8080)
|
||||
@ -151,8 +151,8 @@ class SpecificationTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun chained_delegated_properties_are_not_added_multiple_times() {
|
||||
@Test(timeout=300_000)
|
||||
fun chained_delegated_properties_are_not_added_multiple_times() {
|
||||
|
||||
val spec = object : Configuration.Specification<List<String>?>("Test") {
|
||||
|
||||
|
@ -6,8 +6,8 @@ import org.junit.Test
|
||||
|
||||
class UtilsTest {
|
||||
|
||||
@Test
|
||||
fun serialize_deserialize_configuration() {
|
||||
@Test(timeout=300_000)
|
||||
fun serialize_deserialize_configuration() {
|
||||
|
||||
var rawConfiguration = ConfigFactory.empty()
|
||||
|
||||
|
@ -12,8 +12,8 @@ class VersionExtractorTest {
|
||||
private val versionExtractor = Configuration.Version.Extractor.fromPath("configuration.metadata.version")
|
||||
private val extractVersion: (Config) -> Valid<Int> = { config -> versionExtractor.parse(config) }
|
||||
|
||||
@Test
|
||||
fun version_header_extraction_present() {
|
||||
@Test(timeout=300_000)
|
||||
fun version_header_extraction_present() {
|
||||
|
||||
val versionValue = Configuration.Version.Extractor.DEFAULT_VERSION_VALUE + 1
|
||||
val rawConfiguration = configObject("configuration" to configObject("metadata" to configObject("version" to versionValue), "node" to configObject("p2pAddress" to "localhost:8080"))).toConfig()
|
||||
@ -22,8 +22,8 @@ class VersionExtractorTest {
|
||||
assertThat(version).isEqualTo(versionValue)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun version_header_extraction_no_metadata() {
|
||||
@Test(timeout=300_000)
|
||||
fun version_header_extraction_no_metadata() {
|
||||
|
||||
val rawConfiguration = configObject("configuration" to configObject("node" to configObject("p2pAddress" to "localhost:8080"))).toConfig()
|
||||
|
||||
@ -31,8 +31,8 @@ class VersionExtractorTest {
|
||||
assertThat(version).isEqualTo(Configuration.Version.Extractor.DEFAULT_VERSION_VALUE)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun version_header_extraction_no_key() {
|
||||
@Test(timeout=300_000)
|
||||
fun version_header_extraction_no_key() {
|
||||
|
||||
val rawConfiguration = configObject("configuration" to configObject("metadata" to configObject(), "node" to configObject("p2pAddress" to "localhost:8080"))).toConfig()
|
||||
|
||||
@ -41,8 +41,8 @@ class VersionExtractorTest {
|
||||
assertThat(version).isEqualTo(Configuration.Version.Extractor.DEFAULT_VERSION_VALUE)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun version_header_extraction_no_value() {
|
||||
@Test(timeout=300_000)
|
||||
fun version_header_extraction_no_value() {
|
||||
|
||||
val rawConfiguration = configObject("configuration" to configObject("metadata" to configObject("version" to null), "node" to configObject("p2pAddress" to "localhost:8080"))).toConfig()
|
||||
|
||||
@ -51,8 +51,8 @@ class VersionExtractorTest {
|
||||
assertThat(version).isEqualTo(Configuration.Version.Extractor.DEFAULT_VERSION_VALUE)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun version_header_extraction_no_configuration() {
|
||||
@Test(timeout=300_000)
|
||||
fun version_header_extraction_no_configuration() {
|
||||
|
||||
val rawConfiguration = configObject().toConfig()
|
||||
|
||||
|
@ -9,8 +9,8 @@ import org.junit.Test
|
||||
|
||||
class VersionedParsingExampleTest {
|
||||
|
||||
@Test
|
||||
fun correct_parsing_function_is_used_for_present_version() {
|
||||
@Test(timeout=300_000)
|
||||
fun correct_parsing_function_is_used_for_present_version() {
|
||||
|
||||
val versionParser = Configuration.Version.Extractor.fromPath("configuration.metadata.version")
|
||||
val extractVersion: (Config) -> Valid<Int> = { config -> versionParser.parseRequired(config) }
|
||||
@ -31,8 +31,8 @@ class VersionedParsingExampleTest {
|
||||
assertResult(rpcSettingsFromVersion2Conf, principalAddressValue, adminAddressValue)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun default_value_is_used_for_absent_version() {
|
||||
@Test(timeout=300_000)
|
||||
fun default_value_is_used_for_absent_version() {
|
||||
|
||||
val defaultVersion = 2
|
||||
val versionParser = Configuration.Version.Extractor.fromPath("configuration.metadata.version", defaultVersion)
|
||||
|
@ -46,8 +46,8 @@ class IdentitySyncFlowTests {
|
||||
mockNet.stopNodes()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `sync confidential identities`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `sync confidential identities`() {
|
||||
// Set up values we'll need
|
||||
val aliceNode = mockNet.createPartyNode(ALICE_NAME)
|
||||
val bobNode = mockNet.createPartyNode(BOB_NAME)
|
||||
@ -74,8 +74,8 @@ class IdentitySyncFlowTests {
|
||||
assertEquals(expected, actual)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `don't offer other's identities confidential identities`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `don't offer other's identities confidential identities`() {
|
||||
// Set up values we'll need
|
||||
val aliceNode = mockNet.createPartyNode(ALICE_NAME)
|
||||
val bobNode = mockNet.createPartyNode(BOB_NAME)
|
||||
|
@ -46,8 +46,8 @@ class SwapIdentitiesFlowTests {
|
||||
private val alice = aliceNode.info.singleIdentity()
|
||||
private val bob = bobNode.info.singleIdentity()
|
||||
|
||||
@Test
|
||||
fun `issue key`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `issue key`() {
|
||||
assertThat(
|
||||
aliceNode.services.startFlow(SwapIdentitiesInitiator(bob)),
|
||||
willReturn(
|
||||
@ -72,8 +72,8 @@ class SwapIdentitiesFlowTests {
|
||||
/**
|
||||
* Check that flow is actually validating the name on the certificate presented by the counterparty.
|
||||
*/
|
||||
@Test
|
||||
fun `verifies identity name`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `verifies identity name`() {
|
||||
val notBob = charlieNode.issueFreshKeyAndCert()
|
||||
val signature = charlieNode.signSwapIdentitiesFlowData(notBob, notBob.owningKey)
|
||||
assertThatThrownBy { aliceNode.validateSwapIdentitiesFlow(bob, notBob, signature) }
|
||||
@ -84,8 +84,8 @@ class SwapIdentitiesFlowTests {
|
||||
/**
|
||||
* Check that flow is actually validating its the signature presented by the counterparty.
|
||||
*/
|
||||
@Test
|
||||
fun `verification rejects signature if name is right but key is wrong`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `verification rejects signature if name is right but key is wrong`() {
|
||||
val evilBobNode = mockNet.createPartyNode(bobNode.info.singleIdentity().name)
|
||||
val evilBob = evilBobNode.info.singleIdentityAndCert()
|
||||
val anonymousEvilBob = evilBobNode.issueFreshKeyAndCert()
|
||||
@ -96,8 +96,8 @@ class SwapIdentitiesFlowTests {
|
||||
.hasMessage("Signature does not match the expected identity ownership assertion.")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `verification rejects signature if key is right but name is wrong`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `verification rejects signature if key is right but name is wrong`() {
|
||||
val anonymousAlice = aliceNode.issueFreshKeyAndCert()
|
||||
val anonymousBob = bobNode.issueFreshKeyAndCert()
|
||||
val signature = bobNode.signSwapIdentitiesFlowData(anonymousAlice, anonymousBob.owningKey)
|
||||
|
@ -72,7 +72,7 @@ class GenerateData {
|
||||
}
|
||||
|
||||
@Test
|
||||
fun verifyTransactions() {
|
||||
fun verifyTransactions() {
|
||||
URLClassLoader(arrayOf(TEST_DATA.toUri().toURL())).use { cl ->
|
||||
cl.loadResource("txverify/tx-success.bin")
|
||||
.deserialize<TransactionVerificationRequest>()
|
||||
|
@ -35,33 +35,33 @@ class CordaExceptionTest {
|
||||
val BOB = Party(BOB_NAME, BOB_KEY)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testCordaException() {
|
||||
@Test(timeout=300_000)
|
||||
fun testCordaException() {
|
||||
val ex = assertFailsWith<CordaException> { throw CordaException("BAD THING") }
|
||||
assertEquals("BAD THING", ex.message)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testAttachmentResolutionException() {
|
||||
@Test(timeout=300_000)
|
||||
fun testAttachmentResolutionException() {
|
||||
val ex = assertFailsWith<AttachmentResolutionException> { throw AttachmentResolutionException(TEST_HASH) }
|
||||
assertEquals(TEST_HASH, ex.hash)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testTransactionResolutionException() {
|
||||
@Test(timeout=300_000)
|
||||
fun testTransactionResolutionException() {
|
||||
val ex = assertFailsWith<TransactionResolutionException> { throw TransactionResolutionException(TEST_HASH) }
|
||||
assertEquals(TEST_HASH, ex.hash)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testConflictingAttachmentsRejection() {
|
||||
@Test(timeout=300_000)
|
||||
fun testConflictingAttachmentsRejection() {
|
||||
val ex = assertFailsWith<ConflictingAttachmentsRejection> { throw ConflictingAttachmentsRejection(TX_ID, CONTRACT_CLASS) }
|
||||
assertEquals(TX_ID, ex.txId)
|
||||
assertEquals(CONTRACT_CLASS, ex.contractClass)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testNotaryChangeInWrongTransactionType() {
|
||||
@Test(timeout=300_000)
|
||||
fun testNotaryChangeInWrongTransactionType() {
|
||||
val ex = assertFailsWith<NotaryChangeInWrongTransactionType> { throw NotaryChangeInWrongTransactionType(TX_ID, ALICE, BOB) }
|
||||
assertEquals(TX_ID, ex.txId)
|
||||
assertEquals(ALICE, ex.txNotary)
|
||||
|
@ -55,8 +55,8 @@ class AttachmentTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testAttachmentJar() {
|
||||
@Test(timeout=300_000)
|
||||
fun testAttachmentJar() {
|
||||
attachment.openAsJAR().use { jar ->
|
||||
val entry = jar.nextJarEntry ?: return@use
|
||||
assertEquals("data.bin", entry.name)
|
||||
@ -68,8 +68,8 @@ class AttachmentTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testExtractFromAttachment() {
|
||||
@Test(timeout=300_000)
|
||||
fun testExtractFromAttachment() {
|
||||
val resultData = ByteArrayOutputStream().use {
|
||||
attachment.extractFile("data.bin", it)
|
||||
it.toByteArray()
|
||||
|
@ -9,25 +9,25 @@ class PrivacySaltTest {
|
||||
private const val SALT_SIZE = 32
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testValidSalt() {
|
||||
@Test(timeout=300_000)
|
||||
fun testValidSalt() {
|
||||
PrivacySalt(ByteArray(SALT_SIZE) { 0x14 })
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testInvalidSaltWithAllZeros() {
|
||||
@Test(timeout=300_000)
|
||||
fun testInvalidSaltWithAllZeros() {
|
||||
val ex = assertFailsWith<IllegalArgumentException> { PrivacySalt(ByteArray(SALT_SIZE)) }
|
||||
assertEquals("Privacy salt should not be all zeros.", ex.message)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testTooShortPrivacySalt() {
|
||||
@Test(timeout=300_000)
|
||||
fun testTooShortPrivacySalt() {
|
||||
val ex = assertFailsWith<IllegalArgumentException> { PrivacySalt(ByteArray(SALT_SIZE - 1) { 0x7f }) }
|
||||
assertEquals("Privacy salt should be 32 bytes.", ex.message)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testTooLongPrivacySalt() {
|
||||
@Test(timeout=300_000)
|
||||
fun testTooLongPrivacySalt() {
|
||||
val ex = assertFailsWith<IllegalArgumentException> { PrivacySalt(ByteArray(SALT_SIZE + 1) { 0x7f }) }
|
||||
assertEquals("Privacy salt should be 32 bytes.", ex.message)
|
||||
}
|
||||
|
@ -14,22 +14,22 @@ class UniqueIdentifierTest {
|
||||
private val TEST_UUID: UUID = UUID.fromString("00000000-1111-2222-3333-444444444444")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testNewInstance() {
|
||||
@Test(timeout=300_000)
|
||||
fun testNewInstance() {
|
||||
val id = UniqueIdentifier(NAME, TEST_UUID)
|
||||
assertEquals("${NAME}_$TEST_UUID", id.toString())
|
||||
assertEquals(NAME, id.externalId)
|
||||
assertEquals(TEST_UUID, id.id)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testPrimaryConstructor() {
|
||||
@Test(timeout=300_000)
|
||||
fun testPrimaryConstructor() {
|
||||
val primary = UniqueIdentifier::class.primaryConstructor ?: throw AssertionError("primary constructor missing")
|
||||
assertThat(primary.call(NAME, TEST_UUID)).isEqualTo(UniqueIdentifier(NAME, TEST_UUID))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testConstructors() {
|
||||
@Test(timeout=300_000)
|
||||
fun testConstructors() {
|
||||
assertEquals(1, UniqueIdentifier::class.constructors.size)
|
||||
val ex = assertFailsWith<IllegalArgumentException> { UniqueIdentifier::class.constructors.first().call() }
|
||||
assertThat(ex).hasMessage("Callable expects 2 arguments, but 0 were provided.")
|
||||
|
@ -6,8 +6,8 @@ import org.junit.Assert.assertEquals
|
||||
import org.junit.Test
|
||||
|
||||
class MerkleTreeTest {
|
||||
@Test
|
||||
fun testCreate() {
|
||||
@Test(timeout=300_000)
|
||||
fun testCreate() {
|
||||
val merkle = MerkleTree.getMerkleTree(listOf(SecureHash.allOnesHash, SecureHash.zeroHash))
|
||||
assertEquals(SecureHash.parse("A5DE9B714ACCD8AFAAABF1CBD6E1014C9D07FF95C2AE154D91EC68485B31E7B5"), merkle.hash)
|
||||
}
|
||||
|
@ -7,31 +7,31 @@ import org.junit.Test
|
||||
import java.security.MessageDigest
|
||||
|
||||
class SecureHashTest {
|
||||
@Test
|
||||
fun testSHA256() {
|
||||
@Test(timeout=300_000)
|
||||
fun testSHA256() {
|
||||
val hash = SecureHash.sha256(byteArrayOf(0x64, -0x13, 0x42, 0x3a))
|
||||
assertEquals(SecureHash.parse("6D1687C143DF792A011A1E80670A4E4E0C25D0D87A39514409B1ABFC2043581F"), hash)
|
||||
assertEquals("6D1687C143DF792A011A1E80670A4E4E0C25D0D87A39514409B1ABFC2043581F", hash.toString())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testPrefix() {
|
||||
@Test(timeout=300_000)
|
||||
fun testPrefix() {
|
||||
val data = byteArrayOf(0x7d, 0x03, -0x21, 0x32, 0x56, 0x47)
|
||||
val digest = data.digestFor("SHA-256")
|
||||
val prefix = SecureHash.sha256(data).prefixChars(8)
|
||||
assertEquals(Hex.toHexString(digest).substring(0, 8).toUpperCase(), prefix)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testConcat() {
|
||||
@Test(timeout=300_000)
|
||||
fun testConcat() {
|
||||
val hash1 = SecureHash.sha256(byteArrayOf(0x7d, 0x03, -0x21, 0x32, 0x56, 0x47))
|
||||
val hash2 = SecureHash.sha256(byteArrayOf(0x63, 0x01, 0x7f, -0x29, 0x1e, 0x3c))
|
||||
val combined = hash1.hashConcat(hash2)
|
||||
assertArrayEquals((hash1.bytes + hash2.bytes).digestFor("SHA-256"), combined.bytes)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testConstants() {
|
||||
@Test(timeout=300_000)
|
||||
fun testConstants() {
|
||||
assertArrayEquals(SecureHash.zeroHash.bytes, ByteArray(32))
|
||||
assertArrayEquals(SecureHash.allOnesHash.bytes, ByteArray(32) { 0xFF.toByte() })
|
||||
}
|
||||
|
@ -14,8 +14,8 @@ class SecureRandomTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testNoCordaPRNG() {
|
||||
@Test(timeout=300_000)
|
||||
fun testNoCordaPRNG() {
|
||||
val error = assertFailsWith<NoSuchAlgorithmException> { SecureRandom.getInstance("CordaPRNG") }
|
||||
assertThat(error).hasMessage("CordaPRNG SecureRandom not available")
|
||||
}
|
||||
|
@ -30,8 +30,8 @@ class TransactionSignatureTest {
|
||||
}
|
||||
|
||||
/** Valid sign and verify. */
|
||||
@Test
|
||||
fun `Signature metadata full sign and verify`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Signature metadata full sign and verify`() {
|
||||
// Create a SignableData object.
|
||||
val signableData = SignableData(testBytes.sha256(), SignatureMetadata(1, Crypto.findSignatureScheme(keyPair.public).schemeNumberID))
|
||||
|
||||
@ -57,8 +57,8 @@ class TransactionSignatureTest {
|
||||
Crypto.doVerify((testBytes + testBytes).sha256(), transactionSignature)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Verify multi-tx signature`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Verify multi-tx signature`() {
|
||||
// Deterministically create 5 txIds.
|
||||
val txIds: List<SecureHash> = IntRange(0, 4).map { byteArrayOf(it.toByte()).sha256() }
|
||||
// Multi-tx signature.
|
||||
@ -103,8 +103,8 @@ class TransactionSignatureTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Verify one-tx signature`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Verify one-tx signature`() {
|
||||
val txId = "aTransaction".toByteArray().sha256()
|
||||
// One-tx signature.
|
||||
val txSignature = try {
|
||||
|
@ -7,8 +7,8 @@ import org.junit.Test
|
||||
import java.security.PublicKey
|
||||
|
||||
class TransactionWithSignaturesTest {
|
||||
@Test
|
||||
fun txWithSigs() {
|
||||
@Test(timeout=300_000)
|
||||
fun txWithSigs() {
|
||||
val tx = object : TransactionWithSignatures {
|
||||
override val id: SecureHash
|
||||
get() = SecureHash.zeroHash
|
||||
|
@ -16,13 +16,13 @@ class VerifyTransactionTest {
|
||||
val serialization = LocalSerializationRule(VerifyTransactionTest::class)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun success() {
|
||||
@Test(timeout=300_000)
|
||||
fun success() {
|
||||
verifyTransaction(bytesOfResource("txverify/tx-success.bin"))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun failure() {
|
||||
@Test(timeout=300_000)
|
||||
fun failure() {
|
||||
val e = assertFailsWith<Exception> { verifyTransaction(bytesOfResource("txverify/tx-failure.bin")) }
|
||||
assertThat(e).hasMessageContaining("Required ${Move::class.java.canonicalName} command")
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import net.corda.core.serialization.SerializationContext.UseCase.P2P
|
||||
import net.corda.core.serialization.SerializationCustomSerializer
|
||||
import net.corda.core.serialization.SerializationWhitelist
|
||||
import net.corda.core.serialization.internal.SerializationEnvironment
|
||||
import net.corda.core.serialization.internal._contextSerializationEnv
|
||||
import net.corda.core.serialization.internal._driverSerializationEnv
|
||||
import net.corda.serialization.internal.*
|
||||
import net.corda.serialization.internal.amqp.*
|
||||
import org.junit.rules.TestRule
|
||||
@ -48,11 +48,11 @@ class LocalSerializationRule(private val label: String) : TestRule {
|
||||
}
|
||||
|
||||
private fun init() {
|
||||
_contextSerializationEnv.set(createTestSerializationEnv())
|
||||
_driverSerializationEnv.set(createTestSerializationEnv())
|
||||
}
|
||||
|
||||
private fun clear() {
|
||||
_contextSerializationEnv.set(null)
|
||||
_driverSerializationEnv.set(null)
|
||||
}
|
||||
|
||||
private fun createTestSerializationEnv(): SerializationEnvironment {
|
||||
|
@ -57,14 +57,14 @@ class NodeVersioningTest {
|
||||
notary.close()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `platform version in manifest file`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `platform version in manifest file`() {
|
||||
val manifest = JarFile(factory.cordaJar.toFile()).manifest
|
||||
assertThat(manifest.mainAttributes.getValue("Corda-Platform-Version").toInt()).isEqualTo(PLATFORM_VERSION)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `platform version from RPC`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `platform version from RPC`() {
|
||||
val cordappsDir = (factory.baseDirectory(aliceConfig) / NodeProcess.CORDAPPS_DIR_NAME).createDirectories()
|
||||
// Find the jar file for the smoke tests of this module
|
||||
val selfCordapp = Paths.get("build", "libs").list {
|
||||
|
@ -74,8 +74,8 @@ class CordappSmokeTest {
|
||||
notary.close()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `FlowContent appName returns the filename of the CorDapp jar`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `FlowContent appName returns the filename of the CorDapp jar`() {
|
||||
val baseDir = factory.baseDirectory(aliceConfig)
|
||||
val cordappsDir = (baseDir / CORDAPPS_DIR_NAME).createDirectories()
|
||||
// Find the jar file for the smoke tests of this module
|
||||
@ -103,8 +103,8 @@ class CordappSmokeTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `empty cordapps directory`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `empty cordapps directory`() {
|
||||
(factory.baseDirectory(aliceConfig) / CORDAPPS_DIR_NAME).createDirectories()
|
||||
factory.create(aliceConfig).close()
|
||||
}
|
||||
|
@ -19,14 +19,14 @@ import kotlin.test.assertTrue
|
||||
* Tests of the [Amount] class.
|
||||
*/
|
||||
class AmountTests {
|
||||
@Test
|
||||
fun `make sure Amount has decimal places`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `make sure Amount has decimal places`() {
|
||||
val x = Amount(1, Currency.getInstance("USD"))
|
||||
assertTrue("0.01" in x.toString())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `decimal conversion`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `decimal conversion`() {
|
||||
val quantity = 1234L
|
||||
val amountGBP = Amount(quantity, GBP)
|
||||
val expectedGBP = BigDecimal("12.34")
|
||||
@ -48,8 +48,8 @@ class AmountTests {
|
||||
override fun toString(): String = name
|
||||
}
|
||||
|
||||
@Test
|
||||
fun split() {
|
||||
@Test(timeout=300_000)
|
||||
fun split() {
|
||||
for (baseQuantity in 0..1000) {
|
||||
val baseAmount = Amount(baseQuantity.toLong(), GBP)
|
||||
for (partitionCount in 1..100) {
|
||||
@ -63,8 +63,8 @@ class AmountTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `amount transfers equality`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `amount transfers equality`() {
|
||||
val partyA = "A"
|
||||
val partyB = "B"
|
||||
val partyC = "C"
|
||||
@ -88,8 +88,8 @@ class AmountTests {
|
||||
assertNotEquals(transferE.hashCode(), transferA.hashCode())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `amount transfer aggregation`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `amount transfer aggregation`() {
|
||||
val partyA = "A"
|
||||
val partyB = "B"
|
||||
val partyC = "C"
|
||||
@ -119,8 +119,8 @@ class AmountTests {
|
||||
assertEquals(negativeTransfer, sumUntilNegative)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `amount transfer apply`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `amount transfer apply`() {
|
||||
val partyA = "A"
|
||||
val partyB = "B"
|
||||
val partyC = "C"
|
||||
@ -167,8 +167,8 @@ class AmountTests {
|
||||
assertEquals(originalTotals[Pair(partyB, GBP)], newTotals3[Pair(partyB, GBP)])
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testGbpParse() {
|
||||
@Test(timeout=300_000)
|
||||
fun testGbpParse() {
|
||||
assertEquals(POUNDS(10), Amount.parseCurrency("10 GBP"))
|
||||
assertEquals(POUNDS(11), Amount.parseCurrency("£11"))
|
||||
}
|
||||
|
@ -96,8 +96,8 @@ class ConstraintsPropagationTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Happy path with the HashConstraint`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Happy path with the HashConstraint`() {
|
||||
ledgerServices.ledger(DUMMY_NOTARY) {
|
||||
ledgerServices.recordTransaction(transaction {
|
||||
attachment(Cash.PROGRAM_ID, SecureHash.allOnesHash)
|
||||
@ -115,8 +115,8 @@ class ConstraintsPropagationTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore // TODO(mike): rework
|
||||
@Test(timeout=300_000)
|
||||
@Ignore // TODO(mike): rework
|
||||
fun `Happy path for Hash to Signature Constraint migration`() {
|
||||
val cordapps = (ledgerServices.cordappProvider as MockCordappProvider).cordapps
|
||||
val cordappAttachmentIds =
|
||||
@ -156,8 +156,8 @@ class ConstraintsPropagationTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Fail early in the TransactionBuilder when attempting to change the hash of the HashConstraint on the spending transaction`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Fail early in the TransactionBuilder when attempting to change the hash of the HashConstraint on the spending transaction`() {
|
||||
ledgerServices.ledger(DUMMY_NOTARY) {
|
||||
transaction {
|
||||
attachment(Cash.PROGRAM_ID, SecureHash.zeroHash)
|
||||
@ -177,8 +177,8 @@ class ConstraintsPropagationTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Transaction validation fails, when constraints do not propagate correctly`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Transaction validation fails, when constraints do not propagate correctly`() {
|
||||
ledgerServices.ledger(DUMMY_NOTARY) {
|
||||
ledgerServices.recordTransaction(transaction {
|
||||
attachment(Cash.PROGRAM_ID, SecureHash.zeroHash)
|
||||
@ -210,8 +210,8 @@ class ConstraintsPropagationTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `When the constraint of the output state is a valid transition from the input state, transaction validation works`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `When the constraint of the output state is a valid transition from the input state, transaction validation works`() {
|
||||
ledgerServices.ledger(DUMMY_NOTARY) {
|
||||
ledgerServices.recordTransaction(transaction {
|
||||
attachment(Cash.PROGRAM_ID, SecureHash.zeroHash)
|
||||
@ -229,8 +229,8 @@ class ConstraintsPropagationTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Switching from the WhitelistConstraint to the Signature Constraint is possible if the attachment satisfies both constraints, and the signature constraint inherits all jar signatures`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Switching from the WhitelistConstraint to the Signature Constraint is possible if the attachment satisfies both constraints, and the signature constraint inherits all jar signatures`() {
|
||||
|
||||
ledgerServices.ledger(DUMMY_NOTARY) {
|
||||
ledgerServices.recordTransaction(transaction {
|
||||
@ -251,8 +251,8 @@ class ConstraintsPropagationTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Switching from the WhitelistConstraint to the Signature Constraint fails if the signature constraint does not inherit all jar signatures`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Switching from the WhitelistConstraint to the Signature Constraint fails if the signature constraint does not inherit all jar signatures`() {
|
||||
ledgerServices.ledger(DUMMY_NOTARY) {
|
||||
ledgerServices.recordTransaction(transaction {
|
||||
attachment(Cash.PROGRAM_ID, SecureHash.zeroHash)
|
||||
@ -272,8 +272,8 @@ class ConstraintsPropagationTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `On contract annotated with NoConstraintPropagation there is no platform check for propagation, but the transaction builder can't use the AutomaticPlaceholderConstraint`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `On contract annotated with NoConstraintPropagation there is no platform check for propagation, but the transaction builder can't use the AutomaticPlaceholderConstraint`() {
|
||||
ledgerServices.ledger(DUMMY_NOTARY) {
|
||||
ledgerServices.recordTransaction(transaction {
|
||||
attachment(noPropagationContractClassName, SecureHash.zeroHash)
|
||||
@ -300,8 +300,8 @@ class ConstraintsPropagationTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Signature Constraints canBeTransitionedFrom Hash Constraints behaves as expected`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Signature Constraints canBeTransitionedFrom Hash Constraints behaves as expected`() {
|
||||
|
||||
// unsigned attachment (for hash constraint)
|
||||
val attachmentUnsigned = mock<ContractAttachment>()
|
||||
@ -326,8 +326,8 @@ class ConstraintsPropagationTests {
|
||||
assertFalse(SignatureAttachmentConstraint(ALICE_PUBKEY).canBeTransitionedFrom(HashAttachmentConstraint(allOnesHash), attachmentSigned))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Attachment canBeTransitionedFrom behaves as expected`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Attachment canBeTransitionedFrom behaves as expected`() {
|
||||
|
||||
// signed attachment (for signature constraint)
|
||||
val attachment = mock<ContractAttachment>()
|
||||
@ -378,8 +378,8 @@ class ConstraintsPropagationTests {
|
||||
recordTransactions(SignedTransaction(wireTransaction, sigs))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Input state contract version may be incompatible with lower version`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Input state contract version may be incompatible with lower version`() {
|
||||
ledgerServices.ledger(DUMMY_NOTARY) {
|
||||
ledgerServices.recordTransaction(transaction {
|
||||
attachment(Cash.PROGRAM_ID, SecureHash.allOnesHash, listOf(hashToSignatureConstraintsKey), mapOf(Attributes.Name.IMPLEMENTATION_VERSION.toString() to "2"))
|
||||
@ -397,8 +397,8 @@ class ConstraintsPropagationTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Input state contract version is compatible with the same version`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Input state contract version is compatible with the same version`() {
|
||||
ledgerServices.ledger(DUMMY_NOTARY) {
|
||||
ledgerServices.recordTransaction(transaction {
|
||||
attachment(Cash.PROGRAM_ID, SecureHash.allOnesHash, listOf(hashToSignatureConstraintsKey), mapOf(Attributes.Name.IMPLEMENTATION_VERSION.toString() to "3"))
|
||||
@ -416,8 +416,8 @@ class ConstraintsPropagationTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Input state contract version is compatible with higher version`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Input state contract version is compatible with higher version`() {
|
||||
ledgerServices.ledger(DUMMY_NOTARY) {
|
||||
ledgerServices.recordTransaction(transaction {
|
||||
attachment(Cash.PROGRAM_ID, SecureHash.allOnesHash, listOf(hashToSignatureConstraintsKey), mapOf(Attributes.Name.IMPLEMENTATION_VERSION.toString() to "1"))
|
||||
@ -435,8 +435,8 @@ class ConstraintsPropagationTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Input states contract version may be lower that current contract version`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Input states contract version may be lower that current contract version`() {
|
||||
ledgerServices.ledger(DUMMY_NOTARY) {
|
||||
ledgerServices.recordTransaction(transaction {
|
||||
attachment(Cash.PROGRAM_ID, SecureHash.allOnesHash, listOf(hashToSignatureConstraintsKey), mapOf(Attributes.Name.IMPLEMENTATION_VERSION.toString() to "1"))
|
||||
@ -460,8 +460,8 @@ class ConstraintsPropagationTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Input state with contract version can be downgraded to no version`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Input state with contract version can be downgraded to no version`() {
|
||||
ledgerServices.ledger(DUMMY_NOTARY) {
|
||||
ledgerServices.recordTransaction(transaction {
|
||||
attachment(Cash.PROGRAM_ID, SecureHash.allOnesHash, listOf(hashToSignatureConstraintsKey), mapOf(Attributes.Name.IMPLEMENTATION_VERSION.toString() to "2"))
|
||||
@ -479,8 +479,8 @@ class ConstraintsPropagationTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Input state without contract version is compatible with any version`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Input state without contract version is compatible with any version`() {
|
||||
ledgerServices.ledger(DUMMY_NOTARY) {
|
||||
ledgerServices.recordTransaction(transaction {
|
||||
attachment(Cash.PROGRAM_ID, SecureHash.allOnesHash, listOf(hashToSignatureConstraintsKey), emptyMap())
|
||||
|
@ -34,8 +34,8 @@ class ContractHierarchyTest {
|
||||
mockNet.stopNodes()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `hierarchical contracts work with mock network`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `hierarchical contracts work with mock network`() {
|
||||
// Set up values we'll need
|
||||
val aliceNode = mockNet.createPartyNode(ALICE_NAME)
|
||||
val bobNode = mockNet.createPartyNode(BOB_NAME)
|
||||
|
@ -40,8 +40,8 @@ class RequireSingleCommandTests(private val testFunction: (Collection<CommandWit
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `check function returns one value`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `check function returns one value`() {
|
||||
val commands = listOf(validCommandOne, invalidCommand)
|
||||
val returnedCommand = testFunction(commands)
|
||||
assertEquals(returnedCommand, validCommandOne, "they should be the same")
|
||||
@ -53,8 +53,8 @@ class RequireSingleCommandTests(private val testFunction: (Collection<CommandWit
|
||||
testFunction(commands)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `check error is thrown when command is of wrong type`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `check error is thrown when command is of wrong type`() {
|
||||
val commands = listOf(invalidCommand)
|
||||
Assertions.assertThatThrownBy { testFunction(commands) }
|
||||
.isInstanceOf(IllegalStateException::class.java)
|
||||
@ -74,8 +74,8 @@ class SelectWithSingleInputsTests(private val testFunction: (Collection<CommandW
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `check that function returns all values`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `check that function returns all values`() {
|
||||
val commands = listOf(validCommandOne, validCommandTwo)
|
||||
testFunction(commands, null, null)
|
||||
assertEquals(2, commands.size)
|
||||
@ -83,8 +83,8 @@ class SelectWithSingleInputsTests(private val testFunction: (Collection<CommandW
|
||||
assertTrue(commands.contains(validCommandTwo))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `check that function does not return invalid command types`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `check that function does not return invalid command types`() {
|
||||
val commands = listOf(validCommandOne, invalidCommand)
|
||||
val filteredCommands = testFunction(commands, null, null).toList()
|
||||
assertEquals(1, filteredCommands.size)
|
||||
@ -92,8 +92,8 @@ class SelectWithSingleInputsTests(private val testFunction: (Collection<CommandW
|
||||
assertFalse(filteredCommands.contains(invalidCommand))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `check that function returns commands from valid signers`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `check that function returns commands from valid signers`() {
|
||||
val commands = listOf(validCommandOne, validCommandTwo)
|
||||
val filteredCommands = testFunction(commands, miniCorp.publicKey, null).toList()
|
||||
assertEquals(1, filteredCommands.size)
|
||||
@ -101,8 +101,8 @@ class SelectWithSingleInputsTests(private val testFunction: (Collection<CommandW
|
||||
assertFalse(filteredCommands.contains(validCommandTwo))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `check that function returns commands from valid parties`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `check that function returns commands from valid parties`() {
|
||||
val commands = listOf(validCommandOne, validCommandTwo)
|
||||
val filteredCommands = testFunction(commands, null, miniCorp.party).toList()
|
||||
assertEquals(1, filteredCommands.size)
|
||||
@ -123,8 +123,8 @@ class SelectWithMultipleInputsTests(private val testFunction: (Collection<Comman
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `check that function returns all values`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `check that function returns all values`() {
|
||||
val commands = listOf(validCommandOne, validCommandTwo)
|
||||
testFunction(commands, null, null)
|
||||
assertEquals(2, commands.size)
|
||||
@ -132,8 +132,8 @@ class SelectWithMultipleInputsTests(private val testFunction: (Collection<Comman
|
||||
assertTrue(commands.contains(validCommandTwo))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `check that function does not return invalid command types`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `check that function does not return invalid command types`() {
|
||||
val commands = listOf(validCommandOne, invalidCommand)
|
||||
val filteredCommands = testFunction(commands, null, null).toList()
|
||||
assertEquals(1, filteredCommands.size)
|
||||
@ -141,8 +141,8 @@ class SelectWithMultipleInputsTests(private val testFunction: (Collection<Comman
|
||||
assertFalse(filteredCommands.contains(invalidCommand))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `check that function returns commands from valid signers`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `check that function returns commands from valid signers`() {
|
||||
val commands = listOf(validCommandOne, validCommandTwo)
|
||||
val filteredCommands = testFunction(commands, listOf(megaCorp.publicKey), null).toList()
|
||||
assertEquals(2, filteredCommands.size)
|
||||
@ -150,8 +150,8 @@ class SelectWithMultipleInputsTests(private val testFunction: (Collection<Comman
|
||||
assertTrue(filteredCommands.contains(validCommandTwo))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `check that function returns commands from all valid signers`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `check that function returns commands from all valid signers`() {
|
||||
val commands = listOf(validCommandOne, validCommandTwo)
|
||||
val filteredCommands = testFunction(commands, listOf(miniCorp.publicKey, megaCorp.publicKey), null).toList()
|
||||
assertEquals(1, filteredCommands.size)
|
||||
@ -159,8 +159,8 @@ class SelectWithMultipleInputsTests(private val testFunction: (Collection<Comman
|
||||
assertFalse(filteredCommands.contains(validCommandTwo))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `check that function returns commands from valid parties`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `check that function returns commands from valid parties`() {
|
||||
val commands = listOf(validCommandOne, validCommandTwo)
|
||||
val filteredCommands = testFunction(commands, null, listOf(megaCorp.party)).toList()
|
||||
assertEquals(2, filteredCommands.size)
|
||||
@ -168,8 +168,8 @@ class SelectWithMultipleInputsTests(private val testFunction: (Collection<Comman
|
||||
assertTrue(filteredCommands.contains(validCommandTwo))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `check that function returns commands from all valid parties`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `check that function returns commands from all valid parties`() {
|
||||
val commands = listOf(validCommandOne, validCommandTwo)
|
||||
val filteredCommands = testFunction(commands, null, listOf(miniCorp.party, megaCorp.party)).toList()
|
||||
assertEquals(1, filteredCommands.size)
|
||||
|
@ -54,8 +54,8 @@ class PackageOwnershipVerificationTests {
|
||||
)
|
||||
)
|
||||
|
||||
@Test
|
||||
fun `Happy path - Transaction validates when package signed by owner`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Happy path - Transaction validates when package signed by owner`() {
|
||||
ledgerServices.ledger(DUMMY_NOTARY) {
|
||||
transaction {
|
||||
attachment(DUMMY_CONTRACT, SecureHash.allOnesHash, listOf(OWNER_KEY_PAIR.public))
|
||||
@ -66,8 +66,8 @@ class PackageOwnershipVerificationTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Transaction validation fails when the selected attachment is not signed by the owner`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Transaction validation fails when the selected attachment is not signed by the owner`() {
|
||||
ledgerServices.ledger(DUMMY_NOTARY) {
|
||||
transaction {
|
||||
attachment(DUMMY_CONTRACT, SecureHash.allOnesHash, listOf(ALICE_PUBKEY))
|
||||
@ -78,8 +78,8 @@ class PackageOwnershipVerificationTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `packages that do not have contracts in are still ownable`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `packages that do not have contracts in are still ownable`() {
|
||||
// The first version of this feature was incorrectly concerned with contract classes and only contract
|
||||
// classes, but for the feature to work it must apply to any package. This tests that by using a package
|
||||
// in isolated.jar that doesn't include any contracts.
|
||||
|
@ -15,8 +15,8 @@ import java.time.ZoneOffset.UTC
|
||||
class TimeWindowTest {
|
||||
private val now = Instant.now()
|
||||
|
||||
@Test
|
||||
fun fromOnly() {
|
||||
@Test(timeout=300_000)
|
||||
fun fromOnly() {
|
||||
val timeWindow = TimeWindow.fromOnly(now)
|
||||
assertThat(timeWindow.fromTime).isEqualTo(now)
|
||||
assertThat(timeWindow.untilTime).isNull()
|
||||
@ -27,8 +27,8 @@ class TimeWindowTest {
|
||||
assertThat(timeWindow.contains(now + 1.millis)).isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun untilOnly() {
|
||||
@Test(timeout=300_000)
|
||||
fun untilOnly() {
|
||||
val timeWindow = TimeWindow.untilOnly(now)
|
||||
assertThat(timeWindow.fromTime).isNull()
|
||||
assertThat(timeWindow.untilTime).isEqualTo(now)
|
||||
@ -39,8 +39,8 @@ class TimeWindowTest {
|
||||
assertThat(timeWindow.contains(now + 1.millis)).isFalse()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun between() {
|
||||
@Test(timeout=300_000)
|
||||
fun between() {
|
||||
val today = LocalDate.now()
|
||||
val fromTime = today.atTime(12, 0).toInstant(UTC)
|
||||
val untilTime = today.atTime(12, 30).toInstant(UTC)
|
||||
@ -56,8 +56,8 @@ class TimeWindowTest {
|
||||
assertThat(timeWindow.contains(untilTime + 1.millis)).isFalse()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun fromStartAndDuration() {
|
||||
@Test(timeout=300_000)
|
||||
fun fromStartAndDuration() {
|
||||
val duration = 10.minutes
|
||||
val timeWindow = TimeWindow.fromStartAndDuration(now, duration)
|
||||
assertThat(timeWindow.fromTime).isEqualTo(now)
|
||||
@ -66,8 +66,8 @@ class TimeWindowTest {
|
||||
assertThat(timeWindow.length).isEqualTo(duration)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun withTolerance() {
|
||||
@Test(timeout=300_000)
|
||||
fun withTolerance() {
|
||||
val tolerance = 10.minutes
|
||||
val timeWindow = TimeWindow.withTolerance(now, tolerance)
|
||||
assertThat(timeWindow.fromTime).isEqualTo(now - tolerance)
|
||||
|
@ -41,8 +41,8 @@ class TransactionVerificationExceptionSerialisationTests {
|
||||
private val attachmentHash = SecureHash.allOnesHash
|
||||
private val factory = defaultFactory()
|
||||
|
||||
@Test
|
||||
fun contractConstraintRejectionTest() {
|
||||
@Test(timeout=300_000)
|
||||
fun contractConstraintRejectionTest() {
|
||||
val excp = TransactionVerificationException.ContractConstraintRejection(txid, "This is only a test")
|
||||
val excp2 = DeserializationInput(factory).deserialize(
|
||||
SerializationOutput(factory).serialize(excp, context),
|
||||
@ -53,8 +53,8 @@ class TransactionVerificationExceptionSerialisationTests {
|
||||
assertEquals(excp.txId, excp2.txId)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun contractRejectionTest() {
|
||||
@Test(timeout=300_000)
|
||||
fun contractRejectionTest() {
|
||||
class TestContract(val thing: Int) : Contract {
|
||||
override fun verify(tx: LedgerTransaction) = Unit
|
||||
}
|
||||
@ -72,8 +72,8 @@ class TransactionVerificationExceptionSerialisationTests {
|
||||
assertEquals(exception.txId, exception2.txId)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun missingAttachmentRejectionTest() {
|
||||
@Test(timeout=300_000)
|
||||
fun missingAttachmentRejectionTest() {
|
||||
val exception = TransactionVerificationException.MissingAttachmentRejection(txid, "Some contract class")
|
||||
val exception2 = DeserializationInput(factory).deserialize(
|
||||
SerializationOutput(factory).serialize(exception, context),
|
||||
@ -84,8 +84,8 @@ class TransactionVerificationExceptionSerialisationTests {
|
||||
assertEquals(exception.txId, exception2.txId)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun conflictingAttachmentsRejectionTest() {
|
||||
@Test(timeout=300_000)
|
||||
fun conflictingAttachmentsRejectionTest() {
|
||||
val exception = TransactionVerificationException.ContractConstraintRejection(txid, "Some contract class")
|
||||
val exception2 = DeserializationInput(factory).deserialize(
|
||||
SerializationOutput(factory).serialize(exception, context),
|
||||
@ -96,8 +96,8 @@ class TransactionVerificationExceptionSerialisationTests {
|
||||
assertEquals(exception.txId, exception2.txId)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun invalidConstraintRejectionError() {
|
||||
@Test(timeout=300_000)
|
||||
fun invalidConstraintRejectionError() {
|
||||
val exception = TransactionVerificationException.InvalidConstraintRejection(txid, "Some contract class", "for being too funny")
|
||||
val exceptionAfterSerialisation = DeserializationInput(factory).deserialize(
|
||||
SerializationOutput(factory).serialize(exception, context),
|
||||
@ -110,8 +110,8 @@ class TransactionVerificationExceptionSerialisationTests {
|
||||
assertEquals(exception.reason, exceptionAfterSerialisation.reason)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun contractCreationErrorTest() {
|
||||
@Test(timeout=300_000)
|
||||
fun contractCreationErrorTest() {
|
||||
val cause = Throwable("wibble")
|
||||
val exception = createContractCreationError(txid, "Some contract class", cause)
|
||||
val exception2 = DeserializationInput(factory).deserialize(
|
||||
@ -123,8 +123,8 @@ class TransactionVerificationExceptionSerialisationTests {
|
||||
assertEquals(exception.txId, exception2.txId)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun transactionMissingEncumbranceTest() {
|
||||
@Test(timeout=300_000)
|
||||
fun transactionMissingEncumbranceTest() {
|
||||
val exception = TransactionVerificationException.TransactionMissingEncumbranceException(
|
||||
txid, 12, TransactionVerificationException.Direction.INPUT)
|
||||
val exception2 = DeserializationInput(factory).deserialize(
|
||||
@ -136,8 +136,8 @@ class TransactionVerificationExceptionSerialisationTests {
|
||||
assertEquals(exception.txId, exception2.txId)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun notaryChangeInWrongTransactionTypeTest() {
|
||||
@Test(timeout=300_000)
|
||||
fun notaryChangeInWrongTransactionTypeTest() {
|
||||
val dummyBankA = TestIdentity(DUMMY_BANK_A_NAME, 40).party
|
||||
val dummyNotary = TestIdentity(DUMMY_NOTARY_NAME, 20).party
|
||||
|
||||
@ -153,8 +153,8 @@ class TransactionVerificationExceptionSerialisationTests {
|
||||
assertEquals(exception.txId, exception2.txId)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overlappingAttachmentsExceptionTest() {
|
||||
@Test(timeout=300_000)
|
||||
fun overlappingAttachmentsExceptionTest() {
|
||||
val exc = TransactionVerificationException.OverlappingAttachmentsException(txid, "foo/bar/baz")
|
||||
val exc2 = DeserializationInput(factory).deserialize(
|
||||
SerializationOutput(factory).serialize(exc, context),
|
||||
@ -163,8 +163,8 @@ class TransactionVerificationExceptionSerialisationTests {
|
||||
assertEquals(exc.message, exc2.message)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun packageOwnershipExceptionTest() {
|
||||
@Test(timeout=300_000)
|
||||
fun packageOwnershipExceptionTest() {
|
||||
val exc = TransactionVerificationException.PackageOwnershipException(
|
||||
txid,
|
||||
attachmentHash,
|
||||
@ -178,8 +178,8 @@ class TransactionVerificationExceptionSerialisationTests {
|
||||
assertEquals(exc.message, exc2.message)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun invalidAttachmentExceptionTest() {
|
||||
@Test(timeout=300_000)
|
||||
fun invalidAttachmentExceptionTest() {
|
||||
val exc = TransactionVerificationException.InvalidAttachmentException(
|
||||
txid,
|
||||
attachmentHash)
|
||||
@ -191,8 +191,8 @@ class TransactionVerificationExceptionSerialisationTests {
|
||||
assertEquals(exc.message, exc2.message)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun untrustedAttachmentsExceptionTest() {
|
||||
@Test(timeout=300_000)
|
||||
fun untrustedAttachmentsExceptionTest() {
|
||||
val exc = TransactionVerificationException.UntrustedAttachmentsException(
|
||||
txid,
|
||||
listOf(attachmentHash))
|
||||
@ -204,8 +204,8 @@ class TransactionVerificationExceptionSerialisationTests {
|
||||
assertEquals(exc.message, exc2.message)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun transactionNetworkParameterOrderingExceptionTest() {
|
||||
@Test(timeout=300_000)
|
||||
fun transactionNetworkParameterOrderingExceptionTest() {
|
||||
val exception = TransactionVerificationException.TransactionNetworkParameterOrderingException(
|
||||
txid,
|
||||
StateRef(SecureHash.zeroHash, 1),
|
||||
@ -222,8 +222,8 @@ class TransactionVerificationExceptionSerialisationTests {
|
||||
assertEquals(exception.txId, exception2.txId)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun missingNetworkParametersExceptionTest() {
|
||||
@Test(timeout=300_000)
|
||||
fun missingNetworkParametersExceptionTest() {
|
||||
val exception = TransactionVerificationException.MissingNetworkParametersException(txid, SecureHash.zeroHash)
|
||||
val exception2 = DeserializationInput(factory)
|
||||
.deserialize(
|
||||
@ -236,8 +236,8 @@ class TransactionVerificationExceptionSerialisationTests {
|
||||
assertEquals(exception.txId, exception2.txId)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun constraintPropagationRejectionTest() {
|
||||
@Test(timeout=300_000)
|
||||
fun constraintPropagationRejectionTest() {
|
||||
val exception = TransactionVerificationException.ConstraintPropagationRejection(txid, "com.test.Contract",
|
||||
AlwaysAcceptAttachmentConstraint, AlwaysAcceptAttachmentConstraint)
|
||||
val exception2 = DeserializationInput(factory)
|
||||
@ -252,8 +252,8 @@ class TransactionVerificationExceptionSerialisationTests {
|
||||
assertEquals("com.test.Contract", exception2.contractClass)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun transactionDuplicateEncumbranceExceptionTest() {
|
||||
@Test(timeout=300_000)
|
||||
fun transactionDuplicateEncumbranceExceptionTest() {
|
||||
val exception = TransactionVerificationException.TransactionDuplicateEncumbranceException(txid, 1)
|
||||
val exception2 = DeserializationInput(factory)
|
||||
.deserialize(
|
||||
@ -266,8 +266,8 @@ class TransactionVerificationExceptionSerialisationTests {
|
||||
assertEquals(exception.txId, exception2.txId)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun transactionNonMatchingEncumbranceExceptionTest() {
|
||||
@Test(timeout=300_000)
|
||||
fun transactionNonMatchingEncumbranceExceptionTest() {
|
||||
val exception = TransactionVerificationException.TransactionNonMatchingEncumbranceException(txid, listOf(1, 2, 3))
|
||||
val exception2 = DeserializationInput(factory)
|
||||
.deserialize(
|
||||
@ -280,8 +280,8 @@ class TransactionVerificationExceptionSerialisationTests {
|
||||
assertEquals(exception.txId, exception2.txId)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun transactionNotaryMismatchEncumbranceExceptionTest() {
|
||||
@Test(timeout=300_000)
|
||||
fun transactionNotaryMismatchEncumbranceExceptionTest() {
|
||||
val exception = TransactionVerificationException.TransactionNotaryMismatchEncumbranceException(
|
||||
txid, 1, 2, Party(ALICE_NAME, generateKeyPair().public), Party(BOB_NAME, generateKeyPair().public))
|
||||
val exception2 = DeserializationInput(factory)
|
||||
@ -295,8 +295,8 @@ class TransactionVerificationExceptionSerialisationTests {
|
||||
assertEquals(exception.txId, exception2.txId)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun transactionContractConflictExceptionTest() {
|
||||
@Test(timeout=300_000)
|
||||
fun transactionContractConflictExceptionTest() {
|
||||
val exception = TransactionVerificationException.TransactionContractConflictException(
|
||||
txid, TransactionState(DummyContractState(), notary = Party(BOB_NAME, generateKeyPair().public)), "aa")
|
||||
val exception2 = DeserializationInput(factory)
|
||||
@ -310,8 +310,8 @@ class TransactionVerificationExceptionSerialisationTests {
|
||||
assertEquals(exception.txId, exception2.txId)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun transactionRequiredContractUnspecifiedExceptionTest() {
|
||||
@Test(timeout=300_000)
|
||||
fun transactionRequiredContractUnspecifiedExceptionTest() {
|
||||
val exception = TransactionVerificationException.TransactionRequiredContractUnspecifiedException(
|
||||
txid, TransactionState(DummyContractState(), notary = Party(BOB_NAME, generateKeyPair().public)))
|
||||
val exception2 = DeserializationInput(factory)
|
||||
|
@ -49,14 +49,14 @@ class CompositeKeyTests {
|
||||
private val bobSignature by lazy { bobKey.sign(SignableData(secureHash, SignatureMetadata(1, Crypto.findSignatureScheme(bobPublicKey).schemeNumberID))) }
|
||||
private val charlieSignature by lazy { charlieKey.sign(SignableData(secureHash, SignatureMetadata(1, Crypto.findSignatureScheme(charliePublicKey).schemeNumberID))) }
|
||||
|
||||
@Test
|
||||
fun `(Alice) fulfilled by Alice signature`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `(Alice) fulfilled by Alice signature`() {
|
||||
assertTrue { alicePublicKey.isFulfilledBy(aliceSignature.by) }
|
||||
assertFalse { alicePublicKey.isFulfilledBy(charlieSignature.by) }
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `(Alice or Bob) fulfilled by either signature`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `(Alice or Bob) fulfilled by either signature`() {
|
||||
val aliceOrBob = CompositeKey.Builder().addKeys(alicePublicKey, bobPublicKey).build(threshold = 1)
|
||||
assertTrue { aliceOrBob.isFulfilledBy(aliceSignature.by) }
|
||||
assertTrue { aliceOrBob.isFulfilledBy(bobSignature.by) }
|
||||
@ -64,23 +64,23 @@ class CompositeKeyTests {
|
||||
assertFalse { aliceOrBob.isFulfilledBy(charlieSignature.by) }
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `(Alice and Bob) fulfilled by Alice, Bob signatures`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `(Alice and Bob) fulfilled by Alice, Bob signatures`() {
|
||||
val aliceAndBob = CompositeKey.Builder().addKeys(alicePublicKey, bobPublicKey).build()
|
||||
val signatures = listOf(aliceSignature, bobSignature)
|
||||
assertTrue { aliceAndBob.isFulfilledBy(signatures.byKeys()) }
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `(Alice and Bob) requires both signatures to fulfil`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `(Alice and Bob) requires both signatures to fulfil`() {
|
||||
val aliceAndBob = CompositeKey.Builder().addKeys(alicePublicKey, bobPublicKey).build()
|
||||
assertFalse { aliceAndBob.isFulfilledBy(listOf(aliceSignature).byKeys()) }
|
||||
assertFalse { aliceAndBob.isFulfilledBy(listOf(bobSignature).byKeys()) }
|
||||
assertTrue { aliceAndBob.isFulfilledBy(listOf(aliceSignature, bobSignature).byKeys()) }
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `((Alice and Bob) or Charlie) signature verifies`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `((Alice and Bob) or Charlie) signature verifies`() {
|
||||
// TODO: Look into a DSL for building multi-level composite keys if that becomes a common use case
|
||||
val aliceAndBob = CompositeKey.Builder().addKeys(alicePublicKey, bobPublicKey).build()
|
||||
val aliceAndBobOrCharlie = CompositeKey.Builder().addKeys(aliceAndBob, charliePublicKey).build(threshold = 1)
|
||||
@ -90,8 +90,8 @@ class CompositeKeyTests {
|
||||
assertTrue { aliceAndBobOrCharlie.isFulfilledBy(signatures.byKeys()) }
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `encoded tree decodes correctly`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `encoded tree decodes correctly`() {
|
||||
val aliceAndBob = CompositeKey.Builder().addKeys(alicePublicKey, bobPublicKey).build()
|
||||
val aliceAndBobOrCharlie = CompositeKey.Builder().addKeys(aliceAndBob, charliePublicKey).build(threshold = 1)
|
||||
|
||||
@ -101,8 +101,8 @@ class CompositeKeyTests {
|
||||
assertEquals(decoded, aliceAndBobOrCharlie)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `der encoded tree decodes correctly`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `der encoded tree decodes correctly`() {
|
||||
val aliceAndBob = CompositeKey.Builder().addKeys(alicePublicKey, bobPublicKey).build()
|
||||
val aliceAndBobOrCharlie = CompositeKey.Builder().addKeys(aliceAndBob, charliePublicKey).build(threshold = 1)
|
||||
|
||||
@ -112,8 +112,8 @@ class CompositeKeyTests {
|
||||
assertEquals(decoded, aliceAndBobOrCharlie)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `der encoded tree decodes correctly with weighting`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `der encoded tree decodes correctly with weighting`() {
|
||||
val aliceAndBob = CompositeKey.Builder()
|
||||
.addKey(alicePublicKey, 2)
|
||||
.addKey(bobPublicKey, 1)
|
||||
@ -130,8 +130,8 @@ class CompositeKeyTests {
|
||||
assertEquals(decoded, aliceAndBobOrCharlie)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `tree canonical form`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `tree canonical form`() {
|
||||
assertEquals(CompositeKey.Builder().addKeys(alicePublicKey).build(), alicePublicKey)
|
||||
val node1 = CompositeKey.Builder().addKeys(alicePublicKey, bobPublicKey).build(1) // threshold = 1
|
||||
val node2 = CompositeKey.Builder().addKeys(alicePublicKey, bobPublicKey).build(2) // threshold = 2
|
||||
@ -160,8 +160,8 @@ class CompositeKeyTests {
|
||||
/**
|
||||
* Check that verifying a composite signature using the [CompositeSignature] engine works.
|
||||
*/
|
||||
@Test
|
||||
fun `composite TransactionSignature verification `() {
|
||||
@Test(timeout=300_000)
|
||||
fun `composite TransactionSignature verification `() {
|
||||
val twoOfThree = CompositeKey.Builder().addKeys(alicePublicKey, bobPublicKey, charliePublicKey).build(threshold = 2)
|
||||
|
||||
val engine = CompositeSignature()
|
||||
@ -289,8 +289,8 @@ class CompositeKeyTests {
|
||||
key1.checkValidity()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `CompositeKey from multiple signature schemes and signature verification`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `CompositeKey from multiple signature schemes and signature verification`() {
|
||||
val keyPairRSA = Crypto.generateKeyPair(Crypto.RSA_SHA256)
|
||||
val keyPairK1 = Crypto.generateKeyPair(Crypto.ECDSA_SECP256K1_SHA256)
|
||||
val keyPairR1 = Crypto.generateKeyPair(Crypto.ECDSA_SECP256R1_SHA256)
|
||||
@ -313,8 +313,8 @@ class CompositeKeyTests {
|
||||
assertFalse { compositeKey.isFulfilledBy(signaturesWithoutRSA.byKeys()) }
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Test save to keystore`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Test save to keystore`() {
|
||||
// From test case [CompositeKey from multiple signature schemes and signature verification]
|
||||
val keyPairRSA = Crypto.generateKeyPair(Crypto.RSA_SHA256)
|
||||
val keyPairK1 = Crypto.generateKeyPair(Crypto.ECDSA_SECP256K1_SHA256)
|
||||
@ -367,8 +367,8 @@ class CompositeKeyTests {
|
||||
assertEquals(compositeKey, compositeKey2)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `CompositeKey deterministic children sorting`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `CompositeKey deterministic children sorting`() {
|
||||
val (_, pub1) = Crypto.generateKeyPair(Crypto.EDDSA_ED25519_SHA512)
|
||||
val (_, pub2) = Crypto.generateKeyPair(Crypto.ECDSA_SECP256K1_SHA256)
|
||||
val (_, pub3) = Crypto.generateKeyPair(Crypto.RSA_SHA256)
|
||||
|
@ -100,25 +100,25 @@ class PartialMerkleTreeTest {
|
||||
}
|
||||
|
||||
// Building full Merkle Tree tests.
|
||||
@Test
|
||||
fun `building Merkle tree with 6 nodes - no rightmost nodes`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `building Merkle tree with 6 nodes - no rightmost nodes`() {
|
||||
assertEquals(expectedRoot, merkleTree.hash)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `building Merkle tree - no hashes`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `building Merkle tree - no hashes`() {
|
||||
assertFailsWith<MerkleTreeException> { MerkleTree.getMerkleTree(emptyList()) }
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `building Merkle tree one node`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `building Merkle tree one node`() {
|
||||
val node = 'a'.serialize().sha256()
|
||||
val mt = MerkleTree.getMerkleTree(listOf(node))
|
||||
assertEquals(node, mt.hash)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `building Merkle tree odd number of nodes`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `building Merkle tree odd number of nodes`() {
|
||||
val odd = hashed.subList(0, 3)
|
||||
val h1 = hashed[0].hashConcat(hashed[1])
|
||||
val h2 = hashed[2].hashConcat(zeroHash)
|
||||
@ -127,8 +127,8 @@ class PartialMerkleTreeTest {
|
||||
assertEquals(mt.hash, expected)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `check full tree`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `check full tree`() {
|
||||
val h = SecureHash.randomSHA256()
|
||||
val left = MerkleTree.Node(h, MerkleTree.Node(h, MerkleTree.Leaf(h), MerkleTree.Leaf(h)),
|
||||
MerkleTree.Node(h, MerkleTree.Leaf(h), MerkleTree.Leaf(h)))
|
||||
@ -139,8 +139,8 @@ class PartialMerkleTreeTest {
|
||||
PartialMerkleTree.build(MerkleTree.Leaf(h), listOf(h)) // Just a leaf.
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `building Merkle tree for a tx and nonce test`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `building Merkle tree for a tx and nonce test`() {
|
||||
fun filtering(elem: Any): Boolean {
|
||||
return when (elem) {
|
||||
is StateRef -> true
|
||||
@ -171,8 +171,8 @@ class PartialMerkleTreeTest {
|
||||
ftx.verify()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `same transactions with different notaries have different ids`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `same transactions with different notaries have different ids`() {
|
||||
// We even use the same privacySalt, and thus the only difference between the two transactions is the notary party.
|
||||
val privacySalt = PrivacySalt()
|
||||
val wtx1 = makeSimpleCashWtx(DUMMY_NOTARY, privacySalt)
|
||||
@ -181,8 +181,8 @@ class PartialMerkleTreeTest {
|
||||
assertNotEquals(wtx1.id, wtx2.id)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `nothing filtered`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `nothing filtered`() {
|
||||
val ftxNothing = testTx.buildFilteredTransaction(Predicate { false })
|
||||
assertTrue(ftxNothing.componentGroups.isEmpty())
|
||||
assertTrue(ftxNothing.attachments.isEmpty())
|
||||
@ -197,57 +197,57 @@ class PartialMerkleTreeTest {
|
||||
}
|
||||
|
||||
// Partial Merkle Tree building tests.
|
||||
@Test
|
||||
fun `build Partial Merkle Tree, only left nodes branch`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `build Partial Merkle Tree, only left nodes branch`() {
|
||||
val inclHashes = listOf(hashed[3], hashed[5])
|
||||
val pmt = PartialMerkleTree.build(merkleTree, inclHashes)
|
||||
assertTrue(pmt.verify(merkleTree.hash, inclHashes))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `build Partial Merkle Tree, include zero leaves`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `build Partial Merkle Tree, include zero leaves`() {
|
||||
val pmt = PartialMerkleTree.build(merkleTree, emptyList())
|
||||
assertTrue(pmt.verify(merkleTree.hash, emptyList()))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `build Partial Merkle Tree, include all leaves`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `build Partial Merkle Tree, include all leaves`() {
|
||||
val pmt = PartialMerkleTree.build(merkleTree, hashed)
|
||||
assertTrue(pmt.verify(merkleTree.hash, hashed))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `build Partial Merkle Tree - duplicate leaves failure`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `build Partial Merkle Tree - duplicate leaves failure`() {
|
||||
val inclHashes = arrayListOf(hashed[3], hashed[5], hashed[3], hashed[5])
|
||||
assertFailsWith<MerkleTreeException> { PartialMerkleTree.build(merkleTree, inclHashes) }
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `build Partial Merkle Tree - only duplicate leaves, less included failure`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `build Partial Merkle Tree - only duplicate leaves, less included failure`() {
|
||||
val leaves = "aaa"
|
||||
val hashes = leaves.map { it.serialize().hash }
|
||||
val mt = MerkleTree.getMerkleTree(hashes)
|
||||
assertFailsWith<MerkleTreeException> { PartialMerkleTree.build(mt, hashes.subList(0, 1)) }
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `verify Partial Merkle Tree - too many leaves failure`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `verify Partial Merkle Tree - too many leaves failure`() {
|
||||
val inclHashes = arrayListOf(hashed[3], hashed[5])
|
||||
val pmt = PartialMerkleTree.build(merkleTree, inclHashes)
|
||||
inclHashes.add(hashed[0])
|
||||
assertFalse(pmt.verify(merkleTree.hash, inclHashes))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `verify Partial Merkle Tree - too little leaves failure`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `verify Partial Merkle Tree - too little leaves failure`() {
|
||||
val inclHashes = arrayListOf(hashed[3], hashed[5], hashed[0])
|
||||
val pmt = PartialMerkleTree.build(merkleTree, inclHashes)
|
||||
inclHashes.remove(hashed[0])
|
||||
assertFalse(pmt.verify(merkleTree.hash, inclHashes))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `verify Partial Merkle Tree - duplicate leaves failure`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `verify Partial Merkle Tree - duplicate leaves failure`() {
|
||||
val mt = MerkleTree.getMerkleTree(hashed.subList(0, 5)) // Odd number of leaves. Last one is duplicated.
|
||||
val inclHashes = arrayListOf(hashed[3], hashed[4])
|
||||
val pmt = PartialMerkleTree.build(mt, inclHashes)
|
||||
@ -255,15 +255,15 @@ class PartialMerkleTreeTest {
|
||||
assertFalse(pmt.verify(mt.hash, inclHashes))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `verify Partial Merkle Tree - different leaves failure`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `verify Partial Merkle Tree - different leaves failure`() {
|
||||
val inclHashes = arrayListOf(hashed[3], hashed[5])
|
||||
val pmt = PartialMerkleTree.build(merkleTree, inclHashes)
|
||||
assertFalse(pmt.verify(merkleTree.hash, listOf(hashed[2], hashed[4])))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `verify Partial Merkle Tree - wrong root`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `verify Partial Merkle Tree - wrong root`() {
|
||||
val inclHashes = listOf(hashed[3], hashed[5])
|
||||
val pmt = PartialMerkleTree.build(merkleTree, inclHashes)
|
||||
val wrongRoot = hashed[3].hashConcat(hashed[5])
|
||||
@ -293,8 +293,8 @@ class PartialMerkleTreeTest {
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Find leaf index`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Find leaf index`() {
|
||||
// A Merkle tree with 20 leaves.
|
||||
val sampleLeaves = IntStream.rangeClosed(0, 19).toList().map { SecureHash.sha256(it.toString()) }
|
||||
val merkleTree = MerkleTree.getMerkleTree(sampleLeaves)
|
||||
@ -339,8 +339,8 @@ class PartialMerkleTreeTest {
|
||||
assertFailsWith<MerkleTreeException> { pmtAllIncluded.leafIndex(SecureHash.sha256("30")) }
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `building Merkle for reference states only`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `building Merkle for reference states only`() {
|
||||
fun filtering(elem: Any): Boolean {
|
||||
return when (elem) {
|
||||
is ReferenceStateRef -> true
|
||||
|
@ -25,8 +25,8 @@ class SignedDataTest {
|
||||
val data = "Just a simple test string"
|
||||
lateinit var serialized: SerializedBytes<String>
|
||||
|
||||
@Test
|
||||
fun `make sure correctly signed data is released`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `make sure correctly signed data is released`() {
|
||||
val keyPair = generateKeyPair()
|
||||
val sig = keyPair.private.sign(serialized.bytes, keyPair.public)
|
||||
val wrappedData = SignedData(serialized, sig)
|
||||
|
@ -21,8 +21,8 @@ class TransactionSignatureTest {
|
||||
private val testBytes = "12345678901234567890123456789012".toByteArray()
|
||||
|
||||
/** Valid sign and verify. */
|
||||
@Test
|
||||
fun `Signature metadata full sign and verify`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Signature metadata full sign and verify`() {
|
||||
val keyPair = Crypto.generateKeyPair("ECDSA_SECP256K1_SHA256")
|
||||
|
||||
// Create a SignableData object.
|
||||
@ -47,8 +47,8 @@ class TransactionSignatureTest {
|
||||
Crypto.doVerify((testBytes + testBytes).sha256(), transactionSignature)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Verify multi-tx signature`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Verify multi-tx signature`() {
|
||||
val keyPair = Crypto.deriveKeyPairFromEntropy(Crypto.EDDSA_ED25519_SHA512, BigInteger.valueOf(1234567890L))
|
||||
// Deterministically create 5 txIds.
|
||||
val txIds: List<SecureHash> = IntRange(0, 4).map { byteArrayOf(it.toByte()).sha256() }
|
||||
@ -94,8 +94,8 @@ class TransactionSignatureTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Verify one-tx signature`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Verify one-tx signature`() {
|
||||
val keyPair = Crypto.deriveKeyPairFromEntropy(Crypto.EDDSA_ED25519_SHA512, BigInteger.valueOf(1234567890L))
|
||||
val txId = "aTransaction".toByteArray().sha256()
|
||||
// One-tx signature.
|
||||
|
@ -57,8 +57,8 @@ class X509NameConstraintsTest {
|
||||
return Pair(keyStore, trustStore)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `illegal common name`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `illegal common name`() {
|
||||
val acceptableNames = listOf("CN=Bank A TLS, O=Bank A", "CN=Bank A")
|
||||
.map { GeneralSubtree(GeneralName(X500Name(it))) }.toTypedArray()
|
||||
|
||||
@ -92,8 +92,8 @@ class X509NameConstraintsTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `x500 name with correct cn and extra attribute`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `x500 name with correct cn and extra attribute`() {
|
||||
val acceptableNames = listOf("CN=Bank A TLS, UID=", "O=Bank A")
|
||||
.map { GeneralSubtree(GeneralName(X500Name(it))) }.toTypedArray()
|
||||
|
||||
@ -135,8 +135,8 @@ class X509NameConstraintsTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `test private key retrieval`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `test private key retrieval`() {
|
||||
val acceptableNames = listOf("CN=Bank A TLS, UID=", "O=Bank A")
|
||||
.map { GeneralSubtree(GeneralName(X500Name(it))) }.toTypedArray()
|
||||
|
||||
|
@ -45,8 +45,8 @@ class AttachmentTests : WithMockNet {
|
||||
private val bobNode = makeNode(BOB_NAME)
|
||||
private val alice = aliceNode.info.singleIdentity()
|
||||
|
||||
@Test
|
||||
fun `download and store`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `download and store`() {
|
||||
// Insert an attachment into node zero's store directly.
|
||||
val id = aliceNode.importAttachment(fakeAttachment("file1.txt", "Some useful content"))
|
||||
|
||||
@ -67,8 +67,8 @@ class AttachmentTests : WithMockNet {
|
||||
willReturn(soleAttachment(attachment)))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun missing() {
|
||||
@Test(timeout=300_000)
|
||||
fun missing() {
|
||||
val hash: SecureHash = SecureHash.randomSHA256()
|
||||
|
||||
// Get node one to fetch a non-existent attachment.
|
||||
@ -82,8 +82,8 @@ class AttachmentTests : WithMockNet {
|
||||
FetchDataFlow.HashNotFound::requested,
|
||||
equalTo(expected))
|
||||
|
||||
@Test
|
||||
fun maliciousResponse() {
|
||||
@Test(timeout=300_000)
|
||||
fun maliciousResponse() {
|
||||
// Make a node that doesn't do sanity checking at load time.
|
||||
val badAliceNode = makeBadNode(ALICE_NAME)
|
||||
val badAlice = badAliceNode.info.singleIdentity()
|
||||
|
@ -67,8 +67,8 @@ class CollectSignaturesFlowTests : WithContracts {
|
||||
private val bob = bobNode.info.singleIdentity()
|
||||
private val charlie = charlieNode.info.singleIdentity()
|
||||
|
||||
@Test
|
||||
fun `successfully collects three signatures`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `successfully collects three signatures`() {
|
||||
val bConfidentialIdentity = bobNode.createConfidentialIdentity(bob)
|
||||
aliceNode.verifyAndRegister(bConfidentialIdentity)
|
||||
|
||||
@ -78,8 +78,8 @@ class CollectSignaturesFlowTests : WithContracts {
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `successfully collects signatures when sessions are initiated with AnonymousParty`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `successfully collects signatures when sessions are initiated with AnonymousParty`() {
|
||||
val aConfidentialIdentity1 = aliceNode.createConfidentialIdentity(alice)
|
||||
val bConfidentialIdentity1 = bobNode.createConfidentialIdentity(bob)
|
||||
val bConfidentialIdentity2 = bobNode.createConfidentialIdentity(bob)
|
||||
@ -97,8 +97,8 @@ class CollectSignaturesFlowTests : WithContracts {
|
||||
Assert.assertThat(missingSigners, `is`(emptySet()))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `successfully collects signatures when sessions are initiated with both AnonymousParty and WellKnownParty`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `successfully collects signatures when sessions are initiated with both AnonymousParty and WellKnownParty`() {
|
||||
val aConfidentialIdentity1 = aliceNode.createConfidentialIdentity(alice)
|
||||
val bConfidentialIdentity1 = bobNode.createConfidentialIdentity(bob)
|
||||
val bConfidentialIdentity2 = bobNode.createConfidentialIdentity(bob)
|
||||
@ -142,8 +142,8 @@ class CollectSignaturesFlowTests : WithContracts {
|
||||
future.getOrThrow()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `it is possible to collect from multiple well known sessions`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `it is possible to collect from multiple well known sessions`() {
|
||||
bobNode.registerInitiatedFlow(ExtraSessionsFlowResponder::class.java)
|
||||
charlieNode.registerInitiatedFlow(ExtraSessionsFlowResponder::class.java)
|
||||
val future = aliceNode.startFlow(ExtraSessionsFlow(listOf(
|
||||
@ -157,8 +157,8 @@ class CollectSignaturesFlowTests : WithContracts {
|
||||
Assert.assertThat(signedTx.getMissingSigners(), `is`(emptySet()))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `no need to collect any signatures`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `no need to collect any signatures`() {
|
||||
val ptx = aliceNode.signDummyContract(alice.ref(1))
|
||||
|
||||
assertThat(
|
||||
@ -167,8 +167,8 @@ class CollectSignaturesFlowTests : WithContracts {
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `fails when not signed by initiator`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `fails when not signed by initiator`() {
|
||||
val ptx = miniCorpServices.signDummyContract(alice.ref(1))
|
||||
|
||||
assertThat(
|
||||
@ -176,8 +176,8 @@ class CollectSignaturesFlowTests : WithContracts {
|
||||
willThrow(errorMessage("The Initiator of CollectSignaturesFlow must have signed the transaction.")))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `passes with multiple initial signatures`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `passes with multiple initial signatures`() {
|
||||
val signedByA = aliceNode.signDummyContract(
|
||||
alice.ref(1),
|
||||
MAGIC_NUMBER,
|
||||
|
@ -42,8 +42,8 @@ class ContractUpgradeFlowRPCTest : WithContracts, WithFinality {
|
||||
private val alice = aliceNode.info.singleIdentity()
|
||||
private val bob = bobNode.info.singleIdentity()
|
||||
|
||||
@Test
|
||||
fun `2 parties contract upgrade using RPC`() = rpcDriver {
|
||||
@Test(timeout=300_000)
|
||||
fun `2 parties contract upgrade using RPC`() = rpcDriver {
|
||||
val testUser = createTestUser()
|
||||
val rpcA = startProxy(aliceNode, testUser)
|
||||
val rpcB = startProxy(bobNode, testUser)
|
||||
|
@ -46,8 +46,8 @@ class ContractUpgradeFlowTest : WithContracts, WithFinality {
|
||||
private val bob = bobNode.info.singleIdentity()
|
||||
private val notary = mockNet.defaultNotaryIdentity
|
||||
|
||||
@Test
|
||||
fun `2 parties contract upgrade`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `2 parties contract upgrade`() {
|
||||
// Create dummy contract.
|
||||
val signedByA = aliceNode.signDummyContract(alice.ref(1), 0, bob.ref(1))
|
||||
val stx = bobNode.addSignatureTo(signedByA)
|
||||
@ -116,8 +116,8 @@ class ContractUpgradeFlowTest : WithContracts, WithFinality {
|
||||
{ it.state.data },
|
||||
expectation)
|
||||
|
||||
@Test
|
||||
fun `upgrade Cash to v2`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `upgrade Cash to v2`() {
|
||||
// Create some cash.
|
||||
val cashFlowResult = aliceNode.issueCash()
|
||||
val anonymisedRecipient = cashFlowResult.recipient!!
|
||||
|
@ -31,8 +31,8 @@ class FastThreadLocalTest {
|
||||
|
||||
private val expensiveObjCount = AtomicInteger()
|
||||
|
||||
@Test
|
||||
fun `ThreadLocal with plain old Thread is fiber-local`() = scheduled(3, ::Thread) {
|
||||
@Test(timeout=300_000)
|
||||
fun `ThreadLocal with plain old Thread is fiber-local`() = scheduled(3, ::Thread) {
|
||||
val threadLocal = object : ThreadLocal<ExpensiveObj>() {
|
||||
override fun initialValue() = ExpensiveObj()
|
||||
}
|
||||
@ -40,8 +40,8 @@ class FastThreadLocalTest {
|
||||
assertEquals(100, expensiveObjCount.get())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `ThreadLocal with FastThreadLocalThread is fiber-local`() = scheduled(3, ::FastThreadLocalThread) {
|
||||
@Test(timeout=300_000)
|
||||
fun `ThreadLocal with FastThreadLocalThread is fiber-local`() = scheduled(3, ::FastThreadLocalThread) {
|
||||
val threadLocal = object : ThreadLocal<ExpensiveObj>() {
|
||||
override fun initialValue() = ExpensiveObj()
|
||||
}
|
||||
@ -49,8 +49,8 @@ class FastThreadLocalTest {
|
||||
assertEquals(100, expensiveObjCount.get())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `FastThreadLocal with plain old Thread is fiber-local`() = scheduled(3, ::Thread) {
|
||||
@Test(timeout=300_000)
|
||||
fun `FastThreadLocal with plain old Thread is fiber-local`() = scheduled(3, ::Thread) {
|
||||
val threadLocal = object : FastThreadLocal<ExpensiveObj>() {
|
||||
override fun initialValue() = ExpensiveObj()
|
||||
}
|
||||
@ -58,8 +58,8 @@ class FastThreadLocalTest {
|
||||
assertEquals(100, expensiveObjCount.get())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `FastThreadLocal with FastThreadLocalThread is not fiber-local`() =
|
||||
@Test(timeout=300_000)
|
||||
fun `FastThreadLocal with FastThreadLocalThread is not fiber-local`() =
|
||||
scheduled(3, ::FastThreadLocalThread) {
|
||||
val threadLocal = object : FastThreadLocal<ExpensiveObj>() {
|
||||
override fun initialValue() = ExpensiveObj()
|
||||
@ -89,15 +89,15 @@ class FastThreadLocalTest {
|
||||
private val fail: Nothing by lazy { throw UnsupportedOperationException("Nice try.") }
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `ThreadLocal content is not serialized`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `ThreadLocal content is not serialized`() {
|
||||
contentIsNotSerialized(object : ThreadLocal<UnserializableObj>() {
|
||||
override fun initialValue() = UnserializableObj()
|
||||
}::get)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `FastThreadLocal content is not serialized`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `FastThreadLocal content is not serialized`() {
|
||||
contentIsNotSerialized(object : FastThreadLocal<UnserializableObj>() {
|
||||
override fun initialValue() = UnserializableObj()
|
||||
}::get)
|
||||
|
@ -34,8 +34,8 @@ class FinalityFlowTests : WithFinality {
|
||||
@After
|
||||
fun tearDown() = mockNet.stopNodes()
|
||||
|
||||
@Test
|
||||
fun `finalise a simple transaction`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `finalise a simple transaction`() {
|
||||
val bob = createBob()
|
||||
val stx = aliceNode.issuesCashTo(bob)
|
||||
|
||||
@ -46,8 +46,8 @@ class FinalityFlowTests : WithFinality {
|
||||
and visibleTo(bob)))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `reject a transaction with unknown parties`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `reject a transaction with unknown parties`() {
|
||||
// Charlie isn't part of this network, so node A won't recognise them
|
||||
val stx = aliceNode.issuesCashTo(CHARLIE)
|
||||
|
||||
@ -56,8 +56,8 @@ class FinalityFlowTests : WithFinality {
|
||||
willThrow<IllegalArgumentException>())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `allow use of the old API if the CorDapp target version is 3`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `allow use of the old API if the CorDapp target version is 3`() {
|
||||
val oldBob = createBob(cordapps = listOf(tokenOldCordapp()))
|
||||
val stx = aliceNode.issuesCashTo(oldBob)
|
||||
val resultFuture = CordappResolver.withTestCordapp(targetPlatformVersion = 3) {
|
||||
@ -68,8 +68,8 @@ class FinalityFlowTests : WithFinality {
|
||||
assertThat(oldBob.services.validatedTransactions.getTransaction(stx.id)).isNotNull()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `broadcasting to both new and old participants`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `broadcasting to both new and old participants`() {
|
||||
val newCharlie = mockNet.createNode(InternalMockNodeParameters(legalName = CHARLIE_NAME))
|
||||
val oldBob = createBob(cordapps = listOf(tokenOldCordapp()))
|
||||
val stx = aliceNode.issuesCashTo(oldBob)
|
||||
|
@ -28,8 +28,8 @@ import kotlin.test.assertTrue
|
||||
|
||||
class FlowExternalAsyncOperationTest : AbstractFlowExternalOperationTest() {
|
||||
|
||||
@Test
|
||||
fun `external async operation`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `external async operation`() {
|
||||
driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) {
|
||||
val alice = startNode(providedName = ALICE_NAME).getOrThrow()
|
||||
val bob = startNode(providedName = BOB_NAME).getOrThrow()
|
||||
@ -41,8 +41,8 @@ class FlowExternalAsyncOperationTest : AbstractFlowExternalOperationTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `external async operation that checks deduplicationId is not rerun when flow is retried`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `external async operation that checks deduplicationId is not rerun when flow is retried`() {
|
||||
driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) {
|
||||
val alice = startNode(providedName = ALICE_NAME).getOrThrow()
|
||||
val bob = startNode(providedName = BOB_NAME).getOrThrow()
|
||||
@ -58,8 +58,8 @@ class FlowExternalAsyncOperationTest : AbstractFlowExternalOperationTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `external async operation propagates exception to calling flow`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `external async operation propagates exception to calling flow`() {
|
||||
driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) {
|
||||
val alice = startNode(providedName = ALICE_NAME).getOrThrow()
|
||||
val bob = startNode(providedName = BOB_NAME).getOrThrow()
|
||||
@ -76,8 +76,8 @@ class FlowExternalAsyncOperationTest : AbstractFlowExternalOperationTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `external async operation exception can be caught in flow`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `external async operation exception can be caught in flow`() {
|
||||
driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) {
|
||||
val alice = startNode(providedName = ALICE_NAME).getOrThrow()
|
||||
val bob = startNode(providedName = BOB_NAME).getOrThrow()
|
||||
@ -92,8 +92,8 @@ class FlowExternalAsyncOperationTest : AbstractFlowExternalOperationTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `external async operation with exception that hospital keeps for observation does not fail`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `external async operation with exception that hospital keeps for observation does not fail`() {
|
||||
driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) {
|
||||
val alice = startNode(providedName = ALICE_NAME).getOrThrow()
|
||||
val bob = startNode(providedName = BOB_NAME).getOrThrow()
|
||||
@ -110,8 +110,8 @@ class FlowExternalAsyncOperationTest : AbstractFlowExternalOperationTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `external async operation with exception that hospital discharges is retried and runs the future again`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `external async operation with exception that hospital discharges is retried and runs the future again`() {
|
||||
driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) {
|
||||
val alice = startNode(providedName = ALICE_NAME).getOrThrow()
|
||||
val bob = startNode(providedName = BOB_NAME).getOrThrow()
|
||||
@ -128,8 +128,8 @@ class FlowExternalAsyncOperationTest : AbstractFlowExternalOperationTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `external async operation that throws exception rather than completing future exceptionally fails with internal exception`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `external async operation that throws exception rather than completing future exceptionally fails with internal exception`() {
|
||||
driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) {
|
||||
val alice = startNode(providedName = ALICE_NAME).getOrThrow()
|
||||
val bob = startNode(providedName = BOB_NAME).getOrThrow()
|
||||
@ -143,8 +143,8 @@ class FlowExternalAsyncOperationTest : AbstractFlowExternalOperationTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `external async operation that passes serviceHub into process can be retried`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `external async operation that passes serviceHub into process can be retried`() {
|
||||
driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) {
|
||||
val alice = startNode(providedName = ALICE_NAME).getOrThrow()
|
||||
val bob = startNode(providedName = BOB_NAME).getOrThrow()
|
||||
@ -160,8 +160,8 @@ class FlowExternalAsyncOperationTest : AbstractFlowExternalOperationTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `external async operation that accesses serviceHub from flow directly will fail when retried`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `external async operation that accesses serviceHub from flow directly will fail when retried`() {
|
||||
driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) {
|
||||
val alice = startNode(providedName = ALICE_NAME).getOrThrow()
|
||||
val bob = startNode(providedName = BOB_NAME).getOrThrow()
|
||||
@ -177,8 +177,8 @@ class FlowExternalAsyncOperationTest : AbstractFlowExternalOperationTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `starting multiple futures and joining on their results`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `starting multiple futures and joining on their results`() {
|
||||
driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) {
|
||||
val alice = startNode(providedName = ALICE_NAME).getOrThrow()
|
||||
val bob = startNode(providedName = BOB_NAME).getOrThrow()
|
||||
|
@ -16,8 +16,8 @@ import kotlin.test.assertEquals
|
||||
|
||||
class FlowExternalOperationStartFlowTest : AbstractFlowExternalOperationTest() {
|
||||
|
||||
@Test
|
||||
fun `starting a flow inside of a flow that starts a future will succeed`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `starting a flow inside of a flow that starts a future will succeed`() {
|
||||
driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) {
|
||||
val alice = startNode(providedName = ALICE_NAME).getOrThrow()
|
||||
val bob = startNode(providedName = BOB_NAME).getOrThrow()
|
||||
@ -29,8 +29,8 @@ class FlowExternalOperationStartFlowTest : AbstractFlowExternalOperationTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `multiple flows can be started and their futures joined from inside a flow`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `multiple flows can be started and their futures joined from inside a flow`() {
|
||||
driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) {
|
||||
val alice = startNode(providedName = ALICE_NAME).getOrThrow()
|
||||
val bob = startNode(providedName = BOB_NAME).getOrThrow()
|
||||
|
@ -35,8 +35,8 @@ import kotlin.test.assertTrue
|
||||
|
||||
class FlowExternalOperationTest : AbstractFlowExternalOperationTest() {
|
||||
|
||||
@Test
|
||||
fun `external operation`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `external operation`() {
|
||||
driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) {
|
||||
val alice = startNode(providedName = ALICE_NAME).getOrThrow()
|
||||
val bob = startNode(providedName = BOB_NAME).getOrThrow()
|
||||
@ -48,8 +48,8 @@ class FlowExternalOperationTest : AbstractFlowExternalOperationTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `external operation that checks deduplicationId is not rerun when flow is retried`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `external operation that checks deduplicationId is not rerun when flow is retried`() {
|
||||
driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) {
|
||||
val alice = startNode(providedName = ALICE_NAME).getOrThrow()
|
||||
val bob = startNode(providedName = BOB_NAME).getOrThrow()
|
||||
@ -65,8 +65,8 @@ class FlowExternalOperationTest : AbstractFlowExternalOperationTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `external operation propagates exception to calling flow`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `external operation propagates exception to calling flow`() {
|
||||
driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) {
|
||||
val alice = startNode(providedName = ALICE_NAME).getOrThrow()
|
||||
val bob = startNode(providedName = BOB_NAME).getOrThrow()
|
||||
@ -83,8 +83,8 @@ class FlowExternalOperationTest : AbstractFlowExternalOperationTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `external operation exception can be caught in flow`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `external operation exception can be caught in flow`() {
|
||||
driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) {
|
||||
val alice = startNode(providedName = ALICE_NAME).getOrThrow()
|
||||
val bob = startNode(providedName = BOB_NAME).getOrThrow()
|
||||
@ -96,8 +96,8 @@ class FlowExternalOperationTest : AbstractFlowExternalOperationTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `external operation with exception that hospital keeps for observation does not fail`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `external operation with exception that hospital keeps for observation does not fail`() {
|
||||
driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) {
|
||||
val alice = startNode(providedName = ALICE_NAME).getOrThrow()
|
||||
val bob = startNode(providedName = BOB_NAME).getOrThrow()
|
||||
@ -114,8 +114,8 @@ class FlowExternalOperationTest : AbstractFlowExternalOperationTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `external operation with exception that hospital discharges is retried and runs the external operation again`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `external operation with exception that hospital discharges is retried and runs the external operation again`() {
|
||||
driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) {
|
||||
val alice = startNode(providedName = ALICE_NAME).getOrThrow()
|
||||
val bob = startNode(providedName = BOB_NAME).getOrThrow()
|
||||
@ -132,8 +132,8 @@ class FlowExternalOperationTest : AbstractFlowExternalOperationTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `external async operation that passes serviceHub into process can be retried`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `external async operation that passes serviceHub into process can be retried`() {
|
||||
driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) {
|
||||
val alice = startNode(providedName = ALICE_NAME).getOrThrow()
|
||||
val bob = startNode(providedName = BOB_NAME).getOrThrow()
|
||||
@ -149,8 +149,8 @@ class FlowExternalOperationTest : AbstractFlowExternalOperationTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `external async operation that accesses serviceHub from flow directly will fail when retried`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `external async operation that accesses serviceHub from flow directly will fail when retried`() {
|
||||
driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) {
|
||||
val alice = startNode(providedName = ALICE_NAME).getOrThrow()
|
||||
val bob = startNode(providedName = BOB_NAME).getOrThrow()
|
||||
@ -166,8 +166,8 @@ class FlowExternalOperationTest : AbstractFlowExternalOperationTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `vault can be queried`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `vault can be queried`() {
|
||||
driver(
|
||||
DriverParameters(
|
||||
cordappsForAllNodes = cordappsForPackages(DummyState::class.packageName),
|
||||
@ -181,8 +181,8 @@ class FlowExternalOperationTest : AbstractFlowExternalOperationTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `data can be persisted to node database via entity manager`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `data can be persisted to node database via entity manager`() {
|
||||
driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) {
|
||||
val alice = startNode(providedName = ALICE_NAME).getOrThrow()
|
||||
val success = alice.rpc.startFlow(::FlowWithExternalOperationThatPersistsViaEntityManager)
|
||||
@ -191,8 +191,8 @@ class FlowExternalOperationTest : AbstractFlowExternalOperationTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `data can be persisted to node database via jdbc session`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `data can be persisted to node database via jdbc session`() {
|
||||
driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) {
|
||||
val alice = startNode(providedName = ALICE_NAME).getOrThrow()
|
||||
val success = alice.rpc.startFlow(::FlowWithExternalOperationThatPersistsViaJdbcSession)
|
||||
@ -201,8 +201,8 @@ class FlowExternalOperationTest : AbstractFlowExternalOperationTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `data can be persisted to node database via servicehub database transaction`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `data can be persisted to node database via servicehub database transaction`() {
|
||||
driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) {
|
||||
val alice = startNode(providedName = ALICE_NAME).getOrThrow()
|
||||
val success = alice.rpc.startFlow(::FlowWithExternalOperationThatPersistsViaDatabaseTransaction)
|
||||
@ -211,8 +211,8 @@ class FlowExternalOperationTest : AbstractFlowExternalOperationTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `data can be persisted to node database in external operation and read from another process once finished`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `data can be persisted to node database in external operation and read from another process once finished`() {
|
||||
driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) {
|
||||
val alice = startNode(providedName = ALICE_NAME).getOrThrow()
|
||||
val success = alice.rpc.startFlow(::FlowWithExternalOperationThatPersistsToDatabaseAndReadsFromExternalOperation)
|
||||
@ -221,8 +221,8 @@ class FlowExternalOperationTest : AbstractFlowExternalOperationTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `external operation can be retried when an error occurs inside of database transaction`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `external operation can be retried when an error occurs inside of database transaction`() {
|
||||
driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) {
|
||||
val alice = startNode(providedName = ALICE_NAME).getOrThrow()
|
||||
val bob = startNode(providedName = BOB_NAME).getOrThrow()
|
||||
|
@ -32,8 +32,8 @@ class ReceiveMultipleFlowTests : WithMockNet {
|
||||
|
||||
private val nodes = (0..2).map { mockNet.createPartyNode() }
|
||||
|
||||
@Test
|
||||
fun showcase_flows_as_closures() {
|
||||
@Test(timeout=300_000)
|
||||
fun showcase_flows_as_closures() {
|
||||
val answer = 10.0
|
||||
val message = "Hello Ivan"
|
||||
|
||||
@ -66,8 +66,8 @@ class ReceiveMultipleFlowTests : WithMockNet {
|
||||
willReturn(answer as Any))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `receive all messages in parallel using map style`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `receive all messages in parallel using map style`() {
|
||||
val doubleValue = 5.0
|
||||
nodes[1].registerAnswer(AlgorithmDefinition::class, doubleValue)
|
||||
val stringValue = "Thriller"
|
||||
@ -78,8 +78,8 @@ class ReceiveMultipleFlowTests : WithMockNet {
|
||||
willReturn(doubleValue * stringValue.length))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `receive all messages in parallel using list style`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `receive all messages in parallel using list style`() {
|
||||
val value1 = 5.0
|
||||
nodes[1].registerAnswer(ParallelAlgorithmList::class, value1)
|
||||
val value2 = 6.0
|
||||
|
@ -33,8 +33,8 @@ class ReceiveFinalityFlowTest {
|
||||
mockNet.stopNodes()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `sent to flow hospital on error and retry on node restart`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `sent to flow hospital on error and retry on node restart`() {
|
||||
val alice = mockNet.createNode(InternalMockNodeParameters(legalName = ALICE_NAME, additionalCordapps = FINANCE_CORDAPPS))
|
||||
// Bob initially does not have the finance contracts CorDapp so that it can throw an exception in ReceiveFinalityFlow when receiving
|
||||
// the payment from Alice
|
||||
|
@ -44,8 +44,8 @@ class ReferencedStatesFlowTests {
|
||||
mockNet.stopNodes()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `with referenced states flow blocks until the reference state update is received`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `with referenced states flow blocks until the reference state update is received`() {
|
||||
// 1. Create reference state.
|
||||
val newRefTx = nodes[0].services.startFlow(CreateRefState()).resultFuture.getOrThrow()
|
||||
val newRefState = newRefTx.tx.outRefsOfType<RefState.State>().single()
|
||||
@ -70,8 +70,8 @@ class ReferencedStatesFlowTests {
|
||||
assertEquals(updatedRefState.ref, result.tx.references.single())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `check ref state is persisted when used in tx with relevant states`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `check ref state is persisted when used in tx with relevant states`() {
|
||||
// 1. Create a state to be used as a reference state. Don't share it.
|
||||
val newRefTx = nodes[0].services.startFlow(CreateRefState()).resultFuture.getOrThrow()
|
||||
val newRefState = newRefTx.tx.outRefsOfType<RefState.State>().single()
|
||||
@ -102,8 +102,8 @@ class ReferencedStatesFlowTests {
|
||||
assertEquals(newRefState, theReferencedStateAgain.states.single())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `check schema mappings are updated for reference states`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `check schema mappings are updated for reference states`() {
|
||||
// 1. Create a state to be used as a reference state. Don't share it.
|
||||
val newRefTx = nodes[0].services.startFlow(CreateRefState()).resultFuture.getOrThrow()
|
||||
val newRefState = newRefTx.tx.outRefsOfType<RefState.State>().single()
|
||||
@ -118,8 +118,8 @@ class ReferencedStatesFlowTests {
|
||||
assertEquals(2, allRefStates.states.size)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `check old ref state is consumed when update used in tx with relevant states`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `check old ref state is consumed when update used in tx with relevant states`() {
|
||||
// 1. Create a state to be used as a reference state. Don't share it.
|
||||
val newRefTx = nodes[0].services.startFlow(CreateRefState()).resultFuture.getOrThrow()
|
||||
val newRefState = newRefTx.tx.outRefsOfType<RefState.State>().single()
|
||||
@ -170,8 +170,8 @@ class ReferencedStatesFlowTests {
|
||||
assertEquals(Vault.StateStatus.CONSUMED, theOriginalReferencedStateOnNodeZero.statesMetadata.single().status)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `check consumed reference state is found if a transaction refers to it`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `check consumed reference state is found if a transaction refers to it`() {
|
||||
// 1. Create a state to be used as a reference state. Don't share it.
|
||||
val newRefTx = nodes[0].services.startFlow(CreateRefState()).resultFuture.getOrThrow()
|
||||
val newRefState = newRefTx.tx.outRefsOfType<RefState.State>().single()
|
||||
|
@ -24,14 +24,14 @@ class PartyAndCertificateTest {
|
||||
@JvmField
|
||||
val testSerialization = SerializationEnvironmentRule()
|
||||
|
||||
@Test
|
||||
fun `reject a path with no roles`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `reject a path with no roles`() {
|
||||
val path = X509Utilities.buildCertPath(DEV_ROOT_CA.certificate)
|
||||
assertFailsWith<IllegalArgumentException> { PartyAndCertificate(path) }
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `kryo serialisation`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `kryo serialisation`() {
|
||||
val original = getTestPartyAndCertificate(Party(
|
||||
CordaX500Name(organisation = "Test Corp", locality = "Madrid", country = "ES"),
|
||||
entropyToKeyPair(BigInteger.valueOf(83)).public))
|
||||
@ -41,8 +41,8 @@ class PartyAndCertificateTest {
|
||||
assertThat(copy.certificate).isEqualTo(original.certificate)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `jdk serialization`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `jdk serialization`() {
|
||||
val identity = getTestPartyAndCertificate(Party(
|
||||
CordaX500Name(organisation = "Test Corp", locality = "Madrid", country = "ES"),
|
||||
entropyToKeyPair(BigInteger.valueOf(83)).public))
|
||||
|
@ -11,8 +11,8 @@ import kotlin.test.assertEquals
|
||||
import kotlin.test.assertNotEquals
|
||||
|
||||
class PartyTest {
|
||||
@Test
|
||||
fun equality() {
|
||||
@Test(timeout=300_000)
|
||||
fun equality() {
|
||||
val key = entropyToKeyPair(BigInteger.valueOf(20170207L)).public
|
||||
val differentKey = entropyToKeyPair(BigInteger.valueOf(7201702L)).public
|
||||
val anonymousParty = AnonymousParty(key)
|
||||
|
@ -10,15 +10,15 @@ import javax.security.auth.x500.X500Principal
|
||||
import kotlin.test.*
|
||||
|
||||
class CertRoleTests {
|
||||
@Test
|
||||
fun `should deserialize valid value`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `should deserialize valid value`() {
|
||||
val expected = CertRole.DOORMAN_CA
|
||||
val actual = CertRole.getInstance(ASN1Integer(1L))
|
||||
assertEquals(expected, actual)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `should reject invalid values`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `should reject invalid values`() {
|
||||
// Below the lowest used value
|
||||
assertFailsWith<IllegalArgumentException> { CertRole.getInstance(ASN1Integer(0L)) }
|
||||
// Outside of the array size, but a valid integer
|
||||
@ -27,8 +27,8 @@ class CertRoleTests {
|
||||
assertFailsWith<IllegalArgumentException> { CertRole.getInstance(ASN1Integer(Integer.MAX_VALUE + 1L)) }
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `check cert roles verify for various cert hierarchies`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `check cert roles verify for various cert hierarchies`() {
|
||||
|
||||
// Testing for various certificate hierarchies (with or without NodeCA).
|
||||
// ROOT -> Intermediate Root -> Doorman -> NodeCA -> Legal Identity cert -> Confidential key cert
|
||||
|
@ -111,8 +111,8 @@ class NetworkParametersResolutionTest {
|
||||
return Pair(dummy1, dummy2)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `parameters all null`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `parameters all null`() {
|
||||
val (stx1, stx2) = makeTransactions(null, null)
|
||||
assertThat(stx1.networkParametersHash).isNull()
|
||||
assertThat(stx2.networkParametersHash).isNull()
|
||||
@ -126,8 +126,8 @@ class NetworkParametersResolutionTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `transaction chain out of order parameters`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `transaction chain out of order parameters`() {
|
||||
val hash2 = params2.serialize().hash
|
||||
val hash3 = params3.serialize().hash
|
||||
val (stx1, stx2) = makeTransactions(params3, params2)
|
||||
@ -151,8 +151,8 @@ class NetworkParametersResolutionTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `request parameters that are not in the storage`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `request parameters that are not in the storage`() {
|
||||
val hash1 = defaultParams.serialize().hash
|
||||
val hash2 = params2.serialize().hash
|
||||
// Create two transactions on megaCorpNode
|
||||
@ -175,8 +175,8 @@ class NetworkParametersResolutionTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `transaction chain out of order parameters with default`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `transaction chain out of order parameters with default`() {
|
||||
val hash3 = params3.serialize().hash
|
||||
// stx1 with epoch 3 -> stx2 with default epoch, which is 1
|
||||
val (stx1, stx2) = makeTransactions(params3, null)
|
||||
@ -196,8 +196,8 @@ class NetworkParametersResolutionTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `incorrect triangle of transactions`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `incorrect triangle of transactions`() {
|
||||
// stx1 with epoch 2, stx2 with epoch 1, stx3 with epoch 3
|
||||
// stx1 -> stx2, stx1 -> stx3, stx2 -> stx3
|
||||
val stx1 = makeTransactions(params2, null).first
|
||||
|
@ -84,8 +84,8 @@ class ResolveTransactionsFlowTest {
|
||||
// DOCEND 3
|
||||
|
||||
// DOCSTART 1
|
||||
@Test
|
||||
fun `resolve from two hashes`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `resolve from two hashes`() {
|
||||
val (stx1, stx2) = makeTransactions()
|
||||
val p = TestFlow(setOf(stx2.id), megaCorp)
|
||||
val future = miniCorpNode.startFlow(p)
|
||||
@ -98,8 +98,8 @@ class ResolveTransactionsFlowTest {
|
||||
}
|
||||
// DOCEND 1
|
||||
|
||||
@Test
|
||||
fun `dependency with an error`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `dependency with an error`() {
|
||||
val stx = makeTransactions(signFirstTX = false).second
|
||||
val p = TestFlow(setOf(stx.id), megaCorp)
|
||||
val future = miniCorpNode.startFlow(p)
|
||||
@ -107,8 +107,8 @@ class ResolveTransactionsFlowTest {
|
||||
assertFailsWith(SignedTransaction.SignaturesMissingException::class) { future.getOrThrow() }
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `resolve from a signed transaction`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `resolve from a signed transaction`() {
|
||||
val (stx1, stx2) = makeTransactions()
|
||||
val p = TestFlow(stx2, megaCorp)
|
||||
val future = miniCorpNode.startFlow(p)
|
||||
@ -121,8 +121,8 @@ class ResolveTransactionsFlowTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `triangle of transactions resolves fine`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `triangle of transactions resolves fine`() {
|
||||
val stx1 = makeTransactions().first
|
||||
|
||||
val stx2 = DummyContract.move(stx1.tx.outRef(0), miniCorp).let { builder ->
|
||||
@ -149,8 +149,8 @@ class ResolveTransactionsFlowTest {
|
||||
future.getOrThrow()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun attachment() {
|
||||
@Test(timeout=300_000)
|
||||
fun attachment() {
|
||||
fun makeJar(): InputStream {
|
||||
val bs = ByteArrayOutputStream()
|
||||
val jar = JarOutputStream(bs)
|
||||
@ -176,8 +176,8 @@ class ResolveTransactionsFlowTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Requesting a transaction while having the right to see it succeeds`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Requesting a transaction while having the right to see it succeeds`() {
|
||||
val (_, stx2) = makeTransactions()
|
||||
val p = TestNoRightsVendingFlow(miniCorp, toVend = stx2, toRequest = stx2)
|
||||
val future = megaCorpNode.startFlow(p)
|
||||
@ -185,8 +185,8 @@ class ResolveTransactionsFlowTest {
|
||||
future.getOrThrow()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Requesting a transaction without having the right to see it results in exception`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Requesting a transaction without having the right to see it results in exception`() {
|
||||
val (_, stx2) = makeTransactions()
|
||||
val (_, stx3) = makeTransactions()
|
||||
val p = TestNoRightsVendingFlow(miniCorp, toVend = stx2, toRequest = stx3)
|
||||
@ -195,8 +195,8 @@ class ResolveTransactionsFlowTest {
|
||||
assertFailsWith<FetchDataFlow.IllegalTransactionRequest> { future.getOrThrow() }
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Requesting a transaction twice results in exception`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Requesting a transaction twice results in exception`() {
|
||||
val (_, stx2) = makeTransactions()
|
||||
val p = TestResolveTwiceVendingFlow(miniCorp, stx2)
|
||||
val future = megaCorpNode.startFlow(p)
|
||||
@ -204,8 +204,8 @@ class ResolveTransactionsFlowTest {
|
||||
assertFailsWith<FetchDataFlow.IllegalTransactionRequest> { future.getOrThrow() }
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `resolution works when transaction in chain is already resolved`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `resolution works when transaction in chain is already resolved`() {
|
||||
val (tx1, tx2) = makeTransactions()
|
||||
miniCorpNode.transaction {
|
||||
miniCorpNode.services.recordTransactions(tx1)
|
||||
@ -217,8 +217,8 @@ class ResolveTransactionsFlowTest {
|
||||
future.getOrThrow()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `can resolve a chain of transactions containing a notary change transaction`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `can resolve a chain of transactions containing a notary change transaction`() {
|
||||
val tx = notaryChangeChain()
|
||||
var numUpdates = 0
|
||||
var notaryChangeTxSeen = false
|
||||
@ -234,8 +234,8 @@ class ResolveTransactionsFlowTest {
|
||||
assertTrue(notaryChangeTxSeen)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `can resolve a chain of transactions containing a contract upgrade transaction`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `can resolve a chain of transactions containing a contract upgrade transaction`() {
|
||||
val tx = contractUpgradeChain()
|
||||
var numUpdates = 0
|
||||
var upgradeTxSeen = false
|
||||
@ -252,8 +252,8 @@ class ResolveTransactionsFlowTest {
|
||||
}
|
||||
|
||||
// Used for checking larger chains resolve correctly. Note that this takes a long time to run, and so is not suitable for a CI gate.
|
||||
@Test
|
||||
@Ignore
|
||||
@Test(timeout=300_000)
|
||||
@Ignore
|
||||
fun `Can resolve large chain of transactions`() {
|
||||
val txToResolve = makeLargeTransactionChain(2500)
|
||||
val p = TestFlow(txToResolve, megaCorp)
|
||||
|
@ -43,8 +43,8 @@ class NetworkParametersTest {
|
||||
}
|
||||
|
||||
// Minimum Platform Version tests
|
||||
@Test
|
||||
fun `node shutdowns when on lower platform version than network`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `node shutdowns when on lower platform version than network`() {
|
||||
val alice = mockNet.createUnstartedNode(InternalMockNodeParameters(legalName = ALICE_NAME, forcedID = 100, version = MOCK_VERSION_INFO.copy(platformVersion = 1)))
|
||||
val aliceDirectory = mockNet.baseDirectory(100)
|
||||
val netParams = testNetworkParameters(
|
||||
@ -54,8 +54,8 @@ class NetworkParametersTest {
|
||||
assertThatThrownBy { alice.start() }.hasMessageContaining("platform version")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `node works fine when on higher platform version`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `node works fine when on higher platform version`() {
|
||||
val alice = mockNet.createUnstartedNode(InternalMockNodeParameters(legalName = ALICE_NAME, forcedID = 100, version = MOCK_VERSION_INFO.copy(platformVersion = 2)))
|
||||
val aliceDirectory = mockNet.baseDirectory(100)
|
||||
val netParams = testNetworkParameters(
|
||||
@ -65,8 +65,8 @@ class NetworkParametersTest {
|
||||
alice.start()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `that we can copy while preserving the event horizon`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `that we can copy while preserving the event horizon`() {
|
||||
// this is defensive tests in response to CORDA-2769
|
||||
val aliceNotaryParty = TestIdentity(ALICE_NAME).party
|
||||
val aliceNotaryInfo = NotaryInfo(aliceNotaryParty, false)
|
||||
@ -94,8 +94,8 @@ class NetworkParametersTest {
|
||||
}
|
||||
|
||||
// Notaries tests
|
||||
@Test
|
||||
fun `choosing notary not specified in network parameters will fail`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `choosing notary not specified in network parameters will fail`() {
|
||||
val fakeNotary = mockNet.createNode(
|
||||
InternalMockNodeParameters(
|
||||
legalName = BOB_NAME,
|
||||
@ -112,8 +112,8 @@ class NetworkParametersTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `package ownership checks are correct`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `package ownership checks are correct`() {
|
||||
val key1 = generateKeyPair().public
|
||||
val key2 = generateKeyPair().public
|
||||
|
||||
|
@ -31,14 +31,14 @@ class NodeInfoTests {
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `should return true when the X500Name is present on the node`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `should return true when the X500Name is present on the node`() {
|
||||
assertTrue(testNode.isLegalIdentity(party1.name), "Party 1 must exist on the node")
|
||||
assertTrue(testNode.isLegalIdentity(party2.name), "Party 2 must exist on the node")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `should return false when the X500Name is not present on the node`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `should return false when the X500Name is not present on the node`() {
|
||||
assertFalse(testNode.isLegalIdentity(TestIdentity.fresh("party3").name),
|
||||
"Party 3 must not exist on the node")
|
||||
}
|
||||
|
@ -41,54 +41,54 @@ class VaultUpdateTests {
|
||||
private val stateAndRef3 = StateAndRef(TransactionState(DummyState(), DUMMY_PROGRAM_ID, DUMMY_NOTARY, constraint = AlwaysAcceptAttachmentConstraint), stateRef3)
|
||||
private val stateAndRef4 = StateAndRef(TransactionState(DummyState(), DUMMY_PROGRAM_ID, DUMMY_NOTARY, constraint = AlwaysAcceptAttachmentConstraint), stateRef4)
|
||||
|
||||
@Test
|
||||
fun `nothing plus nothing is nothing`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `nothing plus nothing is nothing`() {
|
||||
val before = emptyUpdate
|
||||
val after = before + emptyUpdate
|
||||
assertEquals(before, after)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `something plus nothing is something`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `something plus nothing is something`() {
|
||||
val before = Vault.Update<ContractState>(setOf(stateAndRef0, stateAndRef1), setOf(stateAndRef2, stateAndRef3))
|
||||
val after = before + emptyUpdate
|
||||
assertEquals(before, after)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `nothing plus something is something`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `nothing plus something is something`() {
|
||||
val before = emptyUpdate
|
||||
val after = before + Vault.Update(setOf(stateAndRef0, stateAndRef1), setOf(stateAndRef2, stateAndRef3))
|
||||
val expected = Vault.Update<ContractState>(setOf(stateAndRef0, stateAndRef1), setOf(stateAndRef2, stateAndRef3))
|
||||
assertEquals(expected, after)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `something plus consume state 0 is something without state 0 output`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `something plus consume state 0 is something without state 0 output`() {
|
||||
val before = Vault.Update<ContractState>(setOf(stateAndRef2, stateAndRef3), setOf(stateAndRef0, stateAndRef1))
|
||||
val after = before + Vault.Update(setOf(stateAndRef0), setOf())
|
||||
val expected = Vault.Update<ContractState>(setOf(stateAndRef2, stateAndRef3), setOf(stateAndRef1))
|
||||
assertEquals(expected, after)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `something plus produce state 4 is something with additional state 4 output`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `something plus produce state 4 is something with additional state 4 output`() {
|
||||
val before = Vault.Update<ContractState>(setOf(stateAndRef2, stateAndRef3), setOf(stateAndRef0, stateAndRef1))
|
||||
val after = before + Vault.Update(setOf(), setOf(stateAndRef4))
|
||||
val expected = Vault.Update<ContractState>(setOf(stateAndRef2, stateAndRef3), setOf(stateAndRef0, stateAndRef1, stateAndRef4))
|
||||
assertEquals(expected, after)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `something plus consume states 0 and 1, and produce state 4, is something without state 0 and 1 outputs and only state 4 output`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `something plus consume states 0 and 1, and produce state 4, is something without state 0 and 1 outputs and only state 4 output`() {
|
||||
val before = Vault.Update<ContractState>(setOf(stateAndRef2, stateAndRef3), setOf(stateAndRef0, stateAndRef1))
|
||||
val after = before + Vault.Update(setOf(stateAndRef0, stateAndRef1), setOf(stateAndRef4))
|
||||
val expected = Vault.Update<ContractState>(setOf(stateAndRef2, stateAndRef3), setOf(stateAndRef4))
|
||||
assertEquals(expected, after)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `can't combine updates of different types`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `can't combine updates of different types`() {
|
||||
val regularUpdate = Vault.Update<ContractState>(setOf(stateAndRef0, stateAndRef1), setOf(stateAndRef4))
|
||||
val notaryChangeUpdate = Vault.Update<ContractState>(setOf(stateAndRef2, stateAndRef3), setOf(stateAndRef0, stateAndRef1), type = Vault.UpdateType.NOTARY_CHANGE)
|
||||
assertFailsWith<IllegalArgumentException> { regularUpdate + notaryChangeUpdate }
|
||||
|
@ -54,56 +54,56 @@ class MappedSchemasCrossReferenceDetectionTests {
|
||||
) : PersistentState()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `no cross reference to other schema`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `no cross reference to other schema`() {
|
||||
assertThat(fieldsFromOtherMappedSchema(GoodSchema)).isEmpty()
|
||||
assertThat(methodsFromOtherMappedSchema(GoodSchema)).isEmpty()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `cross reference to other schema is detected`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `cross reference to other schema is detected`() {
|
||||
assertThat(fieldsFromOtherMappedSchema(BadSchema)).isNotEmpty
|
||||
assertThat(methodsFromOtherMappedSchema(BadSchema)).isEmpty()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `cross reference via non JPA field is allowed`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `cross reference via non JPA field is allowed`() {
|
||||
assertThat(fieldsFromOtherMappedSchema(TrickySchema)).isEmpty()
|
||||
assertThat(methodsFromOtherMappedSchema(TrickySchema)).isEmpty()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `cross reference via transient field is allowed`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `cross reference via transient field is allowed`() {
|
||||
assertThat(fieldsFromOtherMappedSchema(PoliteSchema)).isEmpty()
|
||||
assertThat(methodsFromOtherMappedSchema(PoliteSchema)).isEmpty()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `no cross reference to other schema java`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `no cross reference to other schema java`() {
|
||||
assertThat(fieldsFromOtherMappedSchema(GoodSchemaJavaV1())).isEmpty()
|
||||
assertThat(methodsFromOtherMappedSchema(GoodSchemaJavaV1())).isEmpty()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `cross reference to other schema is detected java`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `cross reference to other schema is detected java`() {
|
||||
assertThat(fieldsFromOtherMappedSchema(BadSchemaJavaV1())).isEmpty()
|
||||
assertThat(methodsFromOtherMappedSchema(BadSchemaJavaV1())).isNotEmpty
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `cross reference to other schema via field is detected java`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `cross reference to other schema via field is detected java`() {
|
||||
assertThat(fieldsFromOtherMappedSchema(BadSchemaNoGetterJavaV1())).isNotEmpty
|
||||
assertThat(methodsFromOtherMappedSchema(BadSchemaNoGetterJavaV1())).isEmpty()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `cross reference via non JPA field is allowed java`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `cross reference via non JPA field is allowed java`() {
|
||||
assertThat(fieldsFromOtherMappedSchema(TrickySchemaJavaV1())).isEmpty()
|
||||
assertThat(methodsFromOtherMappedSchema(TrickySchemaJavaV1())).isEmpty()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `cross reference via transient field is allowed java`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `cross reference via transient field is allowed java`() {
|
||||
assertThat(fieldsFromOtherMappedSchema(PoliteSchemaJavaV1())).isEmpty()
|
||||
assertThat(methodsFromOtherMappedSchema(PoliteSchemaJavaV1())).isEmpty()
|
||||
}
|
||||
|
@ -169,23 +169,23 @@ class AttachmentSerializationTest {
|
||||
return (client.smm.allStateMachines[0].stateMachine.resultFuture.apply { mockNet.runNetwork() }.getOrThrow() as ClientResult).attachmentContent
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `custom (and non-persisted) attachment should be saved in checkpoint`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `custom (and non-persisted) attachment should be saved in checkpoint`() {
|
||||
val attachmentId = SecureHash.sha256("any old data")
|
||||
launchFlow(CustomAttachmentLogic(serverIdentity, attachmentId, "custom"), 1)
|
||||
assertEquals("custom", rebootClientAndGetAttachmentContent())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `custom attachment should be saved in checkpoint even if its data was persisted`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `custom attachment should be saved in checkpoint even if its data was persisted`() {
|
||||
val attachmentId = client.saveAttachment("genuine")
|
||||
launchFlow(CustomAttachmentLogic(serverIdentity, attachmentId, "custom"), 1)
|
||||
client.hackAttachment(attachmentId, "hacked") // Should not be reloaded, checkAttachmentsOnLoad may cause next line to blow up if client attempts it.
|
||||
assertEquals("custom", rebootClientAndGetAttachmentContent())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `only the hash of a regular attachment should be saved in checkpoint`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `only the hash of a regular attachment should be saved in checkpoint`() {
|
||||
val attachmentId = client.saveAttachment("genuine")
|
||||
client.attachments.checkAttachmentsOnLoad = false // Cached by AttachmentImpl.
|
||||
launchFlow(OpenAttachmentLogic(serverIdentity, attachmentId), 1)
|
||||
@ -193,8 +193,8 @@ class AttachmentSerializationTest {
|
||||
assertEquals("hacked", rebootClientAndGetAttachmentContent(false)) // Pass in false to allow non-genuine data to be loaded.
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `only the hash of a FetchAttachmentsFlow attachment should be saved in checkpoint`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `only the hash of a FetchAttachmentsFlow attachment should be saved in checkpoint`() {
|
||||
val attachmentId = server.saveAttachment("genuine")
|
||||
launchFlow(FetchAttachmentLogic(serverIdentity, attachmentId), 2, sendData = true)
|
||||
client.hackAttachment(attachmentId, "hacked")
|
||||
|
@ -14,8 +14,8 @@ class CommandsSerializationTests {
|
||||
@JvmField
|
||||
val testSerialization = SerializationEnvironmentRule()
|
||||
|
||||
@Test
|
||||
fun `test cash move serialization`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `test cash move serialization`() {
|
||||
val command = Cash.Commands.Move(CommercialPaper::class.java)
|
||||
val copiedCommand = command.serialize().deserialize()
|
||||
|
||||
|
@ -19,8 +19,8 @@ class NotaryExceptionSerializationTest {
|
||||
@JvmField
|
||||
val testSerialization = SerializationEnvironmentRule()
|
||||
|
||||
@Test
|
||||
fun testSerializationRoundTrip() {
|
||||
@Test(timeout=300_000)
|
||||
fun testSerializationRoundTrip() {
|
||||
val txhash = SecureHash.randomSHA256()
|
||||
val stateHistory: Map<StateRef, StateConsumptionDetails> = mapOf(
|
||||
StateRef(txhash, 0) to StateConsumptionDetails(txhash.sha256())
|
||||
|
@ -93,8 +93,8 @@ class TransactionSerializationTests {
|
||||
tx = TransactionBuilder(DUMMY_NOTARY).withItems(inputState, outputState, changeState, Command(TestCash.Commands.Move(), arrayListOf(MEGA_CORP.owningKey)))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun signWireTX() {
|
||||
@Test(timeout=300_000)
|
||||
fun signWireTX() {
|
||||
val ptx = megaCorpServices.signInitialTransaction(tx)
|
||||
val stx = notaryServices.addSignature(ptx)
|
||||
|
||||
@ -111,8 +111,8 @@ class TransactionSerializationTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun wrongKeys() {
|
||||
@Test(timeout=300_000)
|
||||
fun wrongKeys() {
|
||||
val ptx = megaCorpServices.signInitialTransaction(tx)
|
||||
val stx = notaryServices.addSignature(ptx)
|
||||
|
||||
@ -134,16 +134,16 @@ class TransactionSerializationTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun timeWindow() {
|
||||
@Test(timeout=300_000)
|
||||
fun timeWindow() {
|
||||
tx.setTimeWindow(TEST_TX_TIME, 30.seconds)
|
||||
val ptx = megaCorpServices.signInitialTransaction(tx)
|
||||
val stx = notaryServices.addSignature(ptx)
|
||||
assertEquals(TEST_TX_TIME, stx.tx.timeWindow?.midpoint)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun storeAndLoadWhenSigning() {
|
||||
@Test(timeout=300_000)
|
||||
fun storeAndLoadWhenSigning() {
|
||||
val ptx = megaCorpServices.signInitialTransaction(tx)
|
||||
ptx.verifySignaturesExcept(DUMMY_NOTARY_KEY.public)
|
||||
val stored = ptx.serialize()
|
||||
|
@ -41,8 +41,8 @@ class AttachmentsClassLoaderSerializationTests {
|
||||
private val storage = InternalMockAttachmentStorage(MockAttachmentStorage())
|
||||
private val attachmentTrustCalculator = NodeAttachmentTrustCalculator(storage, TestingNamedCacheFactory())
|
||||
|
||||
@Test
|
||||
fun `Can serialize and deserialize with an attachment classloader`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Can serialize and deserialize with an attachment classloader`() {
|
||||
|
||||
val DUMMY_NOTARY = TestIdentity(DUMMY_NOTARY_NAME, 20).party
|
||||
val MEGA_CORP = TestIdentity(CordaX500Name("MegaCorp", "London", "GB")).party
|
||||
@ -77,8 +77,8 @@ class AttachmentsClassLoaderSerializationTests {
|
||||
}
|
||||
|
||||
// These tests are not Attachment specific. Should they be removed?
|
||||
@Test
|
||||
fun `test serialization of SecureHash`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `test serialization of SecureHash`() {
|
||||
val secureHash = SecureHash.randomSHA256()
|
||||
val bytes = secureHash.serialize()
|
||||
val copiedSecuredHash = bytes.deserialize()
|
||||
@ -86,8 +86,8 @@ class AttachmentsClassLoaderSerializationTests {
|
||||
assertEquals(secureHash, copiedSecuredHash)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `test serialization of OpaqueBytes`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `test serialization of OpaqueBytes`() {
|
||||
val opaqueBytes = OpaqueBytes("0123456789".toByteArray())
|
||||
val bytes = opaqueBytes.serialize()
|
||||
val copiedOpaqueBytes = bytes.deserialize()
|
||||
@ -95,8 +95,8 @@ class AttachmentsClassLoaderSerializationTests {
|
||||
assertEquals(opaqueBytes, copiedOpaqueBytes)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `test serialization of sub-sequence OpaqueBytes`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `test serialization of sub-sequence OpaqueBytes`() {
|
||||
val bytesSequence = ByteSequence.of("0123456789".toByteArray(), 3, 2)
|
||||
val bytes = bytesSequence.serialize()
|
||||
val copiedBytesSequence = bytes.deserialize()
|
||||
|
@ -77,15 +77,15 @@ class AttachmentsClassLoaderTests {
|
||||
attachmentTrustCalculator = NodeAttachmentTrustCalculator(internalStorage, cacheFactory)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Loading AnotherDummyContract without using the AttachmentsClassLoader fails`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Loading AnotherDummyContract without using the AttachmentsClassLoader fails`() {
|
||||
assertFailsWith<ClassNotFoundException> {
|
||||
Class.forName(ISOLATED_CONTRACT_CLASS_NAME)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Dynamically load AnotherDummyContract from isolated contracts jar using the AttachmentsClassLoader`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Dynamically load AnotherDummyContract from isolated contracts jar using the AttachmentsClassLoader`() {
|
||||
val isolatedId = importAttachment(ISOLATED_CONTRACTS_JAR_PATH.openStream(), "app", "isolated.jar")
|
||||
|
||||
val classloader = createClassloader(isolatedId)
|
||||
@ -94,8 +94,8 @@ class AttachmentsClassLoaderTests {
|
||||
assertEquals("helloworld", contract.declaredField<Any?>("magicString").value)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Test non-overlapping contract jar`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Test non-overlapping contract jar`() {
|
||||
val att1 = importAttachment(ISOLATED_CONTRACTS_JAR_PATH.openStream(), "app", "isolated.jar")
|
||||
val att2 = importAttachment(ISOLATED_CONTRACTS_JAR_PATH_V4.openStream(), "app", "isolated-4.0.jar")
|
||||
|
||||
@ -104,8 +104,8 @@ class AttachmentsClassLoaderTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Test valid overlapping contract jar`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Test valid overlapping contract jar`() {
|
||||
val isolatedId = importAttachment(ISOLATED_CONTRACTS_JAR_PATH.openStream(), "app", "isolated.jar")
|
||||
val signedJar = signContractJar(ISOLATED_CONTRACTS_JAR_PATH, copyFirst = true)
|
||||
val isolatedSignedId = importAttachment(signedJar.first.toUri().toURL().openStream(), "app", "isolated-signed.jar")
|
||||
@ -114,8 +114,8 @@ class AttachmentsClassLoaderTests {
|
||||
createClassloader(listOf(isolatedId, isolatedSignedId))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Test non-overlapping different contract jars`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Test non-overlapping different contract jars`() {
|
||||
val att1 = importAttachment(ISOLATED_CONTRACTS_JAR_PATH.openStream(), "app", "isolated.jar")
|
||||
val att2 = importAttachment(FINANCE_CONTRACTS_CORDAPP.jarFile.inputStream(), "app", "finance.jar")
|
||||
|
||||
@ -123,8 +123,8 @@ class AttachmentsClassLoaderTests {
|
||||
createClassloader(listOf(att1, att2))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Load text resources from AttachmentsClassLoader`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Load text resources from AttachmentsClassLoader`() {
|
||||
val att1 = importAttachment(fakeAttachment("file1.txt", "some data").inputStream(), "app", "file1.jar")
|
||||
val att2 = importAttachment(fakeAttachment("file2.txt", "some other data").inputStream(), "app", "file2.jar")
|
||||
|
||||
@ -136,8 +136,8 @@ class AttachmentsClassLoaderTests {
|
||||
assertEquals("some other data", txt1)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Test valid overlapping file condition`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Test valid overlapping file condition`() {
|
||||
val att1 = importAttachment(fakeAttachment("file1.txt", "same data", "file2.txt", "same other data").inputStream(), "app", "file1.jar")
|
||||
val att2 = importAttachment(fakeAttachment("file1.txt", "same data", "file3.txt", "same totally different").inputStream(), "app", "file2.jar")
|
||||
|
||||
@ -146,8 +146,8 @@ class AttachmentsClassLoaderTests {
|
||||
assertEquals("same data", txt)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `No overlapping exception thrown on certain META-INF files`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `No overlapping exception thrown on certain META-INF files`() {
|
||||
listOf("meta-inf/manifest.mf", "meta-inf/license", "meta-inf/test.dsa", "meta-inf/test.sf").forEach { path ->
|
||||
val att1 = importAttachment(fakeAttachment(path, "some data").inputStream(), "app", "file1.jar")
|
||||
val att2 = importAttachment(fakeAttachment(path, "some other data").inputStream(), "app", "file2.jar")
|
||||
@ -156,16 +156,16 @@ class AttachmentsClassLoaderTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Overlapping rules for META-INF SerializationWhitelist files`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Overlapping rules for META-INF SerializationWhitelist files`() {
|
||||
val att1 = importAttachment(fakeAttachment("meta-inf/services/net.corda.core.serialization.SerializationWhitelist", "some data").inputStream(), "app", "file1.jar")
|
||||
val att2 = importAttachment(fakeAttachment("meta-inf/services/net.corda.core.serialization.SerializationWhitelist", "some other data").inputStream(), "app", "file2.jar")
|
||||
|
||||
createClassloader(listOf(att1, att2))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Overlapping rules for META-INF random service files`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Overlapping rules for META-INF random service files`() {
|
||||
val att1 = importAttachment(fakeAttachment("meta-inf/services/com.example.something", "some data").inputStream(), "app", "file1.jar")
|
||||
val att2 = importAttachment(fakeAttachment("meta-inf/services/com.example.something", "some other data").inputStream(), "app", "file2.jar")
|
||||
|
||||
@ -174,8 +174,8 @@ class AttachmentsClassLoaderTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Test overlapping file exception`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Test overlapping file exception`() {
|
||||
val att1 = storage.importAttachment(fakeAttachment("file1.txt", "some data").inputStream(), "app", "file1.jar")
|
||||
val att2 = storage.importAttachment(fakeAttachment("file1.txt", "some other data").inputStream(), "app", "file2.jar")
|
||||
|
||||
@ -184,8 +184,8 @@ class AttachmentsClassLoaderTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `partial overlaps not possible`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `partial overlaps not possible`() {
|
||||
// Cover a previous bug whereby overlap checking had been optimized to only check contract classes, which isn't
|
||||
// a valid optimization as code used by the contract class could then be overlapped.
|
||||
val att1 = importAttachment(ISOLATED_CONTRACTS_JAR_PATH.openStream(), "app", ISOLATED_CONTRACTS_JAR_PATH.file)
|
||||
@ -195,8 +195,8 @@ class AttachmentsClassLoaderTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Check platform independent path handling in attachment jars`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Check platform independent path handling in attachment jars`() {
|
||||
val att1 = importAttachment(fakeAttachment("/folder1/foldera/file1.txt", "some data").inputStream(), "app", "file1.jar")
|
||||
val att2 = importAttachment(fakeAttachment("\\folder1\\folderb\\file2.txt", "some other data").inputStream(), "app", "file2.jar")
|
||||
|
||||
@ -213,8 +213,8 @@ class AttachmentsClassLoaderTests {
|
||||
assertArrayEquals("some other data".toByteArray(), data2b)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Allow loading untrusted resource jars but only trusted jars that contain class files`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Allow loading untrusted resource jars but only trusted jars that contain class files`() {
|
||||
val trustedResourceJar = importAttachment(fakeAttachment("file1.txt", "some data").inputStream(), "app", "file0.jar")
|
||||
val untrustedResourceJar = importAttachment(fakeAttachment("file2.txt", "some malicious data").inputStream(), "untrusted", "file1.jar")
|
||||
val untrustedClassJar = importAttachment(fakeAttachment("/com/example/something/MaliciousClass.class", "some malicious data").inputStream(), "untrusted", "file2.jar")
|
||||
@ -231,8 +231,8 @@ class AttachmentsClassLoaderTests {
|
||||
return jar.use { storage.importAttachment(jar, uploader, filename) }
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Allow loading an untrusted contract jar if another attachment exists that was signed with the same keys and uploaded by a trusted uploader`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Allow loading an untrusted contract jar if another attachment exists that was signed with the same keys and uploaded by a trusted uploader`() {
|
||||
val keyPairA = Crypto.generateKeyPair()
|
||||
val keyPairB = Crypto.generateKeyPair()
|
||||
val classJar = fakeAttachment(
|
||||
@ -260,8 +260,8 @@ class AttachmentsClassLoaderTests {
|
||||
createClassloader(untrustedAttachment)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Allow loading an untrusted contract jar if another attachment exists that was signed by a trusted uploader - intersection of keys match existing attachment`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Allow loading an untrusted contract jar if another attachment exists that was signed by a trusted uploader - intersection of keys match existing attachment`() {
|
||||
val keyPairA = Crypto.generateKeyPair()
|
||||
val keyPairB = Crypto.generateKeyPair()
|
||||
val keyPairC = Crypto.generateKeyPair()
|
||||
@ -290,8 +290,8 @@ class AttachmentsClassLoaderTests {
|
||||
createClassloader(untrustedAttachment)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Cannot load an untrusted contract jar if no other attachment exists that was signed with the same keys`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Cannot load an untrusted contract jar if no other attachment exists that was signed with the same keys`() {
|
||||
val keyPairA = Crypto.generateKeyPair()
|
||||
val keyPairB = Crypto.generateKeyPair()
|
||||
val untrustedClassJar = fakeAttachment(
|
||||
@ -310,8 +310,8 @@ class AttachmentsClassLoaderTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Cannot load an untrusted contract jar if no other attachment exists that was signed with the same keys and uploaded by a trusted uploader`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Cannot load an untrusted contract jar if no other attachment exists that was signed with the same keys and uploaded by a trusted uploader`() {
|
||||
val keyPairA = Crypto.generateKeyPair()
|
||||
val keyPairB = Crypto.generateKeyPair()
|
||||
val classJar = fakeAttachment(
|
||||
@ -341,8 +341,8 @@ class AttachmentsClassLoaderTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Attachments with inherited trust do not grant trust to attachments being loaded (no chain of trust)`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Attachments with inherited trust do not grant trust to attachments being loaded (no chain of trust)`() {
|
||||
val keyPairA = Crypto.generateKeyPair()
|
||||
val keyPairB = Crypto.generateKeyPair()
|
||||
val keyPairC = Crypto.generateKeyPair()
|
||||
@ -387,8 +387,8 @@ class AttachmentsClassLoaderTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Cannot load an untrusted contract jar if it is signed by a blacklisted key even if there is another attachment signed by the same keys that is trusted`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Cannot load an untrusted contract jar if it is signed by a blacklisted key even if there is another attachment signed by the same keys that is trusted`() {
|
||||
val keyPairA = Crypto.generateKeyPair()
|
||||
val keyPairB = Crypto.generateKeyPair()
|
||||
|
||||
@ -425,8 +425,8 @@ class AttachmentsClassLoaderTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Allow loading a trusted attachment that is signed by a blacklisted key`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Allow loading a trusted attachment that is signed by a blacklisted key`() {
|
||||
val keyPairA = Crypto.generateKeyPair()
|
||||
|
||||
attachmentTrustCalculator = NodeAttachmentTrustCalculator(
|
||||
|
@ -69,8 +69,8 @@ class CompatibleTransactionTests {
|
||||
}
|
||||
private val wireTransactionA by lazy { WireTransaction(componentGroups = componentGroupsA, privacySalt = privacySalt) }
|
||||
|
||||
@Test
|
||||
fun `Merkle root computations`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Merkle root computations`() {
|
||||
// Merkle tree computation is deterministic if the same salt and ordering are used.
|
||||
val wireTransactionB = WireTransaction(componentGroups = componentGroupsA, privacySalt = privacySalt)
|
||||
assertEquals(wireTransactionA, wireTransactionB)
|
||||
@ -129,8 +129,8 @@ class CompatibleTransactionTests {
|
||||
assertEquals(wireTransactionA, WireTransaction(componentGroups = shuffledComponentGroupsA, privacySalt = privacySalt))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `WireTransaction constructors and compatibility`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `WireTransaction constructors and compatibility`() {
|
||||
val groups = createComponentGroups(inputs, outputs, commands, attachments, notary, timeWindow, emptyList(), null)
|
||||
val wireTransactionOldConstructor = WireTransaction(groups, privacySalt)
|
||||
assertEquals(wireTransactionA, wireTransactionOldConstructor)
|
||||
@ -198,8 +198,8 @@ class CompatibleTransactionTests {
|
||||
assertFails { WireTransaction(componentGroupsCompatibleEmptyNew, privacySalt) }
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `FilteredTransaction constructors and compatibility`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `FilteredTransaction constructors and compatibility`() {
|
||||
// Filter out all of the components.
|
||||
val ftxNothing = wireTransactionA.buildFilteredTransaction(Predicate { false }) // Nothing filtered.
|
||||
// Although nothing filtered, we still receive the group hashes for the top level Merkle tree.
|
||||
@ -295,8 +295,8 @@ class CompatibleTransactionTests {
|
||||
assertEquals(wireTransactionCompatibleA.componentGroups.map { it.groupIndex }.max()!!, ftxCompatibleNoInputs.groupHashes.size - 1)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Command visibility tests`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Command visibility tests`() {
|
||||
// 1st and 3rd commands require a signature from KEY_1.
|
||||
val twoCommandsforKey1 = listOf(dummyCommand(DUMMY_KEY_1.public, DUMMY_KEY_2.public), dummyCommand(DUMMY_KEY_2.public), dummyCommand(DUMMY_KEY_1.public))
|
||||
val componentGroups = listOf(
|
||||
@ -414,8 +414,8 @@ class CompatibleTransactionTests {
|
||||
allCommandsNoKey1Ftx.checkCommandVisibility(DUMMY_KEY_1.public) // This will pass, because there are indeed no commands to sign in the original transaction.
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `FilteredTransaction signer manipulation tests`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `FilteredTransaction signer manipulation tests`() {
|
||||
// Required to call the private constructor.
|
||||
val ftxConstructor = FilteredTransaction::class.constructors.first()
|
||||
|
||||
@ -557,8 +557,8 @@ class CompatibleTransactionTests {
|
||||
assertFailsWith<ComponentVisibilityException> { ftxAlterSignerB.checkCommandVisibility(DUMMY_KEY_1.public) }
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `parameters hash visibility`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `parameters hash visibility`() {
|
||||
fun paramsFilter(elem: Any): Boolean = elem is NetworkParametersHash && elem.hash == paramsHash
|
||||
fun attachmentFilter(elem: Any): Boolean = elem is SecureHash && elem == paramsHash
|
||||
val attachments = ComponentGroup(ATTACHMENTS_GROUP.ordinal, listOf(paramsHash.serialize())) // Same hash as network parameters
|
||||
|
@ -98,8 +98,8 @@ class LedgerTransactionQueryTests {
|
||||
return tx.toLedgerTransaction(services)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Simple InRef Indexer tests`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Simple InRef Indexer tests`() {
|
||||
val ltx = makeDummyTransaction()
|
||||
assertEquals(0, ltx.inRef<IntTypeDummyState>(0).state.data.data)
|
||||
assertEquals("0", ltx.inRef<StringTypeDummyState>(1).state.data.data)
|
||||
@ -108,8 +108,8 @@ class LedgerTransactionQueryTests {
|
||||
assertFailsWith<IndexOutOfBoundsException> { ltx.inRef<IntTypeDummyState>(10) }
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Simple OutRef Indexer tests`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Simple OutRef Indexer tests`() {
|
||||
val ltx = makeDummyTransaction()
|
||||
assertEquals(0, ltx.outRef<IntTypeDummyState>(0).state.data.data)
|
||||
assertEquals("0", ltx.outRef<StringTypeDummyState>(1).state.data.data)
|
||||
@ -118,8 +118,8 @@ class LedgerTransactionQueryTests {
|
||||
assertFailsWith<IndexOutOfBoundsException> { ltx.outRef<IntTypeDummyState>(10) }
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Simple Input Indexer tests`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Simple Input Indexer tests`() {
|
||||
val ltx = makeDummyTransaction()
|
||||
assertEquals(0, (ltx.getInput(0) as IntTypeDummyState).data)
|
||||
assertEquals("0", (ltx.getInput(1) as StringTypeDummyState).data)
|
||||
@ -128,8 +128,8 @@ class LedgerTransactionQueryTests {
|
||||
assertFailsWith<IndexOutOfBoundsException> { ltx.getInput(10) }
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Simple Output Indexer tests`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Simple Output Indexer tests`() {
|
||||
val ltx = makeDummyTransaction()
|
||||
assertEquals(0, (ltx.getOutput(0) as IntTypeDummyState).data)
|
||||
assertEquals("0", (ltx.getOutput(1) as StringTypeDummyState).data)
|
||||
@ -138,8 +138,8 @@ class LedgerTransactionQueryTests {
|
||||
assertFailsWith<IndexOutOfBoundsException> { ltx.getOutput(10) }
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Simple Command Indexer tests`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Simple Command Indexer tests`() {
|
||||
val ltx = makeDummyTransaction()
|
||||
assertEquals(0, ltx.getCommand<Commands.Cmd1>(0).value.id)
|
||||
assertEquals(0, ltx.getCommand<Commands.Cmd2>(1).value.id)
|
||||
@ -148,8 +148,8 @@ class LedgerTransactionQueryTests {
|
||||
assertFailsWith<IndexOutOfBoundsException> { ltx.getOutput(10) }
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Simple Inputs of type tests`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Simple Inputs of type tests`() {
|
||||
val ltx = makeDummyTransaction()
|
||||
val intStates = ltx.inputsOfType(IntTypeDummyState::class.java)
|
||||
assertEquals(5, intStates.size)
|
||||
@ -161,8 +161,8 @@ class LedgerTransactionQueryTests {
|
||||
assertEquals(emptyList(), notPresentQuery)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Simple InputsRefs of type tests`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Simple InputsRefs of type tests`() {
|
||||
val ltx = makeDummyTransaction()
|
||||
val intStates = ltx.inRefsOfType(IntTypeDummyState::class.java)
|
||||
assertEquals(5, intStates.size)
|
||||
@ -174,8 +174,8 @@ class LedgerTransactionQueryTests {
|
||||
assertEquals(listOf(ltx.inputs[1], ltx.inputs[3], ltx.inputs[5], ltx.inputs[7], ltx.inputs[9]), stringStates)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Simple Outputs of type tests`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Simple Outputs of type tests`() {
|
||||
val ltx = makeDummyTransaction()
|
||||
val intStates = ltx.outputsOfType(IntTypeDummyState::class.java)
|
||||
assertEquals(5, intStates.size)
|
||||
@ -187,8 +187,8 @@ class LedgerTransactionQueryTests {
|
||||
assertEquals(emptyList(), notPresentQuery)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Simple OutputsRefs of type tests`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Simple OutputsRefs of type tests`() {
|
||||
val ltx = makeDummyTransaction()
|
||||
val intStates = ltx.outRefsOfType(IntTypeDummyState::class.java)
|
||||
assertEquals(5, intStates.size)
|
||||
@ -202,8 +202,8 @@ class LedgerTransactionQueryTests {
|
||||
assertTrue(stringStates.all { it.ref.txhash == ltx.id })
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Simple Commands of type tests`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Simple Commands of type tests`() {
|
||||
val ltx = makeDummyTransaction()
|
||||
val intCmd1 = ltx.commandsOfType(Commands.Cmd1::class.java)
|
||||
assertEquals(5, intCmd1.size)
|
||||
@ -215,8 +215,8 @@ class LedgerTransactionQueryTests {
|
||||
assertEquals(emptyList(), notPresentQuery)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Filtered Input Tests`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Filtered Input Tests`() {
|
||||
val ltx = makeDummyTransaction()
|
||||
val intStates = ltx.filterInputs(IntTypeDummyState::class.java, Predicate { it.data.rem(2) == 0 })
|
||||
assertEquals(3, intStates.size)
|
||||
@ -225,8 +225,8 @@ class LedgerTransactionQueryTests {
|
||||
assertEquals("3", stringStates.single().data)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Filtered InRef Tests`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Filtered InRef Tests`() {
|
||||
val ltx = makeDummyTransaction()
|
||||
val intStates = ltx.filterInRefs(IntTypeDummyState::class.java, Predicate { it.data.rem(2) == 0 })
|
||||
assertEquals(3, intStates.size)
|
||||
@ -237,8 +237,8 @@ class LedgerTransactionQueryTests {
|
||||
assertEquals(ltx.inputs[7], stringStates.single())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Filtered Output Tests`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Filtered Output Tests`() {
|
||||
val ltx = makeDummyTransaction()
|
||||
val intStates = ltx.filterOutputs(IntTypeDummyState::class.java, Predicate { it.data.rem(2) == 0 })
|
||||
assertEquals(3, intStates.size)
|
||||
@ -247,8 +247,8 @@ class LedgerTransactionQueryTests {
|
||||
assertEquals("3", stringStates.single().data)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Filtered OutRef Tests`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Filtered OutRef Tests`() {
|
||||
val ltx = makeDummyTransaction()
|
||||
val intStates = ltx.filterOutRefs(IntTypeDummyState::class.java, Predicate { it.data.rem(2) == 0 })
|
||||
assertEquals(3, intStates.size)
|
||||
@ -261,8 +261,8 @@ class LedgerTransactionQueryTests {
|
||||
assertEquals(ltx.id, stringStates.single().ref.txhash)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Filtered Commands Tests`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Filtered Commands Tests`() {
|
||||
val ltx = makeDummyTransaction()
|
||||
val intCmds1 = ltx.filterCommands(Commands.Cmd1::class.java, Predicate { it.id.rem(2) == 0 })
|
||||
assertEquals(3, intCmds1.size)
|
||||
@ -271,8 +271,8 @@ class LedgerTransactionQueryTests {
|
||||
assertEquals(3, intCmds2.single().value.id)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Find Input Tests`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Find Input Tests`() {
|
||||
val ltx = makeDummyTransaction()
|
||||
val intState = ltx.findInput(IntTypeDummyState::class.java, Predicate { it.data == 4 })
|
||||
assertEquals(ltx.getInput(8), intState)
|
||||
@ -280,8 +280,8 @@ class LedgerTransactionQueryTests {
|
||||
assertEquals(ltx.getInput(7), stringState)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Find InRef Tests`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Find InRef Tests`() {
|
||||
val ltx = makeDummyTransaction()
|
||||
val intState = ltx.findInRef(IntTypeDummyState::class.java, Predicate { it.data == 4 })
|
||||
assertEquals(ltx.inRef(8), intState)
|
||||
@ -289,8 +289,8 @@ class LedgerTransactionQueryTests {
|
||||
assertEquals(ltx.inRef(7), stringState)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Find Output Tests`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Find Output Tests`() {
|
||||
val ltx = makeDummyTransaction()
|
||||
val intState = ltx.findOutput(IntTypeDummyState::class.java, Predicate { it.data == 4 })
|
||||
assertEquals(ltx.getOutput(8), intState)
|
||||
@ -298,8 +298,8 @@ class LedgerTransactionQueryTests {
|
||||
assertEquals(ltx.getOutput(7), stringState)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Find OutRef Tests`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Find OutRef Tests`() {
|
||||
val ltx = makeDummyTransaction()
|
||||
val intState = ltx.findOutRef(IntTypeDummyState::class.java, Predicate { it.data == 4 })
|
||||
assertEquals(ltx.outRef(8), intState)
|
||||
@ -307,8 +307,8 @@ class LedgerTransactionQueryTests {
|
||||
assertEquals(ltx.outRef(7), stringState)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Find Commands Tests`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Find Commands Tests`() {
|
||||
val ltx = makeDummyTransaction()
|
||||
val intCmd1 = ltx.findCommand(Commands.Cmd1::class.java, Predicate { it.id == 2 })
|
||||
assertEquals(ltx.getCommand(4), intCmd1)
|
||||
|
@ -103,8 +103,8 @@ class ReferenceStateTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `create a reference state then refer to it multiple times`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `create a reference state then refer to it multiple times`() {
|
||||
ledgerServices.ledger(DUMMY_NOTARY) {
|
||||
// Create a reference state. The reference state is created in the normal way. A transaction with one
|
||||
// or more outputs. It makes sense to create them one at a time, so the creator can have fine grained
|
||||
@ -142,8 +142,8 @@ class ReferenceStateTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Non-creator node cannot spend spend a reference state`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Non-creator node cannot spend spend a reference state`() {
|
||||
ledgerServices.ledger(DUMMY_NOTARY) {
|
||||
transaction {
|
||||
output(CONTRACT_ID, "REF DATA", ExampleState(ALICE_PARTY, "HELLO CORDA"))
|
||||
@ -161,8 +161,8 @@ class ReferenceStateTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Can't use old reference states`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Can't use old reference states`() {
|
||||
val refData = ExampleState(ALICE_PARTY, "HELLO CORDA")
|
||||
ledgerServices.ledger(DUMMY_NOTARY) {
|
||||
transaction {
|
||||
@ -197,8 +197,8 @@ class ReferenceStateTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `state ref cannot be a reference input and regular input in the same transaction`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `state ref cannot be a reference input and regular input in the same transaction`() {
|
||||
val state = ExampleState(ALICE_PARTY, "HELLO CORDA")
|
||||
val stateAndRef = StateAndRef(TransactionState(state, CONTRACT_ID, DUMMY_NOTARY, constraint = AlwaysAcceptAttachmentConstraint), StateRef(SecureHash.zeroHash, 0))
|
||||
assertThatIllegalArgumentException().isThrownBy {
|
||||
|
@ -63,8 +63,8 @@ class TransactionBuilderTest {
|
||||
.getLatestContractAttachments("net.corda.testing.contracts.DummyContract")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `bare minimum issuance tx`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `bare minimum issuance tx`() {
|
||||
val outputState = TransactionState(
|
||||
data = DummyState(),
|
||||
contract = DummyContract.PROGRAM_ID,
|
||||
@ -80,8 +80,8 @@ class TransactionBuilderTest {
|
||||
assertThat(wtx.networkParametersHash).isEqualTo(networkParametersService.currentHash)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `automatic hash constraint`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `automatic hash constraint`() {
|
||||
doReturn(unsignedAttachment).whenever(attachments).openAttachment(contractAttachmentId)
|
||||
|
||||
val outputState = TransactionState(data = DummyState(), contract = DummyContract.PROGRAM_ID, notary = notary)
|
||||
@ -92,8 +92,8 @@ class TransactionBuilderTest {
|
||||
assertThat(wtx.outputs).containsOnly(outputState.copy(constraint = HashAttachmentConstraint(contractAttachmentId)))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `reference states`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `reference states`() {
|
||||
doReturn(unsignedAttachment).whenever(attachments).openAttachment(contractAttachmentId)
|
||||
|
||||
val referenceState = TransactionState(DummyState(), DummyContract.PROGRAM_ID, notary)
|
||||
@ -114,8 +114,8 @@ class TransactionBuilderTest {
|
||||
assertThat(wtx.references).containsOnly(referenceStateRef)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `automatic signature constraint`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `automatic signature constraint`() {
|
||||
val aliceParty = TestIdentity(ALICE_NAME).party
|
||||
val bobParty = TestIdentity(BOB_NAME).party
|
||||
val compositeKey = CompositeKey.Builder().addKeys(aliceParty.owningKey, bobParty.owningKey).build()
|
||||
|
@ -82,8 +82,8 @@ class TransactionEncumbranceTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `states must be bi-directionally encumbered`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `states must be bi-directionally encumbered`() {
|
||||
// Basic encumbrance example for encumbrance index links 0 -> 1 and 1 -> 0
|
||||
ledgerServices.ledger(DUMMY_NOTARY) {
|
||||
transaction {
|
||||
@ -145,8 +145,8 @@ class TransactionEncumbranceTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `non bi-directional encumbrance will fail`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `non bi-directional encumbrance will fail`() {
|
||||
// Single encumbrance with no back link.
|
||||
assertFailsWith<TransactionVerificationException.TransactionNonMatchingEncumbranceException> {
|
||||
ledgerServices.ledger(DUMMY_NOTARY) {
|
||||
@ -214,8 +214,8 @@ class TransactionEncumbranceTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `state can transition if encumbrance rules are met`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `state can transition if encumbrance rules are met`() {
|
||||
ledgerServices.ledger(DUMMY_NOTARY) {
|
||||
unverifiedTransaction {
|
||||
attachments(Cash.PROGRAM_ID, TEST_TIMELOCK_ID)
|
||||
@ -235,8 +235,8 @@ class TransactionEncumbranceTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `state cannot transition if the encumbrance contract fails to verify`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `state cannot transition if the encumbrance contract fails to verify`() {
|
||||
ledgerServices.ledger(DUMMY_NOTARY) {
|
||||
unverifiedTransaction {
|
||||
attachments(Cash.PROGRAM_ID, TEST_TIMELOCK_ID)
|
||||
@ -256,8 +256,8 @@ class TransactionEncumbranceTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `state must be consumed along with its encumbrance`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `state must be consumed along with its encumbrance`() {
|
||||
ledgerServices.ledger(DUMMY_NOTARY) {
|
||||
unverifiedTransaction {
|
||||
attachments(Cash.PROGRAM_ID, TEST_TIMELOCK_ID)
|
||||
@ -275,8 +275,8 @@ class TransactionEncumbranceTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `state cannot be encumbered by itself`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `state cannot be encumbered by itself`() {
|
||||
ledgerServices.ledger(DUMMY_NOTARY) {
|
||||
transaction {
|
||||
attachments(Cash.PROGRAM_ID)
|
||||
@ -288,8 +288,8 @@ class TransactionEncumbranceTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `encumbrance state index must be valid`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `encumbrance state index must be valid`() {
|
||||
ledgerServices.ledger(DUMMY_NOTARY) {
|
||||
transaction {
|
||||
attachments(Cash.PROGRAM_ID, TEST_TIMELOCK_ID)
|
||||
@ -302,8 +302,8 @@ class TransactionEncumbranceTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `correct encumbrance state must be provided`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `correct encumbrance state must be provided`() {
|
||||
ledgerServices.ledger(DUMMY_NOTARY) {
|
||||
unverifiedTransaction {
|
||||
attachments(Cash.PROGRAM_ID, TEST_TIMELOCK_ID)
|
||||
@ -323,8 +323,8 @@ class TransactionEncumbranceTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `encumbered states cannot be assigned to different notaries`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `encumbered states cannot be assigned to different notaries`() {
|
||||
// Single encumbrance with different notaries.
|
||||
assertFailsWith<TransactionVerificationException.TransactionNotaryMismatchEncumbranceException> {
|
||||
TransactionBuilder()
|
||||
|
@ -53,8 +53,8 @@ class TransactionTests {
|
||||
return SignedTransaction(wtx, sigs)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `signed transaction missing signatures - CompositeKey`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `signed transaction missing signatures - CompositeKey`() {
|
||||
val ak = generateKeyPair()
|
||||
val bk = generateKeyPair()
|
||||
val ck = generateKeyPair()
|
||||
@ -87,8 +87,8 @@ class TransactionTests {
|
||||
makeSigned(wtx, DUMMY_KEY_1, ak).verifySignaturesExcept(compKey, DUMMY_KEY_2.public) // Mixed allowed to be missing.
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `signed transaction missing signatures`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `signed transaction missing signatures`() {
|
||||
val wtx = createWireTransaction(
|
||||
inputs = listOf(StateRef(SecureHash.randomSHA256(), 0)),
|
||||
attachments = emptyList(),
|
||||
@ -118,8 +118,8 @@ class TransactionTests {
|
||||
makeSigned(wtx, DUMMY_KEY_1, DUMMY_KEY_2).verifyRequiredSignatures()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `transactions with no inputs can have any notary`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `transactions with no inputs can have any notary`() {
|
||||
val baseOutState = TransactionState(DummyContract.SingleOwnerState(0, ALICE), DummyContract.PROGRAM_ID, DUMMY_NOTARY, constraint = AlwaysAcceptAttachmentConstraint)
|
||||
val inputs = emptyList<StateAndRef<*>>()
|
||||
val outputs = listOf(baseOutState, baseOutState.copy(notary = ALICE), baseOutState.copy(notary = BOB))
|
||||
@ -148,8 +148,8 @@ class TransactionTests {
|
||||
transaction.verify()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `transaction cannot have duplicate inputs`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `transaction cannot have duplicate inputs`() {
|
||||
val stateRef = StateRef(SecureHash.randomSHA256(), 0)
|
||||
fun buildTransaction() = createWireTransaction(
|
||||
inputs = listOf(stateRef, stateRef),
|
||||
@ -163,8 +163,8 @@ class TransactionTests {
|
||||
assertFailsWith<IllegalStateException> { buildTransaction() }
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `general transactions cannot change notary`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `general transactions cannot change notary`() {
|
||||
val notary: Party = DUMMY_NOTARY
|
||||
val inState = TransactionState(DummyContract.SingleOwnerState(0, ALICE), DummyContract.PROGRAM_ID, notary)
|
||||
val outState = inState.copy(notary = ALICE)
|
||||
@ -201,8 +201,8 @@ class TransactionTests {
|
||||
assertFailsWith<TransactionVerificationException.NotaryChangeInWrongTransactionType> { buildTransaction().verify() }
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `transactions with identical contents must have different ids`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `transactions with identical contents must have different ids`() {
|
||||
val outputState = TransactionState(DummyContract.SingleOwnerState(0, ALICE), DummyContract.PROGRAM_ID, DUMMY_NOTARY)
|
||||
fun buildTransaction() = createWireTransaction(
|
||||
inputs = emptyList(),
|
||||
|
@ -34,16 +34,16 @@ class KotlinUtilsTest {
|
||||
true,
|
||||
null)
|
||||
|
||||
@Test
|
||||
fun `transient property which is null`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `transient property which is null`() {
|
||||
val test = NullTransientProperty()
|
||||
test.transientValue
|
||||
test.transientValue
|
||||
assertThat(test.evalCount).isEqualTo(1)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `checkpointing a transient property with non-capturing lambda`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `checkpointing a transient property with non-capturing lambda`() {
|
||||
val original = NonCapturingTransientProperty()
|
||||
val originalVal = original.transientVal
|
||||
val copy = original.checkpointSerialize(context = KRYO_CHECKPOINT_CONTEXT).checkpointDeserialize(context = KRYO_CHECKPOINT_CONTEXT)
|
||||
@ -52,16 +52,16 @@ class KotlinUtilsTest {
|
||||
assertThat(copy.transientVal).isEqualTo(copyVal)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `deserialise transient property with non-capturing lambda`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `deserialise transient property with non-capturing lambda`() {
|
||||
expectedEx.expect(KryoException::class.java)
|
||||
expectedEx.expectMessage("is not annotated or on the whitelist, so cannot be used in serialization")
|
||||
val original = NonCapturingTransientProperty()
|
||||
original.checkpointSerialize(context = KRYO_CHECKPOINT_CONTEXT).checkpointDeserialize(context = KRYO_CHECKPOINT_NOWHITELIST_CONTEXT)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `checkpointing a transient property with capturing lambda`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `checkpointing a transient property with capturing lambda`() {
|
||||
val original = CapturingTransientProperty("Hello")
|
||||
val originalVal = original.transientVal
|
||||
val copy = original.checkpointSerialize(context = KRYO_CHECKPOINT_CONTEXT).checkpointDeserialize(context = KRYO_CHECKPOINT_CONTEXT)
|
||||
@ -71,8 +71,8 @@ class KotlinUtilsTest {
|
||||
assertThat(copy.transientVal).startsWith("Hello")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `deserialise transient property with capturing lambda`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `deserialise transient property with capturing lambda`() {
|
||||
expectedEx.expect(KryoException::class.java)
|
||||
expectedEx.expectMessage("is not annotated or on the whitelist, so cannot be used in serialization")
|
||||
|
||||
|
@ -42,18 +42,18 @@ class NonEmptySetTest {
|
||||
@JvmField
|
||||
val testSerialization = SerializationEnvironmentRule()
|
||||
|
||||
@Test
|
||||
fun `copyOf - empty source`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `copyOf - empty source`() {
|
||||
assertThatThrownBy { NonEmptySet.copyOf(HashSet<Int>()) }.isInstanceOf(IllegalArgumentException::class.java)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun head() {
|
||||
@Test(timeout=300_000)
|
||||
fun head() {
|
||||
assertThat(NonEmptySet.of(1, 2).head()).isEqualTo(1)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `serialize deserialize`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `serialize deserialize`() {
|
||||
val original = NonEmptySet.of(-17, 22, 17)
|
||||
val copy = original.serialize().deserialize()
|
||||
assertThat(copy).isEqualTo(original).isNotSameAs(original)
|
||||
|
@ -59,8 +59,8 @@ class ProgressTrackerTest {
|
||||
pt4 = ChildSteps.tracker()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `check basic steps`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `check basic steps`() {
|
||||
assertEquals(ProgressTracker.UNSTARTED, pt.currentStep)
|
||||
assertEquals(0, pt.stepIndex)
|
||||
var stepNotification: ProgressTracker.Step? = null
|
||||
@ -76,15 +76,15 @@ class ProgressTrackerTest {
|
||||
assertEquals(ProgressTracker.DONE, pt.nextStep())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `cannot go beyond end`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `cannot go beyond end`() {
|
||||
pt.currentStep = SimpleSteps.FOUR
|
||||
pt.nextStep()
|
||||
assertFails { pt.nextStep() }
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `nested children are stepped correctly`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `nested children are stepped correctly`() {
|
||||
val stepNotification = LinkedList<ProgressTracker.Change>()
|
||||
pt.changes.subscribe {
|
||||
stepNotification += it
|
||||
@ -109,8 +109,8 @@ class ProgressTrackerTest {
|
||||
assertEquals(ChildSteps.BEE, pt2.nextStep())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `steps tree index counts children steps`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `steps tree index counts children steps`() {
|
||||
pt.setChildProgressTracker(SimpleSteps.TWO, pt2)
|
||||
|
||||
val allSteps = pt.allSteps
|
||||
@ -148,8 +148,8 @@ class ProgressTrackerTest {
|
||||
assertThat(stepsTreeNotification).hasSize(2) // The initial tree state, plus one per tree update
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `steps tree index counts two levels of children steps`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `steps tree index counts two levels of children steps`() {
|
||||
pt.setChildProgressTracker(SimpleSteps.FOUR, pt2)
|
||||
pt2.setChildProgressTracker(ChildSteps.SEA, pt3)
|
||||
val allSteps = pt.allSteps
|
||||
@ -183,8 +183,8 @@ class ProgressTrackerTest {
|
||||
assertThat(stepsTreeNotification).hasSize(3) // The initial tree state, plus one per update
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `structure changes are pushed down when progress trackers are added`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `structure changes are pushed down when progress trackers are added`() {
|
||||
pt.setChildProgressTracker(SimpleSteps.TWO, pt2)
|
||||
|
||||
// Capture notifications.
|
||||
@ -220,8 +220,8 @@ class ProgressTrackerTest {
|
||||
assertThat(stepsTreeNotification).hasSize(3) // The initial tree state, plus one per update.
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `structure changes are pushed down when progress trackers are removed`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `structure changes are pushed down when progress trackers are removed`() {
|
||||
pt.setChildProgressTracker(SimpleSteps.TWO, pt2)
|
||||
|
||||
// Capture notifications.
|
||||
@ -255,16 +255,16 @@ class ProgressTrackerTest {
|
||||
assertThat(stepsTreeNotification).hasSize(3) // The initial tree state, plus one per update
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `can be rewound`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `can be rewound`() {
|
||||
pt.setChildProgressTracker(SimpleSteps.TWO, pt2)
|
||||
repeat(4) { pt.nextStep() }
|
||||
pt.currentStep = SimpleSteps.ONE
|
||||
assertEquals(SimpleSteps.TWO, pt.nextStep())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `all index changes seen if subscribed mid flow`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `all index changes seen if subscribed mid flow`() {
|
||||
pt.setChildProgressTracker(SimpleSteps.TWO, pt2)
|
||||
|
||||
pt.currentStep = SimpleSteps.ONE
|
||||
@ -280,8 +280,8 @@ class ProgressTrackerTest {
|
||||
assertThat(stepsIndexNotifications).containsExactlyElementsOf(listOf(0, 1, 2, 3))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `all step changes seen if subscribed mid flow`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `all step changes seen if subscribed mid flow`() {
|
||||
val steps = mutableListOf<String>()
|
||||
pt.nextStep()
|
||||
pt.nextStep()
|
||||
@ -293,8 +293,8 @@ class ProgressTrackerTest {
|
||||
assertEquals(listOf("Starting", "one", "two", "three", "four", "Done"), steps)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `all tree changes seen if subscribed mid flow`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `all tree changes seen if subscribed mid flow`() {
|
||||
val stepTreeNotifications = mutableListOf<List<Pair<Int, String>>>()
|
||||
val firstStepLabels = pt.allStepsLabels
|
||||
|
||||
@ -310,8 +310,8 @@ class ProgressTrackerTest {
|
||||
assertEquals(listOf(firstStepLabels, secondStepLabels, thirdStepLabels), stepTreeNotifications)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `trees with child trackers with duplicate steps reported correctly`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `trees with child trackers with duplicate steps reported correctly`() {
|
||||
val stepTreeNotifications = mutableListOf<List<Pair<Int, String>>>()
|
||||
val stepIndexNotifications = mutableListOf<Int>()
|
||||
pt.stepsTreeChanges.subscribe { stepTreeNotifications += it }
|
||||
@ -329,8 +329,8 @@ class ProgressTrackerTest {
|
||||
assertEquals(listOf(0, 1, 2, 3, 4, 5, 6), stepIndexNotifications)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `cannot assign step not belonging to this progress tracker`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `cannot assign step not belonging to this progress tracker`() {
|
||||
assertFails { pt.currentStep = BabySteps.UNOS }
|
||||
}
|
||||
|
||||
@ -341,8 +341,8 @@ class ProgressTrackerTest {
|
||||
fun tracker() = ProgressTracker(first, second, first2)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Serializing and deserializing a tracker maintains equality`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Serializing and deserializing a tracker maintains equality`() {
|
||||
val step = NonSingletonSteps.first
|
||||
val recreatedStep = step
|
||||
.checkpointSerialize(testCheckpointSerialization.checkpointSerializationContext)
|
||||
@ -350,8 +350,8 @@ class ProgressTrackerTest {
|
||||
assertEquals(step, recreatedStep)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `can assign a recreated equal step`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `can assign a recreated equal step`() {
|
||||
val tracker = NonSingletonSteps.tracker()
|
||||
val recreatedStep = first
|
||||
.checkpointSerialize(testCheckpointSerialization.checkpointSerializationContext)
|
||||
@ -359,14 +359,14 @@ class ProgressTrackerTest {
|
||||
tracker.currentStep = recreatedStep
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Steps with the same label defined in different places are not equal`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Steps with the same label defined in different places are not equal`() {
|
||||
val one = ProgressTracker.Step("one")
|
||||
assertNotEquals(one, SimpleSteps.ONE)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Steps with the same label defined in the same place are also not equal`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `Steps with the same label defined in the same place are also not equal`() {
|
||||
assertNotEquals(first, first2)
|
||||
}
|
||||
}
|
||||
|
@ -8,16 +8,16 @@ import java.util.*
|
||||
import java.util.concurrent.CancellationException
|
||||
|
||||
class UtilsTest {
|
||||
@Test
|
||||
fun `toFuture - single item observable`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `toFuture - single item observable`() {
|
||||
val subject = PublishSubject.create<String>()
|
||||
val future = subject.toFuture()
|
||||
subject.onNext("Hello")
|
||||
assertThat(future.getOrThrow()).isEqualTo("Hello")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `toFuture - empty obserable`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `toFuture - empty obserable`() {
|
||||
val subject = PublishSubject.create<String>()
|
||||
val future = subject.toFuture()
|
||||
subject.onCompleted()
|
||||
@ -26,8 +26,8 @@ class UtilsTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `toFuture - more than one item observable`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `toFuture - more than one item observable`() {
|
||||
val subject = PublishSubject.create<String>()
|
||||
val future = subject.toFuture()
|
||||
subject.onNext("Hello")
|
||||
@ -36,8 +36,8 @@ class UtilsTest {
|
||||
assertThat(future.getOrThrow()).isEqualTo("Hello")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `toFuture - erroring observable`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `toFuture - erroring observable`() {
|
||||
val subject = PublishSubject.create<String>()
|
||||
val future = subject.toFuture()
|
||||
val exception = Exception("Error")
|
||||
@ -47,8 +47,8 @@ class UtilsTest {
|
||||
}.isSameAs(exception)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `toFuture - cancel`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `toFuture - cancel`() {
|
||||
val subject = PublishSubject.create<String>()
|
||||
val future = subject.toFuture()
|
||||
future.cancel(false)
|
||||
|
@ -20,8 +20,8 @@ class ConcurrencyUtilsTest {
|
||||
doNothing().whenever(it).error(any(), any<Throwable>())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `firstOf short circuit`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `firstOf short circuit`() {
|
||||
// Order not significant in this case:
|
||||
val g = firstOf(arrayOf(f2, f1), log) {
|
||||
++invocations
|
||||
@ -38,8 +38,8 @@ class ConcurrencyUtilsTest {
|
||||
verifyNoMoreInteractions(log)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `firstOf re-entrant handler attempt due to cancel`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `firstOf re-entrant handler attempt due to cancel`() {
|
||||
val futures = arrayOf(f1, f2)
|
||||
val g = firstOf(futures, log) {
|
||||
++invocations
|
||||
@ -56,8 +56,8 @@ class ConcurrencyUtilsTest {
|
||||
/**
|
||||
* Note that if you set CancellationException on CompletableFuture it will report isCancelled.
|
||||
*/
|
||||
@Test
|
||||
fun `firstOf re-entrant handler attempt not due to cancel`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `firstOf re-entrant handler attempt not due to cancel`() {
|
||||
val futures = arrayOf(f1, f2)
|
||||
val nonCancel = IllegalStateException()
|
||||
val g = firstOf(futures, log) {
|
||||
@ -73,8 +73,8 @@ class ConcurrencyUtilsTest {
|
||||
assertThatThrownBy { f2.getOrThrow() }.isSameAs(nonCancel)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `firstOf cancel is not special`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `firstOf cancel is not special`() {
|
||||
val g = firstOf(arrayOf(f2, f1), log) {
|
||||
++invocations
|
||||
it.getOrThrow() // This can always do something fancy if 'it' was cancelled.
|
||||
@ -85,8 +85,8 @@ class ConcurrencyUtilsTest {
|
||||
verifyNoMoreInteractions(log)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `match does not pass failure of success block into the failure block`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `match does not pass failure of success block into the failure block`() {
|
||||
val f = CompletableFuture.completedFuture(100)
|
||||
val successes = mutableListOf<Any?>()
|
||||
val failures = mutableListOf<Any?>()
|
||||
@ -101,8 +101,8 @@ class ConcurrencyUtilsTest {
|
||||
assertEquals(emptyList<Any?>(), failures)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `match does not pass ExecutionException to failure block`() {
|
||||
@Test(timeout=300_000)
|
||||
fun `match does not pass ExecutionException to failure block`() {
|
||||
val e = Throwable()
|
||||
val f = CompletableFuture<Void>().apply { completeExceptionally(e) }
|
||||
val successes = mutableListOf<Any?>()
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user