Package com.google.common.truth
Class Platform
- java.lang.Object
-
- com.google.common.truth.Platform
-
final class Platform extends java.lang.ObjectExtracted routines that need to be swapped in for GWT, to allow for minimal deltas between the GWT and non-GWT version.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static interfacePlatform.JUnitTestRuleWrapping interface ofTestRuleto be used within truth.(package private) static classPlatform.PlatformComparisonFailure
-
Field Summary
Fields Modifier and Type Field Description (package private) static java.lang.StringEXPECT_FAILURE_WARNING_IF_GWT
-
Constructor Summary
Constructors Modifier Constructor Description privatePlatform()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static voidcleanStackTrace(java.lang.Throwable throwable)(package private) static booleancontainsMatch(java.lang.String actual, java.lang.String regex)Determines if the given subject contains a match for the given regex.(package private) static java.lang.StringdoubleToString(double value)(package private) static java.lang.StringfloatToString(float value)(package private) static java.lang.StringgetStackTraceAsString(java.lang.Throwable throwable)Returns a human readable string representation of the throwable's stack trace.(package private) static java.lang.Throwable[]getSuppressed(java.lang.Throwable throwable)Returns an array containing all of the exceptions that were suppressed to deliver the given exception.(package private) static java.lang.StringinferDescription()Tries to infer a name for the root actual value from the bytecode.(package private) static booleanisAndroid()Tests if current platform is Android.private static booleanisInferDescriptionDisabled()(package private) static booleanisInstanceOfType(java.lang.Object instance, java.lang.Class<?> clazz)Returns true if the instance is assignable to the type Clazz.(package private) static com.google.common.collect.ImmutableList<Fact>makeDiff(java.lang.String expected, java.lang.String actual)private static com.google.common.collect.ImmutableList<java.lang.String>splitLines(java.lang.String s)
-
-
-
Field Detail
-
EXPECT_FAILURE_WARNING_IF_GWT
static final java.lang.String EXPECT_FAILURE_WARNING_IF_GWT
- See Also:
- Constant Field Values
-
-
Method Detail
-
isInstanceOfType
static boolean isInstanceOfType(java.lang.Object instance, java.lang.Class<?> clazz)Returns true if the instance is assignable to the type Clazz.
-
containsMatch
static boolean containsMatch(java.lang.String actual, java.lang.String regex)Determines if the given subject contains a match for the given regex.
-
getSuppressed
static java.lang.Throwable[] getSuppressed(java.lang.Throwable throwable)
Returns an array containing all of the exceptions that were suppressed to deliver the given exception. If suppressed exceptions are not supported (pre-Java 1.7), an empty array will be returned.
-
cleanStackTrace
static void cleanStackTrace(java.lang.Throwable throwable)
-
inferDescription
static java.lang.String inferDescription()
Tries to infer a name for the root actual value from the bytecode. The "root" actual value is the value passed toassertThatorthat, as distinct from any later actual values produced by chaining calls likehasMessageThat.
-
makeDiff
static com.google.common.collect.ImmutableList<Fact> makeDiff(java.lang.String expected, java.lang.String actual)
-
splitLines
private static com.google.common.collect.ImmutableList<java.lang.String> splitLines(java.lang.String s)
-
doubleToString
static java.lang.String doubleToString(double value)
-
floatToString
static java.lang.String floatToString(float value)
-
getStackTraceAsString
static java.lang.String getStackTraceAsString(java.lang.Throwable throwable)
Returns a human readable string representation of the throwable's stack trace.
-
isAndroid
static boolean isAndroid()
Tests if current platform is Android.
-
isInferDescriptionDisabled
private static boolean isInferDescriptionDisabled()
-
-