mirror of
https://github.com/corda/corda.git
synced 2025-06-20 08:03:53 +00:00
add timeouts to all tests (#5875)
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user