类 CahAssert
- java.lang.Object
-
- tech.testnx.cah.common.asserts.CahAssert
-
public class CahAssert extends Object
CahAssert is 100% compatible with testNG Assert- 作者:
- Yun
-
-
构造器概要
构造器 构造器 说明 CahAssert()
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static voidassertEquals(boolean[] actual, boolean[] expected)Asserts that two arrays contain the same elements in the same order.static voidassertEquals(boolean[] actual, boolean[] expected, String message)Asserts that two arrays contain the same elements in the same order.static voidassertEquals(boolean actual, boolean expected)Asserts that two booleans are equal.static voidassertEquals(boolean actual, boolean expected, String message)Asserts that two booleans are equal.static voidassertEquals(boolean actual, Boolean expected)Asserts that two booleans are equal.static voidassertEquals(boolean actual, Boolean expected, String message)Asserts that two booleans are equal.static voidassertEquals(byte[] actual, byte[] expected)Asserts that two arrays contain the same elements in the same order.static voidassertEquals(byte[] actual, byte[] expected, String message)Asserts that two arrays contain the same elements in the same order.static voidassertEquals(byte actual, byte expected)Asserts that two bytes are equal.static voidassertEquals(byte actual, byte expected, String message)Asserts that two bytes are equal.static voidassertEquals(byte actual, Byte expected)Asserts that two bytes are equal.static voidassertEquals(byte actual, Byte expected, String message)Asserts that two bytes are equal.static voidassertEquals(char[] actual, char[] expected)Asserts that two arrays contain the same elements in the same order.static voidassertEquals(char[] actual, char[] expected, String message)Asserts that two arrays contain the same elements in the same order.static voidassertEquals(char actual, char expected)Asserts that two chars are equal.static voidassertEquals(char actual, char expected, String message)Asserts that two chars are equal.static voidassertEquals(char actual, Character expected)Asserts that two chars are equal.static voidassertEquals(char actual, Character expected, String message)Asserts that two chars are equal.static voidassertEquals(double[] actual, double[] expected)Asserts that two arrays contain the same elements in the same order.static voidassertEquals(double[] actual, double[] expected, double delta)Asserts that two arrays contain the equal elements concerning a delta in the same order.static voidassertEquals(double[] actual, double[] expected, double delta, String message)Asserts that two arrays contain the equal elements concerning a delta in the same order.static voidassertEquals(double[] actual, double[] expected, String message)Asserts that two arrays contain the same elements in the same order.static voidassertEquals(double actual, double expected)Asserts that two doubles are equal.static voidassertEquals(double actual, double expected, double delta)Asserts that two doubles are equal concerning a delta.static voidassertEquals(double actual, double expected, double delta, String message)Asserts that two doubles are equal concerning a delta.static voidassertEquals(double actual, double expected, String message)Asserts that two doubles are equal.static voidassertEquals(double actual, Double expected)Asserts that two doubles are equal.static voidassertEquals(double actual, Double expected, String message)Asserts that two doubles are equal.static voidassertEquals(float[] actual, float[] expected)Asserts that two arrays contain the same elements in the same order.static voidassertEquals(float[] actual, float[] expected, float delta)Asserts that two arrays contain the equal elements concerning a delta in the same order.static voidassertEquals(float[] actual, float[] expected, float delta, String message)Asserts that two arrays contain the equal elements concerning a delta in the same order.static voidassertEquals(float[] actual, float[] expected, String message)Asserts that two arrays contain the same elements in the same order.static voidassertEquals(float actual, float expected)Asserts that two floats are equal.static voidassertEquals(float actual, float expected, float delta)Asserts that two floats are equal concerning a delta.static voidassertEquals(float actual, float expected, float delta, String message)Asserts that two floats are equal concerning a delta.static voidassertEquals(float actual, float expected, String message)Asserts that two floats are equal.static voidassertEquals(float actual, Float expected)Asserts that two floats are equal.static voidassertEquals(float actual, Float expected, String message)Asserts that two floats are equal.static voidassertEquals(int[] actual, int[] expected)Asserts that two arrays contain the same elements in the same order.static voidassertEquals(int[] actual, int[] expected, String message)Asserts that two arrays contain the same elements in the same order.static voidassertEquals(int actual, int expected)Asserts that two ints are equal.static voidassertEquals(int actual, int expected, String message)Asserts that two ints are equal.static voidassertEquals(int actual, Integer expected)Asserts that two ints are equal.static voidassertEquals(int actual, Integer expected, String message)Asserts that two ints are equal.static voidassertEquals(long[] actual, long[] expected)Asserts that two arrays contain the same elements in the same order.static voidassertEquals(long[] actual, long[] expected, String message)Asserts that two arrays contain the same elements in the same order.static voidassertEquals(long actual, long expected)Asserts that two longs are equal.static voidassertEquals(long actual, long expected, String message)Asserts that two longs are equal.static voidassertEquals(long actual, Long expected)Asserts that two longs are equal.static voidassertEquals(short[] actual, short[] expected)Asserts that two arrays contain the same elements in the same order.static voidassertEquals(short[] actual, short[] expected, String message)Asserts that two arrays contain the same elements in the same order.static voidassertEquals(short actual, short expected)Asserts that two shorts are equal.static voidassertEquals(short actual, short expected, String message)Asserts that two shorts are equal.static voidassertEquals(short actual, Short expected)Asserts that two shorts are equal.static voidassertEquals(short actual, Short expected, String message)Asserts that two shorts are equal.static voidassertEquals(Boolean actual, boolean expected)Asserts that two booleans are equal.static voidassertEquals(Boolean actual, boolean expected, String message)Asserts that two booleans are equal.static voidassertEquals(Boolean actual, Boolean expected)Asserts that two booleans are equal.static voidassertEquals(Boolean actual, Boolean expected, String message)Asserts that two booleans are equal.static voidassertEquals(Byte actual, byte expected)Asserts that two bytes are equal.static voidassertEquals(Byte actual, byte expected, String message)Asserts that two bytes are equal.static voidassertEquals(Byte actual, Byte expected)Asserts that two bytes are equal.static voidassertEquals(Byte actual, Byte expected, String message)Asserts that two bytes are equal.static voidassertEquals(Character actual, char expected)Asserts that two chars are equal.static voidassertEquals(Character actual, char expected, String message)Asserts that two chars are equal.static voidassertEquals(Character actual, Character expected)Asserts that two chars are equal.static voidassertEquals(Character actual, Character expected, String message)Asserts that two chars are equal.static voidassertEquals(Double actual, double expected)Asserts that two doubles are equal.static voidassertEquals(Double actual, double expected, String message)Asserts that two doubles are equal.static voidassertEquals(Double actual, Double expected)Asserts that two doubles are equal.static voidassertEquals(Double actual, Double expected, String message)Asserts that two doubles are equal.static voidassertEquals(Float actual, float expected)Asserts that two floats are equal.static voidassertEquals(Float actual, float expected, String message)Asserts that two floats are equal.static voidassertEquals(Float actual, Float expected)Asserts that two floats are equal.static voidassertEquals(Float actual, Float expected, String message)Asserts that two floats are equal.static voidassertEquals(Integer actual, int expected)Asserts that two ints are equal.static voidassertEquals(Integer actual, int expected, String message)Asserts that two ints are equal.static voidassertEquals(Integer actual, Integer expected)Asserts that two ints are equal.static voidassertEquals(Integer actual, Integer expected, String message)Asserts that two ints are equal.static voidassertEquals(Iterable<?> actual, Iterable<?> expected)Asserts that two iterables return iterators with the same elements in the same order.static voidassertEquals(Iterable<?> actual, Iterable<?> expected, String message)Asserts that two iterables return iterators with the same elements in the same order.static voidassertEquals(Long actual, long expected)Asserts that two longs are equal.static voidassertEquals(Long actual, long expected, String message)Asserts that two longs are equal.static voidassertEquals(Long actual, Long expected)Asserts that two longs are equal.static voidassertEquals(Long actual, Long expected, String message)Asserts that two longs are equal.static voidassertEquals(Object[] actual, Object[] expected)Asserts that two arrays contain the same elements in the same order.static voidassertEquals(Object[] actual, Object[] expected, String message)Asserts that two arrays contain the same elements in the same order.static voidassertEquals(Object actual, Object expected)Asserts that two objects are equal.static voidassertEquals(Object actual, Object expected, String message)Asserts that two objects are equal.static voidassertEquals(Short actual, short expected)Asserts that two shorts are equal.static voidassertEquals(Short actual, short expected, String message)Asserts that two shorts are equal.static voidassertEquals(Short actual, Short expected)Asserts that two shorts are equal.static voidassertEquals(Short actual, Short expected, String message)Asserts that two shorts are equal.static voidassertEquals(String actual, String expected)Asserts that two Strings are equal.static voidassertEquals(String actual, String expected, String message)Asserts that two Strings are equal.static voidassertEquals(Collection<?> actual, Collection<?> expected)Asserts that two collections contain the same elements in the same order.static voidassertEquals(Collection<?> actual, Collection<?> expected, String message)Asserts that two collections contain the same elements in the same order.static voidassertEquals(Iterator<?> actual, Iterator<?> expected)Asserts that two iterators return the same elements in the same order.static voidassertEquals(Iterator<?> actual, Iterator<?> expected, String message)Asserts that two iterators return the same elements in the same order.static voidassertEquals(Map<?,?> actual, Map<?,?> expected)Asserts that two maps are equal.static voidassertEquals(Map<?,?> actual, Map<?,?> expected, String message)Asserts that two maps are equal.static voidassertEquals(Set<?> actual, Set<?> expected)Asserts that two sets are equal.static voidassertEquals(Set<?> actual, Set<?> expected, String message)Assert set equalsstatic voidassertEqualsDeep(Map<?,?> actual, Map<?,?> expected)static voidassertEqualsDeep(Map<?,?> actual, Map<?,?> expected, String message)static voidassertEqualsDeep(Set<?> actual, Set<?> expected)Assert set equals Deeplystatic voidassertEqualsDeep(Set<?> actual, Set<?> expected, String message)Assert set equals Deeplystatic voidassertEqualsNoOrder(Object[] actual, Object[] expected)Asserts that two arrays contain the same elements in no particular order.static voidassertEqualsNoOrder(Object[] actual, Object[] expected, String message)Asserts that two arrays contain the same elements in no particular order.static voidassertEqualsNoOrder(Collection<?> actual, Collection<?> expected)Asserts that two collection contain the same elements in no particular order.static voidassertEqualsNoOrder(Collection<?> actual, Collection<?> expected, String message)Asserts that two collection contain the same elements in no particular order.static voidassertEqualsNoOrder(Iterator<?> actual, Iterator<?> expected)Asserts that two iterators contain the same elements in no particular order.static voidassertEqualsNoOrder(Iterator<?> actual, Iterator<?> expected, String message)Asserts that two iterators contain the same elements in no particular order.static voidassertFalse(boolean condition)Asserts that a condition is false.static voidassertFalse(boolean condition, String message)Asserts that a condition is false.static <T> voidassertListContains(List<T> list, Predicate<T> predicate, String message)Asserts that List contains object by specific Predicate.static <T> voidassertListContainsObject(List<T> list, T object, String message)Asserts that List contains object.static <T> voidassertListNotContains(List<T> list, Predicate<T> predicate, String message)Asserts that List not contains object by specific Predicate.static <T> voidassertListNotContainsObject(List<T> list, T object, String message)Asserts that List not contains object.static voidassertNotEquals(double actual, double expected, double delta)static voidassertNotEquals(double actual, double expected, double delta, String message)static voidassertNotEquals(float actual, float expected, float delta)static voidassertNotEquals(float actual, float expected, float delta, String message)static voidassertNotEquals(Object[] actual, Object[] expected)static voidassertNotEquals(Object[] actual, Object[] expected, String message)static voidassertNotEquals(Object actual, Object expected)static voidassertNotEquals(Object actual, Object expected, String message)static voidassertNotEquals(Collection<?> actual, Collection<?> expected)static voidassertNotEquals(Collection<?> actual, Collection<?> expected, String message)static voidassertNotEquals(Iterator<?> actual, Iterator<?> expected)static voidassertNotEquals(Iterator<?> actual, Iterator<?> expected, String message)static voidassertNotEquals(Map<?,?> actual, Map<?,?> expected)static voidassertNotEquals(Map<?,?> actual, Map<?,?> expected, String message)static voidassertNotEquals(Set<?> actual, Set<?> expected)static voidassertNotEquals(Set<?> actual, Set<?> expected, String message)static voidassertNotEqualsDeep(Map<?,?> actual, Map<?,?> expected)static voidassertNotEqualsDeep(Map<?,?> actual, Map<?,?> expected, String message)static voidassertNotEqualsDeep(Set<?> actual, Set<?> expected)static voidassertNotEqualsDeep(Set<?> actual, Set<?> expected, String message)static voidassertNotNull(Object object)Asserts that an object isn't null.static voidassertNotNull(Object object, String message)Asserts that an object isn't null.static voidassertNotSame(Object actual, Object expected)Asserts that two objects do not refer to the same object.static voidassertNotSame(Object actual, Object expected, String message)Asserts that two objects do not refer to the same objects.static voidassertNull(Object object)Asserts that an object is null.static voidassertNull(Object object, String message)Asserts that an object is null.static voidassertSame(Object actual, Object expected)Asserts that two objects refer to the same object.static voidassertSame(Object actual, Object expected, String message)Asserts that two objects refer to the same object.static <T extends Throwable>
voidassertThrows(Class<T> throwableClass, org.testng.Assert.ThrowingRunnable runnable)Asserts thatrunnablethrows an exception of typethrowableClasswhen executed.static <T extends Throwable>
voidassertThrows(String message, Class<T> throwableClass, org.testng.Assert.ThrowingRunnable runnable)Asserts thatrunnablethrows an exception of typethrowableClasswhen executed.static voidassertThrows(org.testng.Assert.ThrowingRunnable runnable)Asserts thatrunnablethrows an exception when invoked.static voidassertTrue(boolean condition)Asserts that a condition is true.static voidassertTrue(boolean condition, String message)Asserts that a condition is true.static <T extends Throwable>
TexpectThrows(Class<T> throwableClass, org.testng.Assert.ThrowingRunnable runnable)Asserts thatrunnablethrows an exception of typethrowableClasswhen executed and returns the exception.static <T extends Throwable>
TexpectThrows(String message, Class<T> throwableClass, org.testng.Assert.ThrowingRunnable runnable)Asserts thatrunnablethrows an exception of typethrowableClasswhen executed and returns the exception.static voidfail()Fails a test with no message.static voidfail(String message)Fails a test with the given message.static voidfail(String message, Throwable realCause)Fails a test with the given message and wrapping the original exception.
-
-
-
方法详细资料
-
assertTrue
public static void assertTrue(boolean condition, String message)Asserts that a condition is true. If it isn't, an AssertionError, with the given message, is thrown.- 参数:
condition- the condition to evaluatemessage- the assertion error message
-
assertTrue
public static void assertTrue(boolean condition)
Asserts that a condition is true. If it isn't, an AssertionError is thrown.- 参数:
condition- the condition to evaluate
-
assertFalse
public static void assertFalse(boolean condition, String message)Asserts that a condition is false. If it isn't, an AssertionError, with the given message, is thrown.- 参数:
condition- the condition to evaluatemessage- the assertion error message
-
assertFalse
public static void assertFalse(boolean condition)
Asserts that a condition is false. If it isn't, an AssertionError is thrown.- 参数:
condition- the condition to evaluate
-
fail
public static void fail(String message, Throwable realCause)
Fails a test with the given message and wrapping the original exception.- 参数:
message- the assertion error messagerealCause- the original exception
-
fail
public static void fail(String message)
Fails a test with the given message.- 参数:
message- the assertion error message
-
fail
public static void fail()
Fails a test with no message.
-
assertEquals
public static void assertEquals(Object actual, Object expected)
Asserts that two objects are equal. If they are not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertEquals
public static void assertEquals(Object actual, Object expected, String message)
Asserts that two objects are equal. If they are not, an AssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertEquals
public static void assertEquals(boolean[] actual, boolean[] expected)Asserts that two arrays contain the same elements in the same order. If they do not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertEquals
public static void assertEquals(boolean[] actual, boolean[] expected, String message)Asserts that two arrays contain the same elements in the same order. If they do not, an AssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertEquals
public static void assertEquals(byte[] actual, byte[] expected)Asserts that two arrays contain the same elements in the same order. If they do not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertEquals
public static void assertEquals(byte[] actual, byte[] expected, String message)Asserts that two arrays contain the same elements in the same order. If they do not, an AssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertEquals
public static void assertEquals(short[] actual, short[] expected)Asserts that two arrays contain the same elements in the same order. If they do not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertEquals
public static void assertEquals(short[] actual, short[] expected, String message)Asserts that two arrays contain the same elements in the same order. If they do not, an AssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertEquals
public static void assertEquals(int[] actual, int[] expected)Asserts that two arrays contain the same elements in the same order. If they do not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertEquals
public static void assertEquals(int[] actual, int[] expected, String message)Asserts that two arrays contain the same elements in the same order. If they do not, an AssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertEquals
public static void assertEquals(char[] actual, char[] expected)Asserts that two arrays contain the same elements in the same order. If they do not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertEquals
public static void assertEquals(char[] actual, char[] expected, String message)Asserts that two arrays contain the same elements in the same order. If they do not, an AssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertEquals
public static void assertEquals(float[] actual, float[] expected)Asserts that two arrays contain the same elements in the same order. If they do not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertEquals
public static void assertEquals(float[] actual, float[] expected, String message)Asserts that two arrays contain the same elements in the same order. If they do not, an AssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertEquals
public static void assertEquals(float[] actual, float[] expected, float delta)Asserts that two arrays contain the equal elements concerning a delta in the same order. If they do not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected valuedelta- the absolute tolerable difference between the actual and expected values
-
assertEquals
public static void assertEquals(float[] actual, float[] expected, float delta, String message)Asserts that two arrays contain the equal elements concerning a delta in the same order. If they do not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected valuedelta- the absolute tolerable difference between the actual and expected valuesmessage- the assertion error message
-
assertEquals
public static void assertEquals(double[] actual, double[] expected)Asserts that two arrays contain the same elements in the same order. If they do not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertEquals
public static void assertEquals(double[] actual, double[] expected, String message)Asserts that two arrays contain the same elements in the same order. If they do not, an AssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertEquals
public static void assertEquals(double[] actual, double[] expected, double delta)Asserts that two arrays contain the equal elements concerning a delta in the same order. If they do not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected valuedelta- the absolute tolerable difference between the actual and expected values
-
assertEquals
public static void assertEquals(double[] actual, double[] expected, double delta, String message)Asserts that two arrays contain the equal elements concerning a delta in the same order. If they do not, an AssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuedelta- the absolute tolerable difference between the actual and expected valuesmessage- the assertion error message
-
assertEquals
public static void assertEquals(long[] actual, long[] expected)Asserts that two arrays contain the same elements in the same order. If they do not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertEquals
public static void assertEquals(long[] actual, long[] expected, String message)Asserts that two arrays contain the same elements in the same order. If they do not, an AssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertEquals
public static void assertEquals(String actual, String expected)
Asserts that two Strings are equal. If they are not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertEquals
public static void assertEquals(String actual, String expected, String message)
Asserts that two Strings are equal. If they are not, an AssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertEquals
public static void assertEquals(double actual, double expected, double delta)Asserts that two doubles are equal concerning a delta. If they are not, an AssertionError is thrown. If the expected value is infinity then the delta value is ignored.- 参数:
actual- the actual valueexpected- the expected valuedelta- the absolute tolerable difference between the actual and expected values
-
assertEquals
public static void assertEquals(double actual, double expected, double delta, String message)Asserts that two doubles are equal concerning a delta. If they are not, an AssertionError, with the given message, is thrown. If the expected value is infinity then the delta value is ignored.- 参数:
actual- the actual valueexpected- the expected valuedelta- the absolute tolerable difference between the actual and expected valuesmessage- the assertion error message
-
assertEquals
public static void assertEquals(double actual, double expected, String message)Asserts that two doubles are equal. If they are not, an AssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertEquals
public static void assertEquals(Double actual, double expected, String message)
Asserts that two doubles are equal. If they are not, an AssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertEquals
public static void assertEquals(double actual, Double expected, String message)Asserts that two doubles are equal. If they are not, an AssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertEquals
public static void assertEquals(Double actual, Double expected, String message)
Asserts that two doubles are equal. If they are not, an AssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertEquals
public static void assertEquals(double actual, double expected)Asserts that two doubles are equal. If they are not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertEquals
public static void assertEquals(Double actual, double expected)
Asserts that two doubles are equal. If they are not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertEquals
public static void assertEquals(double actual, Double expected)Asserts that two doubles are equal. If they are not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertEquals
public static void assertEquals(Double actual, Double expected)
Asserts that two doubles are equal. If they are not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertEquals
public static void assertEquals(float actual, float expected, float delta, String message)Asserts that two floats are equal concerning a delta. If they are not, an AssertionError, with the given message, is thrown. If the expected value is infinity then the delta value is ignored.- 参数:
actual- the actual valueexpected- the expected valuedelta- the absolute tolerable difference between the actual and expected valuesmessage- the assertion error message
-
assertEquals
public static void assertEquals(float actual, float expected, float delta)Asserts that two floats are equal concerning a delta. If they are not, an AssertionError is thrown. If the expected value is infinity then the delta value is ignored.- 参数:
actual- the actual valueexpected- the expected valuedelta- the absolute tolerable difference between the actual and expected values
-
assertEquals
public static void assertEquals(float actual, float expected, String message)Asserts that two floats are equal. If they are not, an AssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertEquals
public static void assertEquals(Float actual, float expected, String message)
Asserts that two floats are equal. If they are not, an AssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertEquals
public static void assertEquals(float actual, Float expected, String message)Asserts that two floats are equal. If they are not, an AssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertEquals
public static void assertEquals(Float actual, Float expected, String message)
Asserts that two floats are equal. If they are not, an AssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertEquals
public static void assertEquals(float actual, float expected)Asserts that two floats are equal. If they are not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertEquals
public static void assertEquals(Float actual, float expected)
Asserts that two floats are equal. If they are not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertEquals
public static void assertEquals(float actual, Float expected)Asserts that two floats are equal. If they are not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertEquals
public static void assertEquals(Float actual, Float expected)
Asserts that two floats are equal. If they are not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertEquals
public static void assertEquals(long actual, long expected, String message)Asserts that two longs are equal. If they are not, an AssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertEquals
public static void assertEquals(Long actual, long expected, String message)
Asserts that two longs are equal. If they are not, an AssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertEquals
public static void assertEquals(Long actual, Long expected, String message)
Asserts that two longs are equal. If they are not, an AssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertEquals
public static void assertEquals(long actual, long expected)Asserts that two longs are equal. If they are not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertEquals
public static void assertEquals(Long actual, long expected)
Asserts that two longs are equal. If they are not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertEquals
public static void assertEquals(long actual, Long expected)Asserts that two longs are equal. If they are not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertEquals
public static void assertEquals(Long actual, Long expected)
Asserts that two longs are equal. If they are not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertEquals
public static void assertEquals(boolean actual, boolean expected, String message)Asserts that two booleans are equal. If they are not, an AssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertEquals
public static void assertEquals(Boolean actual, boolean expected, String message)
Asserts that two booleans are equal. If they are not, an AssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertEquals
public static void assertEquals(boolean actual, Boolean expected, String message)Asserts that two booleans are equal. If they are not, an AssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertEquals
public static void assertEquals(Boolean actual, Boolean expected, String message)
Asserts that two booleans are equal. If they are not, an AssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertEquals
public static void assertEquals(boolean actual, boolean expected)Asserts that two booleans are equal. If they are not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertEquals
public static void assertEquals(Boolean actual, boolean expected)
Asserts that two booleans are equal. If they are not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertEquals
public static void assertEquals(Boolean actual, Boolean expected)
Asserts that two booleans are equal. If they are not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertEquals
public static void assertEquals(boolean actual, Boolean expected)Asserts that two booleans are equal. If they are not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertEquals
public static void assertEquals(byte actual, byte expected, String message)Asserts that two bytes are equal. If they are not, an AssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertEquals
public static void assertEquals(Byte actual, byte expected, String message)
Asserts that two bytes are equal. If they are not, an AssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertEquals
public static void assertEquals(byte actual, Byte expected, String message)Asserts that two bytes are equal. If they are not, an AssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertEquals
public static void assertEquals(Byte actual, Byte expected, String message)
Asserts that two bytes are equal. If they are not, an AssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertEquals
public static void assertEquals(byte actual, byte expected)Asserts that two bytes are equal. If they are not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertEquals
public static void assertEquals(Byte actual, byte expected)
Asserts that two bytes are equal. If they are not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertEquals
public static void assertEquals(Byte actual, Byte expected)
Asserts that two bytes are equal. If they are not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertEquals
public static void assertEquals(byte actual, Byte expected)Asserts that two bytes are equal. If they are not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertEquals
public static void assertEquals(char actual, char expected, String message)Asserts that two chars are equal. If they are not, an AssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertEquals
public static void assertEquals(Character actual, char expected, String message)
Asserts that two chars are equal. If they are not, an AssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertEquals
public static void assertEquals(char actual, Character expected, String message)Asserts that two chars are equal. If they are not, an AssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertEquals
public static void assertEquals(Character actual, Character expected, String message)
Asserts that two chars are equal. If they are not, an AssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertEquals
public static void assertEquals(char actual, char expected)Asserts that two chars are equal. If they are not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertEquals
public static void assertEquals(Character actual, char expected)
Asserts that two chars are equal. If they are not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertEquals
public static void assertEquals(char actual, Character expected)Asserts that two chars are equal. If they are not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertEquals
public static void assertEquals(Character actual, Character expected)
Asserts that two chars are equal. If they are not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertEquals
public static void assertEquals(short actual, short expected, String message)Asserts that two shorts are equal. If they are not, an AssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertEquals
public static void assertEquals(Short actual, short expected, String message)
Asserts that two shorts are equal. If they are not, an AssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertEquals
public static void assertEquals(short actual, Short expected, String message)Asserts that two shorts are equal. If they are not, an AssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertEquals
public static void assertEquals(Short actual, Short expected, String message)
Asserts that two shorts are equal. If they are not, an AssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertEquals
public static void assertEquals(short actual, short expected)Asserts that two shorts are equal. If they are not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertEquals
public static void assertEquals(Short actual, short expected)
Asserts that two shorts are equal. If they are not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertEquals
public static void assertEquals(short actual, Short expected)Asserts that two shorts are equal. If they are not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertEquals
public static void assertEquals(Short actual, Short expected)
Asserts that two shorts are equal. If they are not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertEquals
public static void assertEquals(int actual, int expected, String message)Asserts that two ints are equal. If they are not, an AssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertEquals
public static void assertEquals(Integer actual, int expected, String message)
Asserts that two ints are equal. If they are not, an AssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertEquals
public static void assertEquals(int actual, Integer expected, String message)Asserts that two ints are equal. If they are not, an AssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertEquals
public static void assertEquals(Integer actual, Integer expected, String message)
Asserts that two ints are equal. If they are not, an AssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertEquals
public static void assertEquals(int actual, int expected)Asserts that two ints are equal. If they are not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertEquals
public static void assertEquals(Integer actual, int expected)
Asserts that two ints are equal. If they are not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertEquals
public static void assertEquals(int actual, Integer expected)Asserts that two ints are equal. If they are not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertEquals
public static void assertEquals(Integer actual, Integer expected)
Asserts that two ints are equal. If they are not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertNotNull
public static void assertNotNull(Object object)
Asserts that an object isn't null. If it is, an AssertionError is thrown.- 参数:
object- the assertion object
-
assertNotNull
public static void assertNotNull(Object object, String message)
Asserts that an object isn't null. If it is, an AssertionError, with the given message, is thrown.- 参数:
object- the assertion objectmessage- the assertion error message
-
assertNull
public static void assertNull(Object object)
Asserts that an object is null. If it is not, an AssertionError, with the given message, is thrown.- 参数:
object- the assertion object
-
assertNull
public static void assertNull(Object object, String message)
Asserts that an object is null. If it is not, an AssertionError, with the given message, is thrown.- 参数:
object- the assertion objectmessage- the assertion error message
-
assertSame
public static void assertSame(Object actual, Object expected, String message)
Asserts that two objects refer to the same object. If they do not, an AssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertSame
public static void assertSame(Object actual, Object expected)
Asserts that two objects refer to the same object. If they do not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertNotSame
public static void assertNotSame(Object actual, Object expected, String message)
Asserts that two objects do not refer to the same objects. If they do, an AssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertNotSame
public static void assertNotSame(Object actual, Object expected)
Asserts that two objects do not refer to the same object. If they do, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertEquals
public static void assertEquals(Collection<?> actual, Collection<?> expected)
Asserts that two collections contain the same elements in the same order. If they do not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertEquals
public static void assertEquals(Collection<?> actual, Collection<?> expected, String message)
Asserts that two collections contain the same elements in the same order. If they do not, an AssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertEquals
public static void assertEquals(Iterator<?> actual, Iterator<?> expected)
Asserts that two iterators return the same elements in the same order. If they do not, an AssertionError is thrown. Please note that this assert iterates over the elements and modifies the state of the iterators.- 参数:
actual- the actual valueexpected- the expected value
-
assertEquals
public static void assertEquals(Iterator<?> actual, Iterator<?> expected, String message)
Asserts that two iterators return the same elements in the same order. If they do not, an AssertionError, with the given message, is thrown. Please note that this assert iterates over the elements and modifies the state of the iterators.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertEquals
public static void assertEquals(Iterable<?> actual, Iterable<?> expected)
Asserts that two iterables return iterators with the same elements in the same order. If they do not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertEquals
public static void assertEquals(Iterable<?> actual, Iterable<?> expected, String message)
Asserts that two iterables return iterators with the same elements in the same order. If they do not, an AssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertEquals
public static void assertEquals(Object[] actual, Object[] expected)
Asserts that two arrays contain the same elements in the same order. If they do not, an AssertionError is thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertEquals
public static void assertEquals(Object[] actual, Object[] expected, String message)
Asserts that two arrays contain the same elements in the same order. If they do not, an AssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertEqualsNoOrder
public static void assertEqualsNoOrder(Object[] actual, Object[] expected, String message)
Asserts that two arrays contain the same elements in no particular order. If they do not, anAssertionError, with the given message, is thrown. The arrays are not compared 'deeply', that means, if the elements are arrays as well theirequalsmethod is used which only checks for reference equality.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertEqualsNoOrder
public static void assertEqualsNoOrder(Object[] actual, Object[] expected)
Asserts that two arrays contain the same elements in no particular order. If they do not, anAssertionErroris thrown. The arrays are not compared 'deeply', that means, if the elements are arrays as well theirequalsmethod is used which only checks for reference equality.- 参数:
actual- the actual valueexpected- the expected value
-
assertEqualsNoOrder
public static void assertEqualsNoOrder(Collection<?> actual, Collection<?> expected, String message)
Asserts that two collection contain the same elements in no particular order. If they do not, anAssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertEqualsNoOrder
public static void assertEqualsNoOrder(Collection<?> actual, Collection<?> expected)
Asserts that two collection contain the same elements in no particular order. If they do not, anAssertionErroris thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertEqualsNoOrder
public static void assertEqualsNoOrder(Iterator<?> actual, Iterator<?> expected, String message)
Asserts that two iterators contain the same elements in no particular order. If they do not, anAssertionError, with the given message, is thrown.- 参数:
actual- the actual valueexpected- the expected valuemessage- the assertion error message
-
assertEqualsNoOrder
public static void assertEqualsNoOrder(Iterator<?> actual, Iterator<?> expected)
Asserts that two iterators contain the same elements in no particular order. If they do not, anAssertionErroris thrown.- 参数:
actual- the actual valueexpected- the expected value
-
assertEquals
public static void assertEquals(Set<?> actual, Set<?> expected)
Asserts that two sets are equal.- 参数:
actual- The actual valueexpected- The expected value
-
assertEquals
public static void assertEquals(Set<?> actual, Set<?> expected, String message)
Assert set equals- 参数:
actual- The actual valueexpected- The expected valuemessage- The message
-
assertEqualsDeep
public static void assertEqualsDeep(Set<?> actual, Set<?> expected, String message)
Assert set equals Deeply- 参数:
actual- The actual valueexpected- The expected valuemessage- The message
-
assertEqualsDeep
public static void assertEqualsDeep(Set<?> actual, Set<?> expected)
Assert set equals Deeply- 参数:
actual- The actual valueexpected- The expected value
-
assertEquals
public static void assertEquals(Map<?,?> actual, Map<?,?> expected)
Asserts that two maps are equal.- 参数:
actual- The actual valueexpected- The expected value
-
assertEquals
public static void assertEquals(Map<?,?> actual, Map<?,?> expected, String message)
Asserts that two maps are equal.- 参数:
actual- The actual valueexpected- The expected valuemessage- The message
-
assertEqualsDeep
public static void assertEqualsDeep(Map<?,?> actual, Map<?,?> expected, String message)
-
assertNotEquals
public static void assertNotEquals(Object[] actual, Object[] expected, String message)
-
assertNotEquals
public static void assertNotEquals(Iterator<?> actual, Iterator<?> expected, String message)
-
assertNotEquals
public static void assertNotEquals(Collection<?> actual, Collection<?> expected, String message)
-
assertNotEquals
public static void assertNotEquals(Collection<?> actual, Collection<?> expected)
-
assertNotEquals
public static void assertNotEquals(float actual, float expected, float delta, String message)
-
assertNotEquals
public static void assertNotEquals(float actual, float expected, float delta)
-
assertNotEquals
public static void assertNotEquals(double actual, double expected, double delta, String message)
-
assertNotEquals
public static void assertNotEquals(double actual, double expected, double delta)
-
assertNotEqualsDeep
public static void assertNotEqualsDeep(Set<?> actual, Set<?> expected, String message)
-
assertNotEquals
public static void assertNotEquals(Map<?,?> actual, Map<?,?> expected, String message)
-
assertNotEqualsDeep
public static void assertNotEqualsDeep(Map<?,?> actual, Map<?,?> expected, String message)
-
assertThrows
public static void assertThrows(org.testng.Assert.ThrowingRunnable runnable)
Asserts thatrunnablethrows an exception when invoked. If it does not, anAssertionErroris thrown.- 参数:
runnable- A function that is expected to throw an exception when invoked
-
assertThrows
public static <T extends Throwable> void assertThrows(Class<T> throwableClass, org.testng.Assert.ThrowingRunnable runnable)
Asserts thatrunnablethrows an exception of typethrowableClasswhen executed. If it does not throw an exception, anAssertionErroris thrown. If it throws the wrong type of exception, anAssertionErroris thrown describing the mismatch; the exception that was actually thrown can be obtained by callingThrowable.getCause().- 类型参数:
T- the expected type of the exception- 参数:
throwableClass- the expected type of the exceptionrunnable- A function that is expected to throw an exception when invoked
-
assertThrows
public static <T extends Throwable> void assertThrows(String message, Class<T> throwableClass, org.testng.Assert.ThrowingRunnable runnable)
Asserts thatrunnablethrows an exception of typethrowableClasswhen executed. If it does not throw an exception, anAssertionErroris thrown. If it throws the wrong type of exception, anAssertionErroris thrown describing the mismatch; the exception that was actually thrown can be obtained by callingThrowable.getCause().- 类型参数:
T- the expected type of the exception- 参数:
message- fail messagethrowableClass- the expected type of the exceptionrunnable- A function that is expected to throw an exception when invoked
-
expectThrows
public static <T extends Throwable> T expectThrows(Class<T> throwableClass, org.testng.Assert.ThrowingRunnable runnable)
Asserts thatrunnablethrows an exception of typethrowableClasswhen executed and returns the exception. Ifrunnabledoes not throw an exception, anAssertionErroris thrown. If it throws the wrong type of exception, anAssertionErroris thrown describing the mismatch; the exception that was actually thrown can be obtained by callingThrowable.getCause().- 类型参数:
T- the expected type of the exception- 参数:
throwableClass- the expected type of the exceptionrunnable- A function that is expected to throw an exception when invoked- 返回:
- The exception thrown by
runnable - 从以下版本开始:
- 6.9.5
-
expectThrows
public static <T extends Throwable> T expectThrows(String message, Class<T> throwableClass, org.testng.Assert.ThrowingRunnable runnable)
Asserts thatrunnablethrows an exception of typethrowableClasswhen executed and returns the exception. Ifrunnabledoes not throw an exception, anAssertionErroris thrown. If it throws the wrong type of exception, anAssertionErroris thrown describing the mismatch; the exception that was actually thrown can be obtained by callingThrowable.getCause().- 类型参数:
T- the expected type of the exception- 参数:
message- fail messagethrowableClass- the expected type of the exceptionrunnable- A function that is expected to throw an exception when invoked- 返回:
- The exception thrown by
runnable
-
assertListContainsObject
public static <T> void assertListContainsObject(List<T> list, T object, String message)
Asserts that List contains object. Uses java.util.List#contains method, be sure that equals and hashCode of tested object are overridden.- 类型参数:
T- type of object- 参数:
list- the list to search inobject- the object to search in listmessage- the fail message
-
assertListNotContainsObject
public static <T> void assertListNotContainsObject(List<T> list, T object, String message)
Asserts that List not contains object. Opposite to assertListContainsObject() Uses java.util.List#contains method, be sure that equals and hashCode of tested object are overridden.- 类型参数:
T- type of object- 参数:
list- the list to search inobject- to search in listmessage- the fail message
-
assertListContains
public static <T> void assertListContains(List<T> list, Predicate<T> predicate, String message)
Asserts that List contains object by specific Predicate. Uses java.util.stream.Stream#anyMatch(java.util.function.Predicate) method.- 类型参数:
T- type of object- 参数:
list- the list to search inpredicate- the Predicate to match objectmessage- the fail message
-
assertListNotContains
public static <T> void assertListNotContains(List<T> list, Predicate<T> predicate, String message)
Asserts that List not contains object by specific Predicate. Opposite to assertListContains() method. Uses java.util.stream.Stream#noneMatch(java.util.function.Predicate) method.- 类型参数:
T- type of object- 参数:
list- the list to search inpredicate- the Predicate to match objectmessage- the fail message
-
-