Stay organized with collections
Save and categorize content based on your preferences.
ComparisonFailure
open class ComparisonFailure : AssertionFailedError
Thrown when an assert equals for Strings failed.
Summary
Public constructors
ComparisonFailure
ComparisonFailure(
message: String!,
expected: String!,
actual: String!)
Properties
message
open val message: String?
Return |
String? |
the detail message string of this Throwable instance (which may be null ). |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# ComparisonFailure\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nDeprecated in [API level 16](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nComparisonFailure\n=================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/test/ComparisonFailure \"View this page in Java\") \n\n```\nopen class ComparisonFailure : AssertionFailedError\n```\n\n|---|---|---|---|-------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) |||||\n| ↳ | [kotlin.Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html) ||||\n| | ↳ | [java.lang.Error](../../java/lang/Error.html#) |||\n| | | ↳ | [android.test.AssertionFailedError](/reference/kotlin/android/test/AssertionFailedError) ||\n| | | | ↳ | [android.test.ComparisonFailure](#) |\n\n*** ** * ** ***\n\n| **This exception was deprecated in API level 16.**\n|\n| use org.junit.ComparisonFailure\n\nThrown when an assert equals for Strings failed.\n\nSummary\n-------\n\n| Public constructors ||\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [ComparisonFailure](#ComparisonFailure(kotlin.String,%20kotlin.String,%20kotlin.String))`(`message:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `expected:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `actual:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` \u003cbr /\u003e |\n\n| Properties ||\n|----------------------------------------------------------------------------------------|------------------------------------------|\n| open [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)? | [message](#message:kotlin.String) \u003cbr /\u003e |\n\nPublic constructors\n-------------------\n\n### ComparisonFailure\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nComparisonFailure(\n message: String!, \n expected: String!, \n actual: String!)\n```\n\nProperties\n----------\n\n### message\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen val message: String?\n```\n\n| Return ||\n|-----------------------------------------------------------------------------------|-------------------------------------------------------------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)? | the detail message string of this `Throwable` instance (which may be `null`). |"]]