E - the element type of a Collection
or the element to be compared by a Comparator.public abstract class Assert<E> extends Assert
junit.framework.Assert.
assertNormAbsEquals(Object,Object,String,double)
generalizes the method
assertEquals(double expected, double actual, double delta)
to objects with a metric defined by a method (name).
There is also a variant for relative precision,
assertNormRelEquals(Object,Object,String,double).
assertRelEquals(double,double,double)
provides relative tolerances suited to numerical applications.
For small number applications (e.g. failure probabilities)
a combination of relative tolerance and absolute one
may be prescribed by
assertAbsRelEquals(double,double,double,double,double).
Comparators and the compareTo
method (think e.g. of the package java.math).
To fill this gap assertIs(Assert.CmpObj,Comparable,Object)
is useful.
This method can also check for "greater than" or that like.
A variant of this using Comparators
is assertIs(Assert.CmpObj,Object,Object,Comparator).
assertArraysEquals(Object,Object)
tests equality of arrays recursively.
assertArraysEquals(Object,Object,double)
is a combination ot the two.
assertRelEquals(double expected, double actual, double reldev)
is for testing relative deviations.
assertStringEquals(String expected, String actual)
is designed for testing long strings.
It provides error messages suitable to find deviations quickly.
| Modifier and Type | Class and Description |
|---|---|
static class |
Assert.CmpObj
Represents an ordering relation.
|
| Modifier and Type | Field and Description |
|---|---|
private static String |
STR_ASTOP |
private static String |
STR_BUTWAS |
private static String |
STR_DN_PROV |
private static String |
STR_IN_ABS_VAL |
private static String |
STR_OBJECT |
private static String |
STR_RAISED |
| Constructor and Description |
|---|
Assert() |
| Modifier and Type | Method and Description |
|---|---|
static void |
assertAbsEquals(double expected,
double actual,
double absdev)
Fails if the absolute deviation
between
expected and actual
exceeds absdiv in absolute value. |
static void |
assertAbsEquals(String message,
double expected,
double actual,
double absdev)
Fails if the absolute deviation
between
expected and actual
exceeds absdiv in absolute value. |
static void |
assertAbsRelEquals(double expected,
double separateAbsRel,
double actual,
double absdev,
double reldev)
For
expected<= separateAbsRel behaves like
Assert.assertEquals(String,double,double,double)
ignoring reldev, whereas otherwise behaves like
Assert.assertEquals(String, double, double, double)
ignoring absdev. |
static void |
assertAbsRelEquals(String message,
double expected,
double separateAbsRel,
double actual,
double absdev,
double reldev)
For
expected<= separateAbsRel behaves like
Assert.assertEquals(String,double,double,double)
ignoring reldev, whereas otherwise behaves like
Assert.assertEquals(String, double, double, double)
ignoring absdev. |
static void |
assertArraysEquals(Object expected,
Object actual) |
static void |
assertArraysEquals(Object expected,
Object actual,
double delta)
Is a deep version of method
junit.framework.Assert.assertEquals(Object, Object)
for arrays: checks
whether the two arguments are arrays and whether they are arrays,
recursively whether the lengths coincide
and if the entries do so. |
static void |
assertArraysEquals(String message,
Object expected,
Object actual)
Is a deep version of method
junit.framework.Assert.assertEquals(Object, Object)
for arrays: checks
whether the two arguments are arrays and whether they are arrays,
recursively whether the lengths coincide
and if the entries do so. |
static void |
assertEquals(Object expected,
Object actual)
Fails for
! |
static void |
assertEquals(String message,
Object expected,
Object actual) |
static <E> void |
assertIs(Assert.CmpObj cmpObj,
Comparable<E> expected,
E actual)
Fails if
expected.compareTo(actual)
is not as expected
and raises an exception if this expression cannot be evaluated. |
static <E> void |
assertIs(Assert.CmpObj cmpObj,
E expected,
E actual,
Comparator<E> cmp)
Fails if
cmp.compare(expected, actual)
is not as expected
and raises an exception if this expression cannot be evaluated. |
static <E> void |
assertIs(Assert.CmpObj cmpObj,
String message,
Comparable<E> expected,
E actual)
Fails if
expected.compareTo(actual)
is not as expected
and raises an exception if this expression cannot be evaluated. |
static <E> void |
assertIs(Assert.CmpObj cmpObj,
String message,
E expected,
E actual,
Comparator<E> cmp)
Fails if
cmp.compare(expected, actual)
is not as expected
and raises an exception if this expression cannot be evaluated. |
static <E> void |
assertIsContainedAll(Collection<E> expected,
Collection<E> actual)
Fails if
actual is not a subcollection
of expected. |
static <E> void |
assertIsIn(Collection<E> expectedContainer,
Object actualElement)
Fails if
actualElement is not an element
of expectedContainer. |
static void |
assertNormAbsEquals(Object expected,
Object actual,
String norm,
double delta) |
static void |
assertNormAbsEquals(String message,
Object expected,
Object actual,
String norm,
double delta)
Fails if
actual is null
or actual deviates from expected
by at least delta,
provided the test can be executed at all. |
static void |
assertNormRelEquals(Object expected,
Object actual,
String norm,
double reldev)
Fails if
actual is null
or actual deviates from expected
by at least delta,
provided the test can be executed at all. |
static void |
assertNormRelEquals(String message,
Object expected,
Object actual,
String norm,
double reldev) |
private static void |
assertRecArraysEquals(Object expected,
Object actual,
int[] indices)
Is a deep version of method
junit.framework.Assert.assertEquals(Object, Object)
for arrays:
checks recursively whether the lengths coincide
and if the entries do so. |
private static void |
assertRecArraysEquals(Object expected,
Object actual,
int[] indices,
double delta)
Is a deep version of method
junit.framework.Assert.assertEquals(Object, Object)
for arrays:
checks recursively whether the lengths coincide
and if the entries do so. |
static void |
assertRelEquals(double expected,
double actual,
double reldev)
Fails reporting a standard message if the relative deviation
between
expected and actual
exceeds reldiv in absolute value. |
static void |
assertRelEquals(String message,
double expected,
double actual,
double reldev)
Fails if the relative deviation
between
expected and actual
exceeds reldiv in absolute value. |
static void |
assertStringEquals(String expected,
String actual)
Special case of
assertEquals(Object, Object)
which provides an error message specifying the common prefix
of expected with actual. |
private static void |
checkArraysSameClass(Object expected,
Object actual)
Checks whether
expected is an array
and whether its type coincides with the type of actual. |
private static boolean |
checkNulls(String message,
Object expected,
Object actual)
Throws an error if exactly one of the parameters are
null
and otherwise returns whether both are null. |
private static void |
checkNullsB(String norm,
Object expected,
Object actual)
Fails if the test can be executed, i.e.
|
private static double |
computeNorm1(String norm,
Object expected)
Returns the norm of
expected
defined by the method named norm. |
private static double |
computeNorm2(String norm,
Object expected,
Object actual)
Returns the distance
of the two objects
expected and actual
defined by the metric defined by the method named norm;
typically something like the norm of a kind of difference. |
private static String |
expectedActual(Object expected,
Object actual) |
private static String |
failInd(int[] indices) |
private static String |
failLengthMessage(Object expectedEntry,
Object actualEntry,
int[] indices) |
private static String |
failMessage(Object expectedEntry,
Object actualEntry,
int[] indices) |
private static String |
failMessageDelta(double expectedEntry,
double actualEntry,
int[] indices,
double delta)
Returns a failure message indicating that
in comparing nested arrays of final float type
as
double[][],
the corresponding entries given by index path indices
deviate at least delta. |
private static String |
failMessageLength(int expectedLen,
int actualLen,
int[] indices) |
private static <E> int |
invokeCompare(E obj1,
E obj2,
Comparator<E> cmp)
Returns
cmp.compare(expected, actual) if possible. |
static double |
test() |
static boolean |
testAbsEquals(double expected,
double actual,
double absdev)
Returns whether the absolute deviation
between
expected and actual
exceeds absdiv in absolute value. |
static boolean |
testRelEquals(double expected,
double actual,
double reldev)
Returns whether the relative deviation
between
expected and actual
exceeds reldiv in absolute value. |
private static void |
thrwAccessible(Method method) |
private static void |
thrwWrongArgs(Method method) |
assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertThat, assertThat, assertTrue, assertTrue, fail, failprivate static final String STR_OBJECT
private static final String STR_DN_PROV
private static final String STR_RAISED
private static final String STR_BUTWAS
private static final String STR_ASTOP
private static final String STR_IN_ABS_VAL
private static void thrwAccessible(Method method)
private static void thrwWrongArgs(Method method)
private static double computeNorm2(String norm, Object expected, Object actual)
expected and actual
defined by the metric defined by the method named norm;
typically something like the norm of a kind of difference.
CAUTION: This method shall be designed to compute values close to zero,
i.e. is applied to actual cloase to expected.
This must be reflected in the definition
of the method given by norm.
norm - the non-null name of a metric method,
i.e. of a member method of the form
public double norm(other)
with the properties of a metric:
x.norm(x) yields 0
x.norm(y) and y.norm(x)
yield the same result,
x.norm(y)+y.norm(z)\(\ge\) x.norm(z).
actual close to expected
i.e. with a lot of extinction.
For certain arithmetic types, this requires care
to obtain reasonable performance.IllegalArgumentException - if the test cannot be performed, i.e.
norm does not represent a metric method,
i.e. a member method of the form
public double norm(other).
Of course, the properties of a metric cannot be proved.
expected.norm(actual) raises an exception
assertNormAbsEquals(String, Object, Object, String, double),
assertNormRelEquals(String, Object, Object, String, double),
computeNorm1(String, Object)public static void assertNormAbsEquals(String message, Object expected, Object actual, String norm, double delta)
actual is null
or actual deviates from expected
by at least delta,
provided the test can be executed at all.
The deviation is computed with respect to the metric
given by expected.norm(actual)
which is assumed to have signature double norm(Cls actual)
with Cls the class of expected.message - the error message displayed if the test fails regularly,
i.e. if computeNorm2(norm, expected, actual)
can be evaluated without throwing an exception.expected - The expected object (see the actual object).actual - The actual object
which is expected to deviate from expected
by at most delta in normnorm - the name of a metric method,
i.e. of a member method of the form
public double norm(other)
with the properties of a metric:
x.norm(x) yields 0
x.norm(y) and y.norm(x)
yield the same result,
x.norm(y)+y.norm(z)\(\ge\) x.norm(z).
delta - the allowed deviation as a double value.IllegalArgumentException - if the test cannot be performed, i.e.
norm is null
or does not represent a metric method,
i.e. a member method of the form
public double norm(other).
Of course, the properties of a metric cannot be proved.
expected.norm(actual) raises an exception
IllegalArgumentException - if expected==null.junit.framework.AssertionFailedError - if the test can be performed,
i.e. no IllegalArgumentException is thrown but
actual==null or
delta.
public static void assertNormAbsEquals(Object expected, Object actual, String norm, double delta)
private static double computeNorm1(String norm, Object expected)
expected
defined by the method named norm.norm - the non-null name of a norm method,
i.e. of a member method of the form
public double norm()
with the properties of a norm:
x.norm() yields 0
iff x represents the zero vector.
(sx).norm()=s(x.norm())
where sx and s(...)
represent scalar multiplication.
x.norm()+y.norm()\(\ge (x+y)\).norm(z),
where \(x+y\) represents the sum of vectors.
expected - The object from which the norm is to be computed.expected
defined by the method named norm.IllegalArgumentException - if the test cannot be performed, i.e.
norm does not represent a norm method,
i.e. a member method of the form
public double norm(other).
Of course, the properties of a norm cannot be proved.
expected.norm() raises an exception
public static void assertNormRelEquals(Object expected, Object actual, String norm, double reldev)
actual is null
or actual deviates from expected
by at least delta,
provided the test can be executed at all.public static void assertNormRelEquals(String message, Object expected, Object actual, String norm, double reldev)
private static void checkNullsB(String norm, Object expected, Object actual)
norm nor expected
is null, and actual is null.norm - name of a member method in class Cls
with signature double norm(Cls actual).expected - an Object with type Cls;
in particular not null.actual - another Object; in particular not null.IllegalArgumentException - if norm==null or expected==null.junit.framework.AssertionFailedError - if norm,expected!=null but actual==null.assertNormAbsEquals(String, Object, Object, String, double),
assertNormRelEquals(String, Object, Object, String, double),
checkNulls(String, Object, Object)public static void assertEquals(Object expected, Object actual)
!expected.equals(actual)
and raises an exception if this expression cannot be evaluated.expected - an instance of an Object.actual - an Object or null.IllegalArgumentException - expected == null,
expected.equals(actual)
raises an exception.
junit.framework.AssertionFailedError - for !expected.equals(actual).public static <E> void assertIsIn(Collection<E> expectedContainer, Object actualElement)
actualElement is not an element
of expectedContainer.expectedContainer - a Collection the object actualElement
is expected to be contained in.actualElement - an instance of an Object.junit.framework.AssertionFailedError - if actualElement
is not in expectedContainer
and in particular if it is null.public static <E> void assertIsContainedAll(Collection<E> expected, Collection<E> actual)
actual is not a subcollection
of expected.expected - a Collectionactual - another Collectionjunit.framework.AssertionFailedError - if actual is not a subcollection
of expectedContainer.
This includes the cases where a parameter is null.public static <E> void assertIs(Assert.CmpObj cmpObj, String message, Comparable<E> expected, E actual)
expected.compareTo(actual)
is not as expected
and raises an exception if this expression cannot be evaluated.message - the error message displayed if the test fails regularly,
i.e. if expected.compareTo(actual) can be evaluated
without throwing an exception.cmpObj - The action that decides whether the relation is satisfied.expected - an instance of a Comparable.actual - an Object or null.
Actually this should be a Comparable as well.IllegalArgumentException - if invoking expected.compareTo(actual)
raises an exception.
In particular for expected == nullIllegalStateException - if expected.compare(actual) is evaluated
for actual == null without throwing an exception
as specified for Comparable.compareTo(T).junit.framework.AssertionFailedError - if the value of expected.compareTo(actual)
is not as specified by cmpObj.assertIs(CmpObj, Comparable, Object)public static <E> void assertIs(Assert.CmpObj cmpObj, String message, E expected, E actual, Comparator<E> cmp)
cmp.compare(expected, actual)
is not as expected
and raises an exception if this expression cannot be evaluated.message - the error message displayed if the test fails regularly,
i.e. if cmp.compare(expected, actual) can be evaluated
without throwing an exception.cmpObj - The action that decides whether the relation is satisfied.expected - an Object.actual - another Object.IllegalArgumentException - if invoking cmp.compare(expected, actual)
raises an exception.junit.framework.AssertionFailedError - if the value of cmp.compare(expected, actual)
is not as specified by cmpObj.assertIs(CmpObj, Object, Object, Comparator)public static <E> void assertIs(Assert.CmpObj cmpObj, Comparable<E> expected, E actual)
expected.compareTo(actual)
is not as expected
and raises an exception if this expression cannot be evaluated.cmpObj - The action that decides whether the relation is satisfied.expected - an instance of a Comparable.actual - an Object or null.
Actually this should be a Comparable as well.IllegalArgumentException - if invoking expected.compareTo(actual)
raises an exception.
In particular for expected == nullIllegalStateException - if expected.compare(actual) is evaluated
for actual == null without throwing an exception
as specified for Comparable.compareTo(T).junit.framework.AssertionFailedError - if the value of expected.compareTo(actual)
is not as specified by cmpObj.assertIs(CmpObj, String, Comparable, Object)public static <E> void assertIs(Assert.CmpObj cmpObj, E expected, E actual, Comparator<E> cmp)
cmp.compare(expected, actual)
is not as expected
and raises an exception if this expression cannot be evaluated.cmpObj - The action that decides whether the relation is satisfied.expected - an Object.actual - another Object.IllegalArgumentException - if invoking cmp.compare(expected, actual)
raises an exception.junit.framework.AssertionFailedError - if the value of cmp.compare(expected, actual)
is not as specified by cmpObj.assertIs(CmpObj, String, Object, Object, Comparator)private static <E> int invokeCompare(E obj1,
E obj2,
Comparator<E> cmp)
cmp.compare(expected, actual) if possible.obj1 - an Object.obj2 - another Object.cmp - a comparator which is capable of comparing
obj1 with obj2.int value which results in invoking
cmp.compare(expected, actual).IllegalArgumentException - cmp == null,
cmp.compare(expected, actual)
raises an exception.
private static boolean checkNulls(String message, Object expected, Object actual)
null
and otherwise returns whether both are null.message - the error message used in case the assertion fails.expected - an Object.actual - another Object.null,
if either both, expected and actual
are null.junit.framework.AssertionFailedError - if exactly one of the parameters are null.public static void assertArraysEquals(String message, Object expected, Object actual)
junit.framework.Assert.assertEquals(Object, Object)
for arrays: checks
message - the error message used in case the assertion fails.expected - an array.actual - an array.IllegalArgumentException - if expected is not an array.junit.framework.AssertionFailedError - if the types of the two arguments do not coincide
(e.g. because the second one is not an array).
See also assertRecArraysEquals(java.lang.Object, java.lang.Object, int[]).junit.framework.AssertionFailedError - if the the two arrays do not coincide in their lenght
or in some entry.private static void checkArraysSameClass(Object expected, Object actual)
expected is an array
and whether its type coincides with the type of actual.
If not an exception is thrown.
Invokes Assert.fail(java.lang.String) if the types of expected
and of actual do not coincide.expected - the expected array.actual - the actual array.IllegalArgumentException - if expected is not an array.private static void assertRecArraysEquals(Object expected, Object actual, int[] indices)
junit.framework.Assert.assertEquals(Object, Object)
for arrays:
checks recursively whether the lengths coincide
and if the entries do so.
Contract: the classes of the two arguments coincide
and both are arrays.expected - the expected array.actual - the actual array.indices - contains the list of indices of the arrays
expected and actual
within the arrays comprising them.
The recursion starts with indices = new int[] {}.junit.framework.AssertionFailedError - if the the two arrays do not coincide in their lenght
or in some entry.private static String failInd(int[] indices)
private static String failLengthMessage(Object expectedEntry, Object actualEntry, int[] indices)
private static String failMessage(Object expectedEntry, Object actualEntry, int[] indices)
private static String failMessageDelta(double expectedEntry, double actualEntry, int[] indices, double delta)
double[][],
the corresponding entries given by index path indices
deviate at least delta.private static String failMessageLength(int expectedLen, int actualLen, int[] indices)
public static void assertArraysEquals(Object expected, Object actual, double delta)
junit.framework.Assert.assertEquals(Object, Object)
for arrays: checks
expected - the expected array.actual - the actual array
which is assumed to be of same type as expected.delta - the allowed deviation as a double value.IllegalArgumentException - if expected is not an array.junit.framework.AssertionFailedError - if the types of the two arguments do not coincide
(e.g. because the second one is not an array).
See also assertRecArraysEquals(java.lang.Object, java.lang.Object, int[]).junit.framework.AssertionFailedError - if the the two arrays do not coincide in their lenght
or in some entry.private static void assertRecArraysEquals(Object expected, Object actual, int[] indices, double delta)
junit.framework.Assert.assertEquals(Object, Object)
for arrays:
checks recursively whether the lengths coincide
and if the entries do so.
Contract: the classes of the two arguments coincide
and both are arrays.expected - the expected array.actual - the actual array
which is assumed to be of same type as expected.indices - contains the list of indices of the arrays
expected and actual
within the arrays comprising them.
The recursion starts with indices = new int[] {}.
This is for generating an appropriate message
for an AssertionFailedError.delta - the allowed deviation as a double value.IllegalArgumentException - if expected or actual is not an array.junit.framework.AssertionFailedError - if the the two arrays do not coincide in their length
or in some entry.NotYetImplementedException - if expected is not 'finally' of primitive type.public static boolean testRelEquals(double expected,
double actual,
double reldev)
expected and actual
exceeds reldiv in absolute value.expected - the double value expected.
This may be neither 0.0, nor an infinite value
nor NaN.actual - the actual double value.reldev - the maximum relative deviation
between expected and actual.
This must be a non-negative value;
in particular, NaN is not allowed.expected and actual
exceeds reldiv in absolute value.IllegalArgumentException - expected is either 0.0,
infinite or NaN.
reldev is negative or NaN.
assertRelEquals(String, double, double, double)public static void assertRelEquals(String message, double expected, double actual, double reldev)
expected and actual
exceeds reldiv in absolute value.message - the error message used in case the assertion fails.expected - the double value expected.
This may be neither 0.0, nor an infinite value
nor NaN.actual - the actual double value.reldev - the maximum relative deviation
between expected and actual.
This must be a non-negative value;
in particular, NaN is not allowed.IllegalArgumentException - expected is either 0.0,
infinite or NaN.
reldev is negative or NaN.
assertRelEquals(double, double, double),
testRelEquals(double, double, double)public static void assertRelEquals(double expected,
double actual,
double reldev)
expected and actual
exceeds reldiv in absolute value.expected - the double value expected.
This may be neither 0.0, nor an infinite value
nor NaN.actual - the actual double value.reldev - the maximum relative deviation
between expected and actual.
This must be a non-negative value;
in particular, NaN is not allowed.IllegalArgumentException - expected is either 0.0,
infinite or NaN.
reldev is negative or NaN.
assertRelEquals(String, double, double, double)public static void assertAbsRelEquals(String message, double expected, double separateAbsRel, double actual, double absdev, double reldev)
expected<= separateAbsRel behaves like
Assert.assertEquals(String,double,double,double)
ignoring reldev, whereas otherwise behaves like
Assert.assertEquals(String, double, double, double)
ignoring absdev.message - the error message used in case the assertion fails.expected - the double value expected.separateAbsRel - a non-negative double value
separating the two parts of the domain of this method.actual - the actual double value.absdev - the maximum absolute deviation
between expected and actual.
This is relevant for expected<= separateAbsRel
but ignored otherwise.reldev - the maximum relative deviation
between expected and actual.
This is relevant for expected > separateAbsRel
but ignored otherwise.IllegalArgumentException - for separateAbsRel < 0.public static void assertAbsRelEquals(double expected,
double separateAbsRel,
double actual,
double absdev,
double reldev)
expected<= separateAbsRel behaves like
Assert.assertEquals(String,double,double,double)
ignoring reldev, whereas otherwise behaves like
Assert.assertEquals(String, double, double, double)
ignoring absdev.expected - the double value expected.separateAbsRel - a non-negative double value
separating the two parts of the domain of this method.actual - the actual double value.absdev - the maximum absolute deviation
between expected and actual.
This is relevant for expected<= separateAbsRel
but ignored otherwise.reldev - the maximum relative deviation
between expected and actual.
This is relevant for expected > separateAbsRel
but ignored otherwise.IllegalArgumentException - for separateAbsRel < 0.public static boolean testAbsEquals(double expected,
double actual,
double absdev)
expected and actual
exceeds absdiv in absolute value.expected - the double value expected.
This may not be NaN.actual - the actual double value.absdev - the maximum absolute deviation
between expected and actual.
This must be a non-negative value;
in particular, NaN is not allowed.expected and actual
exceeds absdiv in absolute value.IllegalArgumentException - expected is NaN.
absdev is negative or NaN.
assertAbsEquals(String, double, double, double)public static void assertAbsEquals(String message, double expected, double actual, double absdev)
expected and actual
exceeds absdiv in absolute value.message - the error message used in case the assertion fails.expected - the double value expected.
This may not be neither NaN.actual - the actual double value.absdev - the maximum absolute deviation
between expected and actual.
This must be a non-negative value;
in particular, NaN is not allowed.IllegalArgumentException - expected is NaN.
absdev is negative or NaN.
assertAbsEquals(double, double, double),
testAbsEquals(double, double, double)public static void assertAbsEquals(double expected,
double actual,
double absdev)
expected and actual
exceeds absdiv in absolute value.expected - the double value expected.
This may not be neither NaN.actual - the actual double value.absdev - the maximum absolute deviation
between expected and actual.
This must be a non-negative value;
in particular, NaN is not allowed.IllegalArgumentException - expected is NaN.
absdev is negative or NaN.
assertAbsEquals(String, double, double, double)public static void assertStringEquals(String expected, String actual)
assertEquals(Object, Object)
which provides an error message specifying the common prefix
of expected with actual.
This is suitable for keeping long strings under control.
If one of the arguments is null,
this method behaves like
Assert.assertEquals(Object, Object).expected - the String expected.
This maactual - a String valuepublic static double test()
Copyright © 2012–2018 Simuline Organization (l2r). All rights reserved.