public class TestUtils extends org.testng.Assert
Constructor and Description |
---|
TestUtils()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
static <T> void |
assertArraysEqual(T[] actual,
T... expected)
Deprecated.
Convenience for
assertListsEquals(List, List) . |
static <T> void |
assertListsEquals(List<T> actual,
List<T> expected)
Deprecated.
Compares two lists for equality; first all the elements are individually compared for equality (if the lists are
of unequal length, only elements up to the shorter length are compared).
|
static <T> void |
assertListsEquals(List<T> actual,
T... expected)
Deprecated.
Convenience for
assertListsEquals(List, List) . |
static void |
assertMessageContains(Throwable t,
String... substrings)
Deprecated.
Asserts that the message property of the throwable contains each of the provided substrings.
|
static <T> T |
create(Class<T> objectType,
Object... fieldValues)
Deprecated.
Creates a new instance of the object using its default constructor, and initializes it (via
set(Object, Object[]) ). |
static Object |
get(Object object,
String fieldName)
Deprecated.
Reads the content of a private field.
|
static <T> T |
set(T object,
Object... fieldValues)
Deprecated.
Initializes private fields (via reflection).
|
protected static <T> void |
showLists(List<T> actual,
List<T> expected)
Deprecated.
|
static void |
unreachable()
Deprecated.
Invoked from code that should not be reachable.
|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEqualsNoOrder, assertEqualsNoOrder, assertFalse, assertFalse, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, fail
public TestUtils()
public static void unreachable()
public static void assertMessageContains(Throwable t, String... substrings)
t
- throwable to checksubstrings
- some number of expected substringspublic static <T> void assertListsEquals(List<T> actual, List<T> expected)
T
- type of objects to compareactual
- actual values to checkexpected
- expected valuespublic static <T> void assertListsEquals(List<T> actual, T... expected)
assertListsEquals(List, List)
.T
- type of objects to compareactual
- actual values to checkexpected
- expected valuespublic static <T> void assertArraysEqual(T[] actual, T... expected)
assertListsEquals(List, List)
.T
- type of objects to compareactual
- actual values to checkexpected
- expected valuespublic static <T> T set(T object, Object... fieldValues)
object
- object to be updatedfieldValues
- string field names and corresponding field valuespublic static Object get(Object object, String fieldName)
object
- to read the private field fromfieldName
- name of field to readpublic static <T> T create(Class<T> objectType, Object... fieldValues)
set(Object, Object[])
).objectType
- typeof object to instantiatefieldValues
- string field names and corresponding field values${project.version} - Copyright © 2003-2015 The Apache Software Foundation.