Class SimpleAssert

java.lang.Object
org.dbunit.assertion.SimpleAssert
Direct Known Subclasses:
AbstractDatabaseTester

public class SimpleAssert extends Object
Dbunit's own small assertion utility, independent from the testing framework that is used.
Since:
2.4.0
Version:
$Revision$ $Date$
Author:
gommma (gommma AT users.sourceforge.net), Last changed by: $Author$
  • Constructor Details

    • SimpleAssert

      public SimpleAssert(FailureHandler failureHandler)
      Constructs a SimpleAssert reporting failures through the given handler.
      Parameters:
      failureHandler - the handler used to report failures.
  • Method Details

    • assertNotNullNorEmpty

      protected void assertNotNullNorEmpty(String propertyName, String property)
      Asserts that propertyName is not a null String and has a length greater than zero.
      Parameters:
      propertyName - the name of the property being validated, used in the failure message.
      property - the property value to validate.
    • assertTrue

      public void assertTrue(boolean condition)
      Evaluate if the given condition is true or not.
      Parameters:
      condition - condition to be tested
    • assertTrue

      public void assertTrue(String message, boolean condition)
      Evaluate if the given condition is true or not.
      Parameters:
      message - message displayed if assertion is false
      condition - condition to be tested
    • assertNotNull

      public void assertNotNull(Object object)
      Evaluate that the given object is not null.
      Parameters:
      object - the object to check.
    • assertNotNull

      public void assertNotNull(String message, Object object)
      Evaluate that the given object is not null.
      Parameters:
      message - message displayed if assertion is false
      object - the object to check.
    • fail

      public void fail(String message)
      Reports a failure through this instance's FailureHandler.
      Parameters:
      message - message displayed for the failure.