BrokenEvent nanotests

com.brokenevent.nanotests
Class Asserts

java.lang.Object
  extended by com.brokenevent.nanotests.Asserts

public final class Asserts
extends java.lang.Object

jUnit extensions class These methods can be used directly: DbAssert.assertDate(...), however, they read better if they are referenced through static import:

 import static com.brokenevent.nanotests.Asserts.*;
    ...
    assertEquals(...);
 

Author:
BrokenEvent

Constructor Summary
protected Asserts()
           
 
Method Summary
static void assertEquals(java.util.Date expected, java.util.Date actual)
          Asserts that dates are equal with second precision.
static void assertEquals(java.lang.String message, java.util.Date expected, java.util.Date actual)
          Asserts that dates are equal with second precision.
static
<T> void
assertInSet(java.lang.String message, T[] superset, T[] subset)
          Asserts that all values of the subset is exist in superset.
static
<T> void
assertInSet(T[] superset, T[] subset)
          Asserts that all values of the subset is exist in superset.
static void assertNotEquals(byte expected, byte actual)
          Asserts that values are not equal.
static void assertNotEquals(float expected, float actual)
          Asserts that values are not equal.
static void assertNotEquals(int expected, int actual)
          Asserts that values are not equal.
static void assertNotEquals(long expected, long actual)
          Asserts that values are not equal.
static void assertNotEquals(java.lang.Object expected, java.lang.Object actual)
          Asserts that objects are not equal.
static void assertNotEquals(java.lang.String message, byte expected, byte actual)
          Asserts that values are not equal.
static void assertNotEquals(java.lang.String message, float expected, float actual)
          Asserts that values are not equal.
static void assertNotEquals(java.lang.String message, int expected, int actual)
          Asserts that values are not equal.
static void assertNotEquals(java.lang.String message, long expected, long actual)
          Asserts that values are not equal.
static void assertNotEquals(java.lang.String message, java.lang.Object expected, java.lang.Object actual)
          Asserts that objects are not equal.
static void assertNotEquals(java.lang.String expected, java.lang.String actual)
          Asserts that strings are not equal.
static void assertNotEquals(java.lang.String message, java.lang.String expected, java.lang.String actual)
          Asserts that strings are not equal.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Asserts

protected Asserts()
Method Detail

assertEquals

public static void assertEquals(java.util.Date expected,
                                java.util.Date actual)
Asserts that dates are equal with second precision. If it isn't, an AssertionError is thrown.

Parameters:
expected - expected result
actual - actual result

assertEquals

public static void assertEquals(java.lang.String message,
                                java.util.Date expected,
                                java.util.Date actual)
Asserts that dates are equal with second precision. If it isn't, an AssertionError is thrown with the given message.

Parameters:
expected - expected result
actual - actual result
message - the identifying message for the AssertionError (null okay)

assertNotEquals

public static void assertNotEquals(java.lang.Object expected,
                                   java.lang.Object actual)
Asserts that objects are not equal. If they are, an AssertionError is thrown.

Parameters:
expected - expected result
actual - actual result

assertNotEquals

public static void assertNotEquals(java.lang.String message,
                                   java.lang.Object expected,
                                   java.lang.Object actual)
Asserts that objects are not equal. If they are, an AssertionError is thrown with the given message.

Parameters:
expected - expected result
actual - actual result
message - the identifying message for the AssertionError (null okay)

assertNotEquals

public static void assertNotEquals(java.lang.String expected,
                                   java.lang.String actual)
Asserts that strings are not equal. If they are, an AssertionError is thrown.

Parameters:
expected - expected result
actual - actual result

assertNotEquals

public static void assertNotEquals(java.lang.String message,
                                   java.lang.String expected,
                                   java.lang.String actual)
Asserts that strings are not equal. If they are, an AssertionError is thrown with the given message.

Parameters:
expected - expected result
actual - actual result
message - the identifying message for the AssertionError (null okay)

assertNotEquals

public static void assertNotEquals(int expected,
                                   int actual)
Asserts that values are not equal. If they are, an AssertionError is thrown.

Parameters:
expected - expected result
actual - actual result

assertNotEquals

public static void assertNotEquals(java.lang.String message,
                                   int expected,
                                   int actual)
Asserts that values are not equal. If they are, an AssertionError is thrown with the given message.

Parameters:
expected - expected result
actual - actual result
message - the identifying message for the AssertionError (null okay)

assertNotEquals

public static void assertNotEquals(byte expected,
                                   byte actual)
Asserts that values are not equal. If they are, an AssertionError is thrown.

Parameters:
expected - expected result
actual - actual result

assertNotEquals

public static void assertNotEquals(java.lang.String message,
                                   byte expected,
                                   byte actual)
Asserts that values are not equal. If they are, an AssertionError is thrown with the given message.

Parameters:
expected - expected result
actual - actual result
message - the identifying message for the AssertionError (null okay)

assertNotEquals

public static void assertNotEquals(long expected,
                                   long actual)
Asserts that values are not equal. If they are, an AssertionError is thrown.

Parameters:
expected - expected result
actual - actual result

assertNotEquals

public static void assertNotEquals(java.lang.String message,
                                   long expected,
                                   long actual)
Asserts that values are not equal. If they are, an AssertionError is thrown with the given message.

Parameters:
expected - expected result
actual - actual result
message - the identifying message for the AssertionError (null okay)

assertNotEquals

public static void assertNotEquals(float expected,
                                   float actual)
Asserts that values are not equal. If they are, an AssertionError is thrown.

Parameters:
expected - expected result
actual - actual result

assertNotEquals

public static void assertNotEquals(java.lang.String message,
                                   float expected,
                                   float actual)
Asserts that values are not equal. If they are, an AssertionError is thrown with the given message.

Parameters:
expected - expected result
actual - actual result
message - the identifying message for the AssertionError (null okay)

assertInSet

public static <T> void assertInSet(T[] superset,
                                   T[] subset)
Asserts that all values of the subset is exist in superset. If they aren't, an AssertionError is thrown.

Parameters:
superset - set of expected values
subset - set of actual values

assertInSet

public static <T> void assertInSet(java.lang.String message,
                                   T[] superset,
                                   T[] subset)
Asserts that all values of the subset is exist in superset. If they aren't, an AssertionError is thrown with the given message.

Parameters:
superset - set of expected values
subset - set of actual values
message - the identifying message for the AssertionError (null okay)

BrokenEvent nanotests