org.omnaest.utils.assertion
Interface AssertLogger.LoglevelAssert

All Superinterfaces:
Serializable
All Known Implementing Classes:
AssertLogger.LoglevelImpl
Enclosing class:
AssertLogger

public static interface AssertLogger.LoglevelAssert
extends Serializable

Provider for Assert based methods which throws appropriate Exceptions which it catches immediately and logs it to the underlying Logger using the selected AssertLogger.Loglevel. This allows to output Exception based stacktrace information without raising an Exception for any calling logic.

Therefore all functions of the AssertLogger.LoglevelAssert will return true, if the assertion has not failed. And it returns false if the assertion has failed and an Exception was logged to the underlying Logger instance.

For usage examples see AssertLogger...

Author:
Omnaest

Method Summary
 boolean areEqual(Object object1, Object object2)
          Returns true if the given Objects are equal
 boolean areEqual(Object object1, Object object2, String message)
          Returns true if the given Objects are equal
 void fails()
           
 void fails(Exception cause)
           
 void fails(String message)
           
 void fails(String message, Exception cause)
           
 boolean isFalse(boolean expression)
          Returns true if the given expression is false
 boolean isFalse(boolean expression, String message)
          Returns true if the given expression is false
 boolean isInterimTimeLowerThan(int durationLimit, TimeUnit timeUnit, DurationCapture durationCapture, Object[] intervalKeys)
          Returns true if the DurationCapture.getInterimTime(TimeUnit) is lower than the given duration limit.
 boolean isNotEmpty(Collection<?> collection)
          Returns true if the given Collections is not null and not empty.
 boolean isNotEmpty(Collection<?> collection, String message)
          Returns true if the given Collections is not null and not empty.
 boolean isNotNull(Object object)
          Returns true if the given Object is not null.
 boolean isNotNull(Object object, Object... objects)
          Returns true if all the given Objects are not null.
 boolean isNotNull(Object object, String message)
          Returns true if all the given Objects are not null.
 boolean isNotNull(String message, Object object, Object... objects)
          Returns true if all the given Objects are not null.
 boolean isTrue(boolean expression)
          Returns true if the given expression is true
 boolean isTrue(boolean expression, String message)
          Returns true if the given expression is true
 

Method Detail

isInterimTimeLowerThan

boolean isInterimTimeLowerThan(int durationLimit,
                               TimeUnit timeUnit,
                               DurationCapture durationCapture,
                               Object[] intervalKeys)
Returns true if the DurationCapture.getInterimTime(TimeUnit) is lower than the given duration limit.

Parameters:
durationLimit -
timeUnit - TimeUnit
durationCapture - DurationCapture
intervalKeys -
Returns:
See Also:
Assert.isInterimTimeLowerThan(int, TimeUnit, DurationCapture, Object[]), AssertLogger.LoglevelAssert

fails

void fails(String message,
           Exception cause)
Parameters:
message -
cause -
See Also:
Assert.fails(), AssertLogger.LoglevelAssert

fails

void fails(String message)
Parameters:
message -
See Also:
Assert.fails(), AssertLogger.LoglevelAssert

fails

void fails(Exception cause)
Parameters:
cause -
See Also:
Assert.fails(Exception), AssertLogger.LoglevelAssert

fails

void fails()
See Also:
Assert.fails(), AssertLogger.LoglevelAssert

isNotNull

boolean isNotNull(String message,
                  Object object,
                  Object... objects)
Returns true if all the given Objects are not null.

Parameters:
message -
object -
objects -
Returns:
See Also:
Assert.isNotNull(String, Object, Object, Object...), AssertLogger.LoglevelAssert

isNotNull

boolean isNotNull(Object object,
                  String message)
Returns true if all the given Objects are not null.

Parameters:
object -
message -
Returns:
See Also:
Assert.isNotNull(Object, String), AssertLogger.LoglevelAssert

isNotNull

boolean isNotNull(Object object,
                  Object... objects)
Returns true if all the given Objects are not null.

Parameters:
object -
objects -
Returns:
See Also:
Assert.isNotNull(Object, Object...), AssertLogger.LoglevelAssert

isNotNull

boolean isNotNull(Object object)
Returns true if the given Object is not null.

Parameters:
object -
Returns:
See Also:
Assert.isNotNull(Object), AssertLogger.LoglevelAssert

isNotEmpty

boolean isNotEmpty(Collection<?> collection,
                   String message)
Returns true if the given Collections is not null and not empty.

Parameters:
message -
collection -
Returns:
See Also:
Assert.isNotEmpty(Collection, String), AssertLogger.LoglevelAssert

isNotEmpty

boolean isNotEmpty(Collection<?> collection)
Returns true if the given Collections is not null and not empty.

Parameters:
collection -
Returns:
See Also:
Assert.isNotEmpty(Collection), AssertLogger.LoglevelAssert

areEqual

boolean areEqual(Object object1,
                 Object object2,
                 String message)
Returns true if the given Objects are equal

Parameters:
object1 -
object2 -
message -
Returns:
See Also:
Assert.areEqual(Object, Object, String), AssertLogger.LoglevelAssert

areEqual

boolean areEqual(Object object1,
                 Object object2)
Returns true if the given Objects are equal

Parameters:
object1 -
object2 -
Returns:
See Also:
Assert.areEqual(Object, Object), AssertLogger.LoglevelAssert

isFalse

boolean isFalse(boolean expression,
                String message)
Returns true if the given expression is false

Parameters:
expression -
message -
Returns:
See Also:
Assert.isFalse(boolean, String), AssertLogger.LoglevelAssert

isFalse

boolean isFalse(boolean expression)
Returns true if the given expression is false

Parameters:
expression -
Returns:
See Also:
Assert.isFalse(boolean), AssertLogger.LoglevelAssert

isTrue

boolean isTrue(boolean expression,
               String message)
Returns true if the given expression is true

Parameters:
expression -
message -
Returns:
See Also:
Assert.isTrue(boolean, String), AssertLogger.LoglevelAssert

isTrue

boolean isTrue(boolean expression)
Returns true if the given expression is true

Parameters:
expression -
Returns:
See Also:
Assert.isTrue(boolean), AssertLogger.LoglevelAssert


Copyright © 2013. All Rights Reserved.