IT. Expert System.

Android Reference

MoreAsserts


android.test

Class MoreAsserts



  • public final class MoreAsserts
    extends Object
    Contains additional assertion methods not found in JUnit.
    • Method Detail

      • assertAssignableFrom

        public static void assertAssignableFrom(Class<?> expected,
                                Object actual)
        Asserts that the class expected is assignable from the object actual. This verifies expected is a parent class or a interface that actual implements.
      • assertAssignableFrom

        public static void assertAssignableFrom(Class<?> expected,
                                Class<?> actual)
        Asserts that class expected is assignable from the class actual. This verifies expected is a parent class or a interface that actual implements.
      • assertEquals

        public static void assertEquals(String message,
                        byte[] expected,
                        byte[] actual)
        Asserts that array actual is the same size and every element equals those in array expected. On failure, message indicates specific element mismatch.
      • assertEquals

        public static void assertEquals(byte[] expected,
                        byte[] actual)
        Asserts that array actual is the same size and every element equals those in array expected. On failure, message indicates specific element mismatch.
      • assertEquals

        public static void assertEquals(String message,
                        int[] expected,
                        int[] actual)
        Asserts that array actual is the same size and every element equals those in array expected. On failure, message indicates first specific element mismatch.
      • assertEquals

        public static void assertEquals(int[] expected,
                        int[] actual)
        Asserts that array actual is the same size and every element equals those in array expected. On failure, message indicates first specific element mismatch.
      • assertEquals

        public static void assertEquals(String message,
                        double[] expected,
                        double[] actual)
        Asserts that array actual is the same size and every element equals those in array expected. On failure, message indicates first specific element mismatch.
      • assertEquals

        public static void assertEquals(double[] expected,
                        double[] actual)
        Asserts that array actual is the same size and every element equals those in array expected. On failure, message indicates first specific element mismatch.
      • assertEquals

        public static void assertEquals(String message,
                        Object[] expected,
                        Object[] actual)
        Asserts that array actual is the same size and every element is the same as those in array expected. Note that this uses equals() instead of == to compare the objects. null will be considered equal to null (unlike SQL). On failure, message indicates first specific element mismatch.
      • assertEquals

        public static void assertEquals(Object[] expected,
                        Object[] actual)
        Asserts that array actual is the same size and every element is the same as those in array expected. Note that this uses == instead of equals() to compare the objects. On failure, message indicates first specific element mismatch.
      • assertEquals

        public static void assertEquals(String message,
                        Set<? extends Object> expected,
                        Set<? extends Object> actual)
        Asserts that two sets contain the same elements.
      • assertEquals

        public static void assertEquals(Set<? extends Object> expected,
                        Set<? extends Object> actual)
        Asserts that two sets contain the same elements.
      • assertMatchesRegex

        public static MatchResult assertMatchesRegex(String message,
                                     String expectedRegex,
                                     String actual)
        Asserts that expectedRegex exactly matches actual and fails with message if it does not. The MatchResult is returned in case the test needs access to any captured groups. Note that you can also use this for a literal string, by wrapping your expected string in Pattern.quote(java.lang.String).
      • assertContainsRegex

        public static MatchResult assertContainsRegex(String message,
                                      String expectedRegex,
                                      String actual)
        Asserts that expectedRegex matches any substring of actual and fails with message if it does not. The Matcher is returned in case the test needs access to any captured groups. Note that you can also use this for a literal string, by wrapping your expected string in Pattern.quote(java.lang.String).
      • assertNotMatchesRegex

        public static void assertNotMatchesRegex(String message,
                                 String expectedRegex,
                                 String actual)
        Asserts that expectedRegex does not exactly match actual, and fails with message if it does. Note that you can also use this for a literal string, by wrapping your expected string in Pattern.quote(java.lang.String).
      • assertNotContainsRegex

        public static void assertNotContainsRegex(String message,
                                  String expectedRegex,
                                  String actual)
        Asserts that expectedRegex does not match any substring of actual, and fails with message if it does. Note that you can also use this for a literal string, by wrapping your expected string in Pattern.quote(java.lang.String).
      • assertContentsInOrder

        public static void assertContentsInOrder(String message,
                                 Iterable<?> actual,
                                 Object... expected)
        Asserts that actual contains precisely the elements expected, and in the same order.
      • assertContentsInOrder

        public static void assertContentsInOrder(Iterable<?> actual,
                                 Object... expected)
        Variant of assertContentsInOrder(String, Iterable, Object...) using a generic message.
      • assertContentsInAnyOrder

        public static void assertContentsInAnyOrder(String message,
                                    Iterable<?> actual,
                                    Object... expected)
        Asserts that actual contains precisely the elements expected, but in any order.
      • assertContentsInAnyOrder

        public static void assertContentsInAnyOrder(Iterable<?> actual,
                                    Object... expected)
        Variant of assertContentsInAnyOrder(String, Iterable, Object...) using a generic message.
      • assertEmpty

        public static void assertEmpty(String message,
                       Iterable<?> iterable)
        Asserts that iterable is empty.
      • assertEmpty

        public static void assertEmpty(String message,
                       Map<?,?> map)
        Asserts that map is empty.
      • assertNotEmpty

        public static void assertNotEmpty(String message,
                          Iterable<?> iterable)
        Asserts that iterable is not empty.
      • assertNotEmpty

        public static void assertNotEmpty(Iterable<?> iterable)
        Variant of assertNotEmpty(String, Iterable) using a generic message.
      • assertNotEmpty

        public static void assertNotEmpty(String message,
                          Map<?,?> map)
        Asserts that map is not empty.
      • checkEqualsAndHashCodeMethods

        public static void checkEqualsAndHashCodeMethods(String message,
                                         Object lhs,
                                         Object rhs,
                                         boolean expectedResult)
        Utility for testing equals() and hashCode() results at once. Tests that lhs.equals(rhs) matches expectedResult, as well as rhs.equals(lhs). Also tests that hashCode() return values are equal if expectedResult is true. (hashCode() is not tested if expectedResult is false, as unequal objects can have equal hashCodes.)
        Parameters:
        lhs - An Object for which equals() and hashCode() are to be tested.
        rhs - As lhs.
        expectedResult - True if the objects should compare equal, false if not.
      • checkEqualsAndHashCodeMethods

        public static void checkEqualsAndHashCodeMethods(Object lhs,
                                         Object rhs,
                                         boolean expectedResult)
        Variant of checkEqualsAndHashCodeMethods(String,Object,Object,boolean...)} using a generic message.


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 45 / 158770662. Delta: 0.05720 с