本文整理了Java中org.junit.Assert.failEquals()
方法的一些代码示例,展示了Assert.failEquals()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Assert.failEquals()
方法的具体详情如下:
包路径:org.junit.Assert
类名称:Assert
方法名:failEquals
暂无
代码示例来源:origin: junit-team/junit4
/**
* Asserts that two longs are <b>not</b> equals. If they are, an
* {@link AssertionError} is thrown with the given message.
*
* @param message the identifying message for the {@link AssertionError} (<code>null</code>
* okay)
* @param unexpected unexpected value to check
* @param actual the value to check against <code>unexpected</code>
*/
public static void assertNotEquals(String message, long unexpected, long actual) {
if (unexpected == actual) {
failEquals(message, Long.valueOf(actual));
}
}
代码示例来源:origin: junit-team/junit4
/**
* Asserts that two floats are <b>not</b> equal to within a positive delta.
* If they are, an {@link AssertionError} is thrown with the given
* message. If the unexpected value is infinity then the delta value is
* ignored. NaNs are considered equal:
* <code>assertNotEquals(Float.NaN, Float.NaN, *)</code> fails
*
* @param message the identifying message for the {@link AssertionError} (<code>null</code>
* okay)
* @param unexpected unexpected value
* @param actual the value to check against <code>unexpected</code>
* @param delta the maximum delta between <code>unexpected</code> and
* <code>actual</code> for which both numbers are still
* considered equal.
*/
public static void assertNotEquals(String message, float unexpected,
float actual, float delta) {
if (!floatIsDifferent(unexpected, actual, delta)) {
failEquals(message, actual);
}
}
代码示例来源:origin: junit-team/junit4
/**
* Asserts that two objects are <b>not</b> equals. If they are, an
* {@link AssertionError} is thrown with the given message. If
* <code>unexpected</code> and <code>actual</code> are <code>null</code>,
* they are considered equal.
*
* @param message the identifying message for the {@link AssertionError} (<code>null</code>
* okay)
* @param unexpected unexpected value to check
* @param actual the value to check against <code>unexpected</code>
*/
public static void assertNotEquals(String message, Object unexpected,
Object actual) {
if (equalsRegardingNull(unexpected, actual)) {
failEquals(message, actual);
}
}
代码示例来源:origin: google/j2objc
/**
* Asserts that two doubles or floats are <b>not</b> equal to within a positive delta.
* If they are, an {@link AssertionError} is thrown with the given
* message. If the expected value is infinity then the delta value is
* ignored. NaNs are considered equal:
* <code>assertNotEquals(Double.NaN, Double.NaN, *)</code> fails
*
* @param message the identifying message for the {@link AssertionError} (<code>null</code>
* okay)
* @param first first value to check
* @param second the value to check against <code>first</code>
* @param delta the maximum delta between <code>expected</code> and
* <code>actual</code> for which both numbers are still
* considered equal.
*/
static public void assertNotEquals(String message, double first,
double second, double delta) {
if (!doubleIsDifferent(first, second, delta)) {
failEquals(message, new Double(first));
}
}
代码示例来源:origin: google/j2objc
/**
* Asserts that two objects are <b>not</b> equals. If they are, an
* {@link AssertionError} is thrown with the given message. If
* <code>first</code> and <code>second</code> are <code>null</code>,
* they are considered equal.
*
* @param message the identifying message for the {@link AssertionError} (<code>null</code>
* okay)
* @param first first value to check
* @param second the value to check against <code>first</code>
*/
static public void assertNotEquals(String message, Object first,
Object second) {
if (equalsRegardingNull(first, second)) {
failEquals(message, first);
}
}
代码示例来源:origin: junit-team/junit4
/**
* Asserts that two doubles are <b>not</b> equal to within a positive delta.
* If they are, an {@link AssertionError} is thrown with the given
* message. If the unexpected value is infinity then the delta value is
* ignored. NaNs are considered equal:
* <code>assertNotEquals(Double.NaN, Double.NaN, *)</code> fails
*
* @param message the identifying message for the {@link AssertionError} (<code>null</code>
* okay)
* @param unexpected unexpected value
* @param actual the value to check against <code>unexpected</code>
* @param delta the maximum delta between <code>unexpected</code> and
* <code>actual</code> for which both numbers are still
* considered equal.
*/
public static void assertNotEquals(String message, double unexpected,
double actual, double delta) {
if (!doubleIsDifferent(unexpected, actual, delta)) {
failEquals(message, Double.valueOf(actual));
}
}
代码示例来源:origin: camunda/camunda-bpm-platform
/**
* Asserts that two objects are <b>not</b> equals. If they are, an
* {@link AssertionError} is thrown with the given message. If
* <code>first</code> and <code>second</code> are <code>null</code>,
* they are considered equal.
*
* @param message the identifying message for the {@link AssertionError} (<code>null</code>
* okay)
* @param first first value to check
* @param second the value to check against <code>first</code>
*/
static public void assertNotEquals(String message, Object first,
Object second) {
if (equalsRegardingNull(first, second)) {
failEquals(message, first);
}
}
代码示例来源:origin: camunda/camunda-bpm-platform
/**
* Asserts that two doubles or floats are <b>not</b> equal to within a positive delta.
* If they are, an {@link AssertionError} is thrown with the given
* message. If the expected value is infinity then the delta value is
* ignored. NaNs are considered equal:
* <code>assertNotEquals(Double.NaN, Double.NaN, *)</code> fails
*
* @param message the identifying message for the {@link AssertionError} (<code>null</code>
* okay)
* @param first first value to check
* @param second the value to check against <code>first</code>
* @param delta the maximum delta between <code>expected</code> and
* <code>actual</code> for which both numbers are still
* considered equal.
*/
static public void assertNotEquals(String message, double first,
double second, double delta) {
if (!doubleIsDifferent(first, second, delta)) {
failEquals(message, new Double(first));
}
}
代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded
/**
* Asserts that two longs are <b>not</b> equals. If they are, an
* {@link AssertionError} is thrown with the given message.
*
* @param message the identifying message for the {@link AssertionError} (<code>null</code>
* okay)
* @param unexpected unexpected value to check
* @param actual the value to check against <code>unexpected</code>
*/
static public void assertNotEquals(String message, long unexpected, long actual) {
if (unexpected == actual) {
failEquals(message, Long.valueOf(actual));
}
}
代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.junit
/**
* Asserts that two longs are <b>not</b> equals. If they are, an
* {@link AssertionError} is thrown with the given message.
*
* @param message the identifying message for the {@link AssertionError} (<code>null</code>
* okay)
* @param unexpected unexpected value to check
* @param actual the value to check against <code>unexpected</code>
*/
static public void assertNotEquals(String message, long unexpected, long actual) {
if (unexpected == actual) {
failEquals(message, Long.valueOf(actual));
}
}
代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded
/**
* Asserts that two objects are <b>not</b> equals. If they are, an
* {@link AssertionError} is thrown with the given message. If
* <code>unexpected</code> and <code>actual</code> are <code>null</code>,
* they are considered equal.
*
* @param message the identifying message for the {@link AssertionError} (<code>null</code>
* okay)
* @param unexpected unexpected value to check
* @param actual the value to check against <code>unexpected</code>
*/
static public void assertNotEquals(String message, Object unexpected,
Object actual) {
if (equalsRegardingNull(unexpected, actual)) {
failEquals(message, actual);
}
}
代码示例来源:origin: org.junit/com.springsource.org.junit
/**
* Asserts that two objects are <b>not</b> equals. If they are, an
* {@link AssertionError} is thrown with the given message. If
* <code>first</code> and <code>second</code> are <code>null</code>,
* they are considered equal.
*
* @param message the identifying message for the {@link AssertionError} (<code>null</code>
* okay)
* @param first first value to check
* @param second the value to check against <code>first</code>
*/
static public void assertNotEquals(String message, Object first,
Object second) {
if (equalsRegardingNull(first, second)) {
failEquals(message, first);
}
}
代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.junit
/**
* Asserts that two objects are <b>not</b> equals. If they are, an
* {@link AssertionError} is thrown with the given message. If
* <code>unexpected</code> and <code>actual</code> are <code>null</code>,
* they are considered equal.
*
* @param message the identifying message for the {@link AssertionError} (<code>null</code>
* okay)
* @param unexpected unexpected value to check
* @param actual the value to check against <code>unexpected</code>
*/
static public void assertNotEquals(String message, Object unexpected,
Object actual) {
if (equalsRegardingNull(unexpected, actual)) {
failEquals(message, actual);
}
}
代码示例来源:origin: com.oracle/truffle-tck
/**
* Asserts that two objects are <b>not</b> equals. If they are, an
* {@link AssertionError} is thrown with the given message. If
* <code>first</code> and <code>second</code> are <code>null</code>,
* they are considered equal.
*
* @param message the identifying message for the {@link AssertionError} (<code>null</code>
* okay)
* @param first first value to check
* @param second the value to check against <code>first</code>
*/
static public void assertNotEquals(String message, Object first,
Object second) {
if (equalsRegardingNull(first, second)) {
failEquals(message, first);
}
}
代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.junit
/**
* Asserts that two doubles are <b>not</b> equal to within a positive delta.
* If they are, an {@link AssertionError} is thrown with the given
* message. If the unexpected value is infinity then the delta value is
* ignored. NaNs are considered equal:
* <code>assertNotEquals(Double.NaN, Double.NaN, *)</code> fails
*
* @param message the identifying message for the {@link AssertionError} (<code>null</code>
* okay)
* @param unexpected unexpected value
* @param actual the value to check against <code>unexpected</code>
* @param delta the maximum delta between <code>unexpected</code> and
* <code>actual</code> for which both numbers are still
* considered equal.
*/
static public void assertNotEquals(String message, double unexpected,
double actual, double delta) {
if (!doubleIsDifferent(unexpected, actual, delta)) {
failEquals(message, Double.valueOf(actual));
}
}
代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded
/**
* Asserts that two doubles are <b>not</b> equal to within a positive delta.
* If they are, an {@link AssertionError} is thrown with the given
* message. If the unexpected value is infinity then the delta value is
* ignored. NaNs are considered equal:
* <code>assertNotEquals(Double.NaN, Double.NaN, *)</code> fails
*
* @param message the identifying message for the {@link AssertionError} (<code>null</code>
* okay)
* @param unexpected unexpected value
* @param actual the value to check against <code>unexpected</code>
* @param delta the maximum delta between <code>unexpected</code> and
* <code>actual</code> for which both numbers are still
* considered equal.
*/
static public void assertNotEquals(String message, double unexpected,
double actual, double delta) {
if (!doubleIsDifferent(unexpected, actual, delta)) {
failEquals(message, Double.valueOf(actual));
}
}
代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded
/**
* Asserts that two floats are <b>not</b> equal to within a positive delta.
* If they are, an {@link AssertionError} is thrown with the given
* message. If the unexpected value is infinity then the delta value is
* ignored. NaNs are considered equal:
* <code>assertNotEquals(Float.NaN, Float.NaN, *)</code> fails
*
* @param message the identifying message for the {@link AssertionError} (<code>null</code>
* okay)
* @param unexpected unexpected value
* @param actual the value to check against <code>unexpected</code>
* @param delta the maximum delta between <code>unexpected</code> and
* <code>actual</code> for which both numbers are still
* considered equal.
*/
static public void assertNotEquals(String message, float unexpected,
float actual, float delta) {
if (!floatIsDifferent(unexpected, actual, delta)) {
failEquals(message, Float.valueOf(actual));
}
}
代码示例来源:origin: com.oracle/truffle-tck
/**
* Asserts that two doubles or floats are <b>not</b> equal to within a positive delta.
* If they are, an {@link AssertionError} is thrown with the given
* message. If the expected value is infinity then the delta value is
* ignored. NaNs are considered equal:
* <code>assertNotEquals(Double.NaN, Double.NaN, *)</code> fails
*
* @param message the identifying message for the {@link AssertionError} (<code>null</code>
* okay)
* @param first first value to check
* @param second the value to check against <code>first</code>
* @param delta the maximum delta between <code>expected</code> and
* <code>actual</code> for which both numbers are still
* considered equal.
*/
static public void assertNotEquals(String message, double first,
double second, double delta) {
if (!doubleIsDifferent(first, second, delta)) {
failEquals(message, new Double(first));
}
}
代码示例来源:origin: org.junit/com.springsource.org.junit
/**
* Asserts that two doubles or floats are <b>not</b> equal to within a positive delta.
* If they are, an {@link AssertionError} is thrown with the given
* message. If the expected value is infinity then the delta value is
* ignored. NaNs are considered equal:
* <code>assertNotEquals(Double.NaN, Double.NaN, *)</code> fails
*
* @param message the identifying message for the {@link AssertionError} (<code>null</code>
* okay)
* @param first first value to check
* @param second the value to check against <code>first</code>
* @param delta the maximum delta between <code>expected</code> and
* <code>actual</code> for which both numbers are still
* considered equal.
*/
static public void assertNotEquals(String message, double first,
double second, double delta) {
if (!doubleIsDifferent(first, second, delta)) {
failEquals(message, new Double(first));
}
}
代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.junit
/**
* Asserts that two floats are <b>not</b> equal to within a positive delta.
* If they are, an {@link AssertionError} is thrown with the given
* message. If the unexpected value is infinity then the delta value is
* ignored. NaNs are considered equal:
* <code>assertNotEquals(Float.NaN, Float.NaN, *)</code> fails
*
* @param message the identifying message for the {@link AssertionError} (<code>null</code>
* okay)
* @param unexpected unexpected value
* @param actual the value to check against <code>unexpected</code>
* @param delta the maximum delta between <code>unexpected</code> and
* <code>actual</code> for which both numbers are still
* considered equal.
*/
static public void assertNotEquals(String message, float unexpected,
float actual, float delta) {
if (!floatIsDifferent(unexpected, actual, delta)) {
failEquals(message, Float.valueOf(actual));
}
}
内容来源于网络,如有侵权,请联系作者删除!