|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.fest.assertions.internal.LongArrays
public class LongArrays
Reusable assertions for arrays of long
s.
Constructor Summary | |
---|---|
LongArrays(org.fest.util.ComparisonStrategy comparisonStrategy)
|
Method Summary | |
---|---|
void |
assertContains(AssertionInfo info,
long[] actual,
long[] values)
Asserts that the given array contains the given values, in any order. |
void |
assertContains(AssertionInfo info,
long[] actual,
long value,
Index index)
Verifies that the given array contains the given value at the given index. |
void |
assertContainsOnly(AssertionInfo info,
long[] actual,
long[] values)
Asserts that the given array contains only the given values and nothing else, in any order. |
void |
assertContainsSequence(AssertionInfo info,
long[] actual,
long[] sequence)
Verifies that the given array contains the given sequence of values, without any other values between them. |
void |
assertDoesNotContain(AssertionInfo info,
long[] actual,
long[] values)
Asserts that the given array does not contain the given values. |
void |
assertDoesNotContain(AssertionInfo info,
long[] actual,
long value,
Index index)
Verifies that the given array does not contain the given value at the given index. |
void |
assertDoesNotHaveDuplicates(AssertionInfo info,
long[] actual)
Asserts that the given array does not have duplicate values. |
void |
assertEmpty(AssertionInfo info,
long[] actual)
Asserts that the given array is empty. |
void |
assertEndsWith(AssertionInfo info,
long[] actual,
long[] sequence)
Verifies that the given array ends with the given sequence of values, without any other values between them. |
void |
assertHasSize(AssertionInfo info,
long[] actual,
int expectedSize)
Asserts that the number of elements in the given array is equal to the expected one. |
void |
assertIsSorted(AssertionInfo info,
long[] actual)
Concrete implementation of ArraySortedAssert.isSorted() . |
void |
assertIsSortedAccordingToComparator(AssertionInfo info,
long[] actual,
Comparator<? extends Long> comparator)
Concrete implementation of ArraySortedAssert.isSortedAccordingTo(Comparator) . |
void |
assertNotEmpty(AssertionInfo info,
long[] actual)
Asserts that the given array is not empty. |
void |
assertNullOrEmpty(AssertionInfo info,
long[] actual)
Asserts that the given array is null or empty. |
void |
assertStartsWith(AssertionInfo info,
long[] actual,
long[] sequence)
Verifies that the given array starts with the given sequence of values, without any other values between them. |
Comparator<?> |
getComparator()
|
static LongArrays |
instance()
Returns the singleton instance of this class. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LongArrays(org.fest.util.ComparisonStrategy comparisonStrategy)
Method Detail |
---|
public static LongArrays instance()
public Comparator<?> getComparator()
public void assertNullOrEmpty(AssertionInfo info, long[] actual)
null
or empty.
info
- contains information about the assertion.actual
- the given array.
AssertionError
- if the given array is not null
*and* contains one or more elements.public void assertEmpty(AssertionInfo info, long[] actual)
info
- contains information about the assertion.actual
- the given array.
AssertionError
- if the given array is null
.
AssertionError
- if the given array is not empty.public void assertNotEmpty(AssertionInfo info, long[] actual)
info
- contains information about the assertion.actual
- the given array.
AssertionError
- if the given array is null
.
AssertionError
- if the given array is empty.public void assertHasSize(AssertionInfo info, long[] actual, int expectedSize)
info
- contains information about the assertion.actual
- the given array.expectedSize
- the expected size of actual
.
AssertionError
- if the given array is null
.
AssertionError
- if the number of elements in the given array is different than the expected one.public void assertContains(AssertionInfo info, long[] actual, long[] values)
info
- contains information about the assertion.actual
- the given array.values
- the values that are expected to be in the given array.
NullPointerException
- if the array of values is null
.
IllegalArgumentException
- if the array of values is empty.
AssertionError
- if the given array is null
.
AssertionError
- if the given array does not contain the given values.public void assertContains(AssertionInfo info, long[] actual, long value, Index index)
info
- contains information about the assertion.actual
- the given array.value
- the value to look for.index
- the index where the value should be stored in the given array.
AssertionError
- if the given array is null
or empty.
NullPointerException
- if the given Index
is null
.
IndexOutOfBoundsException
- if the value of the given Index
is equal to or greater than the size of
the given array.
AssertionError
- if the given array does not contain the given value at the given index.public void assertDoesNotContain(AssertionInfo info, long[] actual, long value, Index index)
info
- contains information about the assertion.actual
- the given array.value
- the value to look for.index
- the index where the value should be stored in the given array.
AssertionError
- if the given array is null
.
NullPointerException
- if the given Index
is null
.
AssertionError
- if the given array contains the given value at the given index.public void assertContainsOnly(AssertionInfo info, long[] actual, long[] values)
info
- contains information about the assertion.actual
- the given array.values
- the values that are expected to be in the given array.
NullPointerException
- if the array of values is null
.
IllegalArgumentException
- if the array of values is empty.
AssertionError
- if the given array is null
.
AssertionError
- if the given array does not contain the given values or if the given
array contains values that are not in the given array.public void assertContainsSequence(AssertionInfo info, long[] actual, long[] sequence)
info
- contains information about the assertion.actual
- the given array.sequence
- the sequence of values to look for.
AssertionError
- if the given array is null
.
NullPointerException
- if the given sequence is null
.
IllegalArgumentException
- if the given sequence is empty.
AssertionError
- if the given array does not contain the given sequence of values.public void assertDoesNotContain(AssertionInfo info, long[] actual, long[] values)
info
- contains information about the assertion.actual
- the given array.values
- the values that are expected not to be in the given array.
NullPointerException
- if the array of values is null
.
IllegalArgumentException
- if the array of values is empty.
AssertionError
- if the given array is null
.
AssertionError
- if the given array contains any of given values.public void assertDoesNotHaveDuplicates(AssertionInfo info, long[] actual)
info
- contains information about the assertion.actual
- the given array.
NullPointerException
- if the array of values is null
.
IllegalArgumentException
- if the array of values is empty.
AssertionError
- if the given array is null
.
AssertionError
- if the given array contains duplicate values.public void assertStartsWith(AssertionInfo info, long[] actual, long[] sequence)
assertContainsSequence(AssertionInfo, long[], long[])
, but it also verifies
that the first element in the sequence is also the first element of the given array.
info
- contains information about the assertion.actual
- the given array.sequence
- the sequence of values to look for.
NullPointerException
- if the given argument is null
.
IllegalArgumentException
- if the given argument is an empty array.
AssertionError
- if the given array is null
.
AssertionError
- if the given array does not start with the given sequence of values.public void assertEndsWith(AssertionInfo info, long[] actual, long[] sequence)
assertContainsSequence(AssertionInfo, long[], long[])
, but it also verifies
that the last element in the sequence is also the last element of the given array.
info
- contains information about the assertion.actual
- the given array.sequence
- the sequence of values to look for.
NullPointerException
- if the given argument is null
.
IllegalArgumentException
- if the given argument is an empty array.
AssertionError
- if the given array is null
.
AssertionError
- if the given array does not end with the given sequence of values.public void assertIsSorted(AssertionInfo info, long[] actual)
ArraySortedAssert.isSorted()
.
info
- contains information about the assertion.actual
- the given array.public void assertIsSortedAccordingToComparator(AssertionInfo info, long[] actual, Comparator<? extends Long> comparator)
ArraySortedAssert.isSortedAccordingTo(Comparator)
.
info
- contains information about the assertion.actual
- the given array.comparator
- the Comparator
used to compare array elements
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |