org.jomc.ant.test.support
Class Assert

Package class diagram package Assert
java.lang.Object
  extended by org.jomc.ant.test.support.Assert

public abstract class Assert
extends Object

Provides static methods for testing various assertions related to Ant executions.

Version:
$JOMC: Assert.java 3850 2011-10-10 16:22:55Z schulte2005 $
Author:
Christian Schulte

Constructor Summary
Assert()
          Creates a new Assert instance.
 
Method Summary
static void assertException(AntExecutionResult result, Class<? extends Throwable> exception)
          Tests an Ant execution to have thrown an exception of a given type.
static void assertException(AntExecutionResult result, Class<? extends Throwable> exception, CharSequence reason)
          Tests an Ant execution to have thrown an exception of a given type taking a reason.
static void assertExceptionInstance(AntExecutionResult result, Class<? extends Throwable> exception)
          Tests an Ant execution to have thrown an instance of a given exception.
static void assertExceptionInstance(AntExecutionResult result, Class<? extends Throwable> exception, CharSequence reason)
          Tests an Ant execution to have thrown an instance of a given exception taking a reason.
static void assertExceptionMessage(AntExecutionResult result, CharSequence message)
          Tests an Ant execution to have thrown an exception with a given message.
static void assertExceptionMessage(AntExecutionResult result, CharSequence message, CharSequence reason)
          Tests an Ant execution to have thrown an exception with a given message taking a reason.
static void assertExceptionMessageContaining(AntExecutionResult result, CharSequence needle)
          Tests an Ant execution to have thrown an exception with a message containing a given string.
static void assertExceptionMessageContaining(AntExecutionResult result, CharSequence needle, CharSequence reason)
          Tests an Ant execution to have thrown an exception with a message containing a given string taking a reason.
static void assertMessageLogged(AntExecutionResult result, CharSequence message)
          Tests an Ant execution to have fired a messageLogged event holding a given message.
static void assertMessageLogged(AntExecutionResult result, CharSequence message, CharSequence reason)
          Tests an Ant execution to have fired a messageLogged event holding a given message taking a reason.
static void assertMessageLogged(AntExecutionResult result, CharSequence message, int priority)
          Tests an Ant execution to have fired a messageLogged event holding a given message with a given priority.
static void assertMessageLogged(AntExecutionResult result, CharSequence message, int priority, CharSequence reason)
          Tests an Ant execution to have fired a messageLogged event holding a given message with a given priority taking a reason.
static void assertMessageLoggedContaining(AntExecutionResult result, CharSequence needle)
          Tests an Ant execution to have fired a messageLogged event holding a message containing a given text.
static void assertMessageLoggedContaining(AntExecutionResult result, CharSequence needle, CharSequence reason)
          Tests an Ant execution to have fired a messageLogged event holding a message containing a given text taking a reason.
static void assertMessageLoggedContaining(AntExecutionResult result, CharSequence needle, int priority)
          Tests an Ant execution to have fired a messageLogged event holding a message containing a given text with a given priority.
static void assertMessageLoggedContaining(AntExecutionResult result, CharSequence needle, int priority, CharSequence reason)
          Tests an Ant execution to have fired a messageLogged event holding a message containing a given text with a given priority taking a reason.
static void assertMessageNotLogged(AntExecutionResult result, CharSequence message)
          Tests an Ant execution to not have fired a messageLogged event holding a given message.
static void assertMessageNotLogged(AntExecutionResult result, CharSequence message, CharSequence reason)
          Tests an Ant execution to not have fired a messageLogged event holding a given message taking a reason.
static void assertMessageNotLoggedContaining(AntExecutionResult result, CharSequence needle)
          Tests an Ant execution to not have fired a messageLogged event holding a message containing a given text.
static void assertMessageNotLoggedContaining(AntExecutionResult result, CharSequence needle, CharSequence reason)
          Tests an Ant execution to not have fired a messageLogged event holding a message containing a given text taking a reason.
static void assertNoException(AntExecutionResult result)
          Tests an Ant execution to not have thrown an exception.
static void assertNoException(AntExecutionResult result, CharSequence reason)
          Tests an Ant execution to not have thrown an exception taking a reason.
static void assertSystemErrorContaining(AntExecutionResult result, CharSequence needle)
          Tests an Ant execution to have written a given text to the system error stream.
static void assertSystemErrorContaining(AntExecutionResult result, CharSequence needle, CharSequence reason)
          Tests an Ant execution to have written a given text to the system error stream taking a reason.
static void assertSystemOutputContaining(AntExecutionResult result, CharSequence needle)
          Tests an Ant execution to have written a given text to the system output stream.
static void assertSystemOutputContaining(AntExecutionResult result, CharSequence needle, CharSequence reason)
          Tests an Ant execution to have written a given text to the system output stream taking a reason.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Assert

public Assert()
Creates a new Assert instance.

Method Detail

assertException

public static void assertException(AntExecutionResult result,
                                   Class<? extends Throwable> exception)
Tests an Ant execution to have thrown an exception of a given type.

Parameters:
result - The result to test.
exception - The class of the expected exception.

assertException

public static void assertException(AntExecutionResult result,
                                   Class<? extends Throwable> exception,
                                   CharSequence reason)
Tests an Ant execution to have thrown an exception of a given type taking a reason.

Parameters:
result - The result to test.
exception - The class of the expected exception.
reason - The reason describing why exception should have been thrown.

assertExceptionInstance

public static void assertExceptionInstance(AntExecutionResult result,
                                           Class<? extends Throwable> exception)
Tests an Ant execution to have thrown an instance of a given exception.

Parameters:
result - The result to test.
exception - The class the expected exception should be an instance of.

assertExceptionInstance

public static void assertExceptionInstance(AntExecutionResult result,
                                           Class<? extends Throwable> exception,
                                           CharSequence reason)
Tests an Ant execution to have thrown an instance of a given exception taking a reason.

Parameters:
result - The result to test.
exception - The class the expected exception should be an instance of.
reason - The reason describing why exception should have been thrown.

assertExceptionMessage

public static void assertExceptionMessage(AntExecutionResult result,
                                          CharSequence message)
Tests an Ant execution to have thrown an exception with a given message.

Parameters:
result - The result to test.
message - The message of the expected exception.

assertExceptionMessage

public static void assertExceptionMessage(AntExecutionResult result,
                                          CharSequence message,
                                          CharSequence reason)
Tests an Ant execution to have thrown an exception with a given message taking a reason.

Parameters:
result - The result to test.
message - The message of the expected exception.
reason - The reason describing why exception should have been thrown.

assertExceptionMessageContaining

public static void assertExceptionMessageContaining(AntExecutionResult result,
                                                    CharSequence needle)
Tests an Ant execution to have thrown an exception with a message containing a given string.

Parameters:
result - The result to test.
needle - The text the message of the expected exception should contain.

assertExceptionMessageContaining

public static void assertExceptionMessageContaining(AntExecutionResult result,
                                                    CharSequence needle,
                                                    CharSequence reason)
Tests an Ant execution to have thrown an exception with a message containing a given string taking a reason.

Parameters:
result - The result to test.
needle - The text the message of the expected exception should contain.
reason - The reason describing why exception should have been thrown.

assertNoException

public static void assertNoException(AntExecutionResult result)
Tests an Ant execution to not have thrown an exception.

Parameters:
result - The result to test.

assertNoException

public static void assertNoException(AntExecutionResult result,
                                     CharSequence reason)
Tests an Ant execution to not have thrown an exception taking a reason.

Parameters:
result - The result to test.
reason - The reason describing why the execution should not have thrown an exception.

assertSystemOutputContaining

public static void assertSystemOutputContaining(AntExecutionResult result,
                                                CharSequence needle)
Tests an Ant execution to have written a given text to the system output stream.

Parameters:
result - The result to test.
needle - The text which should have been written to the system output stream.

assertSystemOutputContaining

public static void assertSystemOutputContaining(AntExecutionResult result,
                                                CharSequence needle,
                                                CharSequence reason)
Tests an Ant execution to have written a given text to the system output stream taking a reason.

Parameters:
result - The result to test.
needle - The text which should have been written to the system output stream.
reason - The reason describing why needle should have been written to the system output stream.

assertSystemErrorContaining

public static void assertSystemErrorContaining(AntExecutionResult result,
                                               CharSequence needle)
Tests an Ant execution to have written a given text to the system error stream.

Parameters:
result - The result to test.
needle - The text which should have been written to the system error stream.

assertSystemErrorContaining

public static void assertSystemErrorContaining(AntExecutionResult result,
                                               CharSequence needle,
                                               CharSequence reason)
Tests an Ant execution to have written a given text to the system error stream taking a reason.

Parameters:
result - The result to test.
needle - The text which should have been written to the system error stream.
reason - The reason describing why needle should have been written to the system error stream.

assertMessageLogged

public static void assertMessageLogged(AntExecutionResult result,
                                       CharSequence message)
Tests an Ant execution to have fired a messageLogged event holding a given message.

Parameters:
result - The result to test.
message - The message which should have been logged.

assertMessageLogged

public static void assertMessageLogged(AntExecutionResult result,
                                       CharSequence message,
                                       CharSequence reason)
Tests an Ant execution to have fired a messageLogged event holding a given message taking a reason.

Parameters:
result - The result to test.
message - The message which should have been logged.
reason - The reason describing why message should have been logged.

assertMessageLogged

public static void assertMessageLogged(AntExecutionResult result,
                                       CharSequence message,
                                       int priority)
Tests an Ant execution to have fired a messageLogged event holding a given message with a given priority.

Parameters:
result - The result to test.
message - The message which should have been logged.
priority - The priority the message should have been logged with.

assertMessageLogged

public static void assertMessageLogged(AntExecutionResult result,
                                       CharSequence message,
                                       int priority,
                                       CharSequence reason)
Tests an Ant execution to have fired a messageLogged event holding a given message with a given priority taking a reason.

Parameters:
result - The result to test.
message - The message which should have been logged.
priority - The priority the message should have been logged with.
reason - The reason describing why message should have been logged.

assertMessageLoggedContaining

public static void assertMessageLoggedContaining(AntExecutionResult result,
                                                 CharSequence needle)
Tests an Ant execution to have fired a messageLogged event holding a message containing a given text.

Parameters:
result - The result to test.
needle - The text contained in a message which should have been logged.

assertMessageLoggedContaining

public static void assertMessageLoggedContaining(AntExecutionResult result,
                                                 CharSequence needle,
                                                 CharSequence reason)
Tests an Ant execution to have fired a messageLogged event holding a message containing a given text taking a reason.

Parameters:
result - The result to test.
needle - The text contained in a message which should have been logged.
reason - The reason describing why needle should have been logged.

assertMessageLoggedContaining

public static void assertMessageLoggedContaining(AntExecutionResult result,
                                                 CharSequence needle,
                                                 int priority)
Tests an Ant execution to have fired a messageLogged event holding a message containing a given text with a given priority.

Parameters:
result - The result to test.
needle - The text contained in a message which should have been logged.
priority - The priority the message should have been logged with.

assertMessageLoggedContaining

public static void assertMessageLoggedContaining(AntExecutionResult result,
                                                 CharSequence needle,
                                                 int priority,
                                                 CharSequence reason)
Tests an Ant execution to have fired a messageLogged event holding a message containing a given text with a given priority taking a reason.

Parameters:
result - The result to test.
needle - The text contained in a message which should have been logged.
priority - The priority the message should have been logged with.
reason - The reason describing why message should have been logged.

assertMessageNotLogged

public static void assertMessageNotLogged(AntExecutionResult result,
                                          CharSequence message)
Tests an Ant execution to not have fired a messageLogged event holding a given message.

Parameters:
result - The result to test.
message - The message which should not have been logged.

assertMessageNotLogged

public static void assertMessageNotLogged(AntExecutionResult result,
                                          CharSequence message,
                                          CharSequence reason)
Tests an Ant execution to not have fired a messageLogged event holding a given message taking a reason.

Parameters:
result - The result to test.
message - The message which should not have been logged.
reason - The reason describing why message should not have been logged.

assertMessageNotLoggedContaining

public static void assertMessageNotLoggedContaining(AntExecutionResult result,
                                                    CharSequence needle)
Tests an Ant execution to not have fired a messageLogged event holding a message containing a given text.

Parameters:
result - The result to test.
needle - The text contained in a message which should not have been logged.

assertMessageNotLoggedContaining

public static void assertMessageNotLoggedContaining(AntExecutionResult result,
                                                    CharSequence needle,
                                                    CharSequence reason)
Tests an Ant execution to not have fired a messageLogged event holding a message containing a given text taking a reason.

Parameters:
result - The result to test.
needle - The text contained in a message which should not have been logged.
reason - The reason describing why message should not have been logged.


Copyright © 2005-2012 The JOMC Project. All Rights Reserved.Get JOMC at SourceForge.net. Fast, secure and Free Open Source software downloads
Please note that this documentation is maintained by non-native english speaking authors. As such, you may encounter phrases or wordings which seem imprecise or may even have a totally different meaning to native english speaking readers than what the individual author was trying to express. If you are a native english speaking reader and find any such phrases or wordings we kindly ask you to send an email to the corresponding author and help us improve this documentation in order to avoid misunderstandings. You will find the authors' email addresses at the top of each class. Please accept our apologies for any inconvenience caused.