Package org.fest.assertions.internal
Class LongArrays
- java.lang.Object
- 
- org.fest.assertions.internal.LongArrays
 
- 
 public class LongArrays extends java.lang.ObjectReusable assertions for arrays oflongs.- Author:
- Alex Ruiz, Joel Costigliola, Mikhail Mazursky, Nicolas François
 
- 
- 
Constructor SummaryConstructors Constructor Description LongArrays(ComparisonStrategy comparisonStrategy)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidassertContains(AssertionInfo info, long[] actual, long[] values)Asserts that the given array contains the given values, in any order.voidassertContains(AssertionInfo info, long[] actual, long value, Index index)Verifies that the given array contains the given value at the given index.voidassertContainsOnly(AssertionInfo info, long[] actual, long[] values)Asserts that the given array contains only the given values and nothing else, in any order.voidassertContainsSequence(AssertionInfo info, long[] actual, long[] sequence)Verifies that the given array contains the given sequence of values, without any other values between them.voidassertDoesNotContain(AssertionInfo info, long[] actual, long[] values)Asserts that the given array does not contain the given values.voidassertDoesNotContain(AssertionInfo info, long[] actual, long value, Index index)Verifies that the given array does not contain the given value at the given index.voidassertDoesNotHaveDuplicates(AssertionInfo info, long[] actual)Asserts that the given array does not have duplicate values.voidassertEmpty(AssertionInfo info, long[] actual)Asserts that the given array is empty.voidassertEndsWith(AssertionInfo info, long[] actual, long[] sequence)Verifies that the given array ends with the given sequence of values, without any other values between them.voidassertHasSameSizeAs(AssertionInfo info, long[] actual, java.lang.Iterable<?> other)Assert that the actual array has the same size as the otherIterable.voidassertHasSameSizeAs(AssertionInfo info, long[] actual, java.lang.Object[] other)Assert that the actual array has the same size as the other array.voidassertHasSize(AssertionInfo info, long[] actual, int expectedSize)Asserts that the number of elements in the given array is equal to the expected one.voidassertIsSorted(AssertionInfo info, long[] actual)Concrete implementation ofArraySortedAssert.isSorted().voidassertIsSortedAccordingToComparator(AssertionInfo info, long[] actual, java.util.Comparator<? super java.lang.Long> comparator)Concrete implementation ofArraySortedAssert.isSortedAccordingTo(Comparator).voidassertNotEmpty(AssertionInfo info, long[] actual)Asserts that the given array is not empty.voidassertNullOrEmpty(AssertionInfo info, long[] actual)Asserts that the given array isnullor empty.voidassertStartsWith(AssertionInfo info, long[] actual, long[] sequence)Verifies that the given array starts with the given sequence of values, without any other values between them.java.util.Comparator<?>getComparator()static LongArraysinstance()Returns the singleton instance of this class.
 
- 
- 
- 
Constructor Detail- 
LongArrayspublic LongArrays(ComparisonStrategy comparisonStrategy) 
 
- 
 - 
Method Detail- 
instancepublic static LongArrays instance() Returns the singleton instance of this class.- Returns:
- the singleton instance of this class.
 
 - 
getComparatorpublic java.util.Comparator<?> getComparator() 
 - 
assertNullOrEmptypublic void assertNullOrEmpty(AssertionInfo info, long[] actual) Asserts that the given array isnullor empty.- Parameters:
- info- contains information about the assertion.
- actual- the given array.
- Throws:
- java.lang.AssertionError- if the given array is not- null*and* contains one or more elements.
 
 - 
assertEmptypublic void assertEmpty(AssertionInfo info, long[] actual) Asserts that the given array is empty.- Parameters:
- info- contains information about the assertion.
- actual- the given array.
- Throws:
- java.lang.AssertionError- if the given array is- null.
- java.lang.AssertionError- if the given array is not empty.
 
 - 
assertNotEmptypublic void assertNotEmpty(AssertionInfo info, long[] actual) Asserts that the given array is not empty.- Parameters:
- info- contains information about the assertion.
- actual- the given array.
- Throws:
- java.lang.AssertionError- if the given array is- null.
- java.lang.AssertionError- if the given array is empty.
 
 - 
assertHasSizepublic void assertHasSize(AssertionInfo info, long[] actual, int expectedSize) Asserts that the number of elements in the given array is equal to the expected one.- Parameters:
- info- contains information about the assertion.
- actual- the given array.
- expectedSize- the expected size of- actual.
- Throws:
- java.lang.AssertionError- if the given array is- null.
- java.lang.AssertionError- if the number of elements in the given array is different than the expected one.
 
 - 
assertHasSameSizeAspublic void assertHasSameSizeAs(AssertionInfo info, long[] actual, java.lang.Iterable<?> other) Assert that the actual array has the same size as the otherIterable.- Parameters:
- info- contains information about the assertion.
- actual- the given array.
- other- the group to compare
- Throws:
- java.lang.AssertionError- if the actual group is- null.
- java.lang.AssertionError- if the other group is- null.
- java.lang.AssertionError- if the actual group does not have the same size.
 
 - 
assertHasSameSizeAspublic void assertHasSameSizeAs(AssertionInfo info, long[] actual, java.lang.Object[] other) Assert that the actual array has the same size as the other array.- Parameters:
- info- contains information about the assertion.
- actual- the given array.
- other- the group to compare
- Throws:
- java.lang.AssertionError- if the actual group is- null.
- java.lang.AssertionError- if the other group is- null.
- java.lang.AssertionError- if the actual group does not have the same size.
 
 - 
assertContainspublic void assertContains(AssertionInfo info, long[] actual, long[] values) Asserts that the given array contains the given values, in any order.- Parameters:
- info- contains information about the assertion.
- actual- the given array.
- values- the values that are expected to be in the given array.
- Throws:
- java.lang.NullPointerException- if the array of values is- null.
- java.lang.IllegalArgumentException- if the array of values is empty.
- java.lang.AssertionError- if the given array is- null.
- java.lang.AssertionError- if the given array does not contain the given values.
 
 - 
assertContainspublic void assertContains(AssertionInfo info, long[] actual, long value, Index index) Verifies that the given array contains the given value at the given index.- Parameters:
- 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.
- Throws:
- java.lang.AssertionError- if the given array is- nullor empty.
- java.lang.NullPointerException- if the given- Indexis- null.
- java.lang.IndexOutOfBoundsException- if the value of the given- Indexis equal to or greater than the size of the given array.
- java.lang.AssertionError- if the given array does not contain the given value at the given index.
 
 - 
assertDoesNotContainpublic 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.- Parameters:
- 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.
- Throws:
- java.lang.AssertionError- if the given array is- null.
- java.lang.NullPointerException- if the given- Indexis- null.
- java.lang.AssertionError- if the given array contains the given value at the given index.
 
 - 
assertContainsOnlypublic void assertContainsOnly(AssertionInfo info, long[] actual, long[] values) Asserts that the given array contains only the given values and nothing else, in any order.- Parameters:
- info- contains information about the assertion.
- actual- the given array.
- values- the values that are expected to be in the given array.
- Throws:
- java.lang.NullPointerException- if the array of values is- null.
- java.lang.IllegalArgumentException- if the array of values is empty.
- java.lang.AssertionError- if the given array is- null.
- java.lang.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.
 
 - 
assertContainsSequencepublic 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.- Parameters:
- info- contains information about the assertion.
- actual- the given array.
- sequence- the sequence of values to look for.
- Throws:
- java.lang.AssertionError- if the given array is- null.
- java.lang.NullPointerException- if the given sequence is- null.
- java.lang.IllegalArgumentException- if the given sequence is empty.
- java.lang.AssertionError- if the given array does not contain the given sequence of values.
 
 - 
assertDoesNotContainpublic void assertDoesNotContain(AssertionInfo info, long[] actual, long[] values) Asserts that the given array does not contain the given values.- Parameters:
- info- contains information about the assertion.
- actual- the given array.
- values- the values that are expected not to be in the given array.
- Throws:
- java.lang.NullPointerException- if the array of values is- null.
- java.lang.IllegalArgumentException- if the array of values is empty.
- java.lang.AssertionError- if the given array is- null.
- java.lang.AssertionError- if the given array contains any of given values.
 
 - 
assertDoesNotHaveDuplicatespublic void assertDoesNotHaveDuplicates(AssertionInfo info, long[] actual) Asserts that the given array does not have duplicate values.- Parameters:
- info- contains information about the assertion.
- actual- the given array.
- Throws:
- java.lang.NullPointerException- if the array of values is- null.
- java.lang.IllegalArgumentException- if the array of values is empty.
- java.lang.AssertionError- if the given array is- null.
- java.lang.AssertionError- if the given array contains duplicate values.
 
 - 
assertStartsWithpublic 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. Similar toassertContainsSequence(AssertionInfo, long[], long[])- Parameters:
- info- contains information about the assertion.
- actual- the given array.
- sequence- the sequence of values to look for.
- Throws:
- java.lang.NullPointerException- if the given argument is- null.
- java.lang.IllegalArgumentException- if the given argument is an empty array.
- java.lang.AssertionError- if the given array is- null.
- java.lang.AssertionError- if the given array does not start with the given sequence of values.
 
 - 
assertEndsWithpublic 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. Similar toassertContainsSequence(AssertionInfo, long[], long[])- Parameters:
- info- contains information about the assertion.
- actual- the given array.
- sequence- the sequence of values to look for.
- Throws:
- java.lang.NullPointerException- if the given argument is- null.
- java.lang.IllegalArgumentException- if the given argument is an empty array.
- java.lang.AssertionError- if the given array is- null.
- java.lang.AssertionError- if the given array does not end with the given sequence of values.
 
 - 
assertIsSortedpublic void assertIsSorted(AssertionInfo info, long[] actual) Concrete implementation ofArraySortedAssert.isSorted().- Parameters:
- info- contains information about the assertion.
- actual- the given array.
 
 - 
assertIsSortedAccordingToComparatorpublic void assertIsSortedAccordingToComparator(AssertionInfo info, long[] actual, java.util.Comparator<? super java.lang.Long> comparator) Concrete implementation ofArraySortedAssert.isSortedAccordingTo(Comparator).- Parameters:
- info- contains information about the assertion.
- actual- the given array.
- comparator- the- Comparatorused to compare array elements
 
 
- 
 
-