org.apache.commons.jelly.tags.junit

## Class AssertTagSupport

- java.lang.Object
- - org.apache.commons.jelly.TagSupport
  - - org.apache.commons.jelly.xpath.XPathTagSupport
    - - org.apache.commons.jelly.tags.junit.AssertTagSupport

All Implemented Interfaces:
  Tag

Direct Known Subclasses:
  AssertEqualsTag, AssertFileContainsTag, AssertFileExistsTag, AssertFileNotFoundTag, AssertTag, AssertThrowsTag, FailTag

    public abstract class AssertTagSupport
    extends XPathTagSupport

The abstract base class of any assertion tag which is useful for implementation inheritence.

Version:
  $Revision: 345902 $
Author:
  James Strachan

### Field Summary

### Fields inherited from class org.apache.commons.jelly.TagSupport

`body, context, parent`

### Constructor Summary

Constructors
Constructor and Description
`AssertTagSupport()`

### Method Summary

Methods
`protected void` `assertEquals(boolean expected, boolean actual)`
`protected void` `assertEquals(byte expected, byte actual)`
`protected void` `assertEquals(char expected, char actual)`
`protected void` `assertEquals(double expected, double actual)`
`protected void` `assertEquals(float expected, float actual)`
`protected void` `assertEquals(int expected, int actual)`
`protected void` `assertEquals(long expected, long actual)`
`protected void` `assertEquals(java.lang.Object expected, java.lang.Object actual)`
`protected void` `assertEquals(short expected, short actual)`
`protected void` `assertEquals(java.lang.String message, boolean expected, boolean actual)`
`protected void` `assertEquals(java.lang.String message, byte expected, byte actual)`
`protected void` `assertEquals(java.lang.String message, char expected, char actual)`
`protected void` `assertEquals(java.lang.String message, double expected, double actual)`
`protected void` `assertEquals(java.lang.String message, float expected, float actual)`
`protected void` `assertEquals(java.lang.String message, int expected, int actual)`
`protected void` `assertEquals(java.lang.String message, long expected, long actual)`
`protected void` `assertEquals(java.lang.String message, java.lang.Object expected, java.lang.Object actual)` Fail if !expected.equals(actual).
`protected void` `assertEquals(java.lang.String message, short expected, short actual)`
`protected void` `assertFalse(boolean actual)` Fail if actual is true
`protected void` `assertFalse(java.lang.String message, boolean actual)` Fail if actual is true
`protected void` `assertNotNull(java.lang.Object actual)`
`protected void` `assertNotNull(java.lang.String message, java.lang.Object actual)` Fail if actual is null
`protected void` `assertNotSame(java.lang.Object expected, java.lang.Object actual)`
`protected void` `assertNotSame(java.lang.String message, java.lang.Object expected, java.lang.Object actual)` Fail if expected == actual.
`protected void` `assertNull(java.lang.Object actual)`
`protected void` `assertNull(java.lang.String message, java.lang.Object actual)` Fail if actual is not null
`protected void` `assertSame(java.lang.Object expected, java.lang.Object actual)`
`protected void` `assertSame(java.lang.String message, java.lang.Object expected, java.lang.Object actual)` Fail if expected != actual.
`protected void` `assertTrue(boolean actual)` Fail if actual is not true
`protected void` `assertTrue(java.lang.String message, boolean actual)` Fail if actual is not true
`protected void` `fail()` Produces a failure assertion with a default message
`protected void` `fail(java.lang.String message)` Produces a failure assertion with the given message
`protected void` `fail(java.lang.String message, java.lang.String detail)` Produces a failure assertion with the given message and added detail.
`protected void` `failNotEquals(java.lang.String message, java.lang.Object expected, java.lang.Object actual, java.lang.String expressions)` Produces a failure if the actual value was not equal to the expected value

### Methods inherited from class org.apache.commons.jelly.xpath.XPathTagSupport

`getXPathContext`

### Methods inherited from class org.apache.commons.jelly.TagSupport

`findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, getBody, getBodyText, getBodyText, getContext, getParent, invokeBody, isEscapeText, isTrim, setBody, setContext, setEscapeText, setParent, setTrim, trimBody`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.apache.commons.jelly.Tag

`doTag`

### Constructor Detail

#### AssertTagSupport

    public AssertTagSupport()

### Method Detail

#### fail

    protected void fail(java.lang.String message)
                 throws JellyAssertionFailedError

Produces a failure assertion with the given message

Throws:
  `JellyAssertionFailedError` - to signify failure

#### fail

    protected void fail()
                 throws JellyAssertionFailedError

Produces a failure assertion with a default message

Throws:
  `JellyAssertionFailedError` - to signify failure

#### fail

    protected void fail(java.lang.String message,
            java.lang.String detail)
                 throws JellyAssertionFailedError

Produces a failure assertion with the given message and added detail.

Throws:
  `JellyAssertionFailedError` - to signify failure

#### failNotEquals

    protected void failNotEquals(java.lang.String message,
                     java.lang.Object expected,
                     java.lang.Object actual,
                     java.lang.String expressions)
                          throws JellyAssertionFailedError

Produces a failure if the actual value was not equal to the expected value

Throws:
  `JellyAssertionFailedError` - if expected != actual.

#### assertTrue

    protected void assertTrue(java.lang.String message,
                  boolean actual)
                       throws JellyAssertionFailedError

Fail if actual is not true

Parameters:
  `message` - failure message
  `actual` - value to test
Throws:
  `JellyAssertionFailedError` - to signify failure

#### assertTrue

    protected void assertTrue(boolean actual)
                       throws JellyAssertionFailedError

Fail if actual is not true

Parameters:
  `actual` - value to test
Throws:
  `JellyAssertionFailedError` - to signify failure

#### assertFalse

    protected void assertFalse(java.lang.String message,
                   boolean actual)
                        throws JellyAssertionFailedError

Fail if actual is true

Parameters:
  `message` - failure message
  `actual` - value to test
Throws:
  `JellyAssertionFailedError` - to signify failure

#### assertFalse

    protected void assertFalse(boolean actual)
                        throws JellyAssertionFailedError

Fail if actual is true

Parameters:
  `actual` - value to test
Throws:
  `JellyAssertionFailedError` - to signify failure

#### assertEquals

    protected void assertEquals(java.lang.String message,
                    java.lang.Object expected,
                    java.lang.Object actual)
                         throws JellyAssertionFailedError

Fail if !expected.equals(actual). If expected is null, actual must be.

Parameters:
  `message` - failure message.
  `expected` - expected value.
  `actual` - actual value to compare against expected.
Throws:
  `JellyAssertionFailedError` - to signify failure

#### assertEquals

    protected void assertEquals(java.lang.Object expected,
                    java.lang.Object actual)
                         throws JellyAssertionFailedError

Throws:
  `JellyAssertionFailedError`
See Also:
  `assertEquals(String, Object, Object)`

#### assertEquals

    protected void assertEquals(java.lang.String message,
                    boolean expected,
                    boolean actual)
                         throws JellyAssertionFailedError

Throws:
  `JellyAssertionFailedError`
See Also:
  `assertEquals(String, Object, Object)`

#### assertEquals

    protected void assertEquals(boolean expected,
                    boolean actual)
                         throws JellyAssertionFailedError

Throws:
  `JellyAssertionFailedError`
See Also:
  `assertEquals(Object, Object)`

#### assertEquals

    protected void assertEquals(java.lang.String message,
                    byte expected,
                    byte actual)
                         throws JellyAssertionFailedError

Throws:
  `JellyAssertionFailedError`
See Also:
  `assertEquals(String, Object, Object)`

#### assertEquals

    protected void assertEquals(byte expected,
                    byte actual)
                         throws JellyAssertionFailedError

Throws:
  `JellyAssertionFailedError`
See Also:
  `assertEquals(Object, Object)`

#### assertEquals

    protected void assertEquals(java.lang.String message,
                    char expected,
                    char actual)
                         throws JellyAssertionFailedError

Throws:
  `JellyAssertionFailedError`
See Also:
  `assertEquals(String, Object, Object)`

#### assertEquals

    protected void assertEquals(char expected,
                    char actual)
                         throws JellyAssertionFailedError

Throws:
  `JellyAssertionFailedError`
See Also:
  `assertEquals(Object, Object)`

#### assertEquals

    protected void assertEquals(java.lang.String message,
                    double expected,
                    double actual)
                         throws JellyAssertionFailedError

Throws:
  `JellyAssertionFailedError`
See Also:
  `assertEquals(String, Object, Object)`

#### assertEquals

    protected void assertEquals(double expected,
                    double actual)
                         throws JellyAssertionFailedError

Throws:
  `JellyAssertionFailedError`
See Also:
  `assertEquals(Object, Object)`

#### assertEquals

    protected void assertEquals(java.lang.String message,
                    float expected,
                    float actual)
                         throws JellyAssertionFailedError

Throws:
  `JellyAssertionFailedError`
See Also:
  `assertEquals(String, Object, Object)`

#### assertEquals

    protected void assertEquals(float expected,
                    float actual)
                         throws JellyAssertionFailedError

Throws:
  `JellyAssertionFailedError`
See Also:
  `assertEquals(Object, Object)`

#### assertEquals

    protected void assertEquals(java.lang.String message,
                    int expected,
                    int actual)
                         throws JellyAssertionFailedError

Throws:
  `JellyAssertionFailedError`
See Also:
  `assertEquals(String, Object, Object)`

#### assertEquals

    protected void assertEquals(int expected,
                    int actual)
                         throws JellyAssertionFailedError

Throws:
  `JellyAssertionFailedError`
See Also:
  `assertEquals(Object, Object)`

#### assertEquals

    protected void assertEquals(java.lang.String message,
                    long expected,
                    long actual)
                         throws JellyAssertionFailedError

Throws:
  `JellyAssertionFailedError`
See Also:
  `assertEquals(String, Object, Object)`

#### assertEquals

    protected void assertEquals(long expected,
                    long actual)
                         throws JellyAssertionFailedError

Throws:
  `JellyAssertionFailedError`
See Also:
  `assertEquals(Object, Object)`

#### assertEquals

    protected void assertEquals(java.lang.String message,
                    short expected,
                    short actual)
                         throws JellyAssertionFailedError

Throws:
  `JellyAssertionFailedError`
See Also:
  `assertEquals(String, Object, Object)`

#### assertEquals

    protected void assertEquals(short expected,
                    short actual)
                         throws JellyAssertionFailedError

Throws:
  `JellyAssertionFailedError`
See Also:
  `assertEquals(Object, Object)`

#### assertNull

    protected void assertNull(java.lang.String message,
                  java.lang.Object actual)

Fail if actual is not null

Parameters:
  `message` - failure message
  `actual` - value to check
Throws:
  `JellyAssertionFailedError` - to signify failure

#### assertNull

    protected void assertNull(java.lang.Object actual)

See Also:
  `assertNull(String, Object)`

#### assertNotNull

    protected void assertNotNull(java.lang.String message,
                     java.lang.Object actual)

Fail if actual is null

Parameters:
  `message` - failure message
  `actual` - value to check
Throws:
  `JellyAssertionFailedError` - to signify failure

#### assertNotNull

    protected void assertNotNull(java.lang.Object actual)

See Also:
  `assertNotNull(String, Object)`

#### assertSame

    protected void assertSame(java.lang.String message,
                  java.lang.Object expected,
                  java.lang.Object actual)
                       throws JellyAssertionFailedError

Fail if expected != actual. If expected is null, actual must not be.

Parameters:
  `message` - failure message.
  `expected` - expected value.
  `actual` - actual value to compare against expected.
Throws:
  `JellyAssertionFailedError` - to signify failure

#### assertSame

    protected void assertSame(java.lang.Object expected,
                  java.lang.Object actual)
                       throws JellyAssertionFailedError

Throws:
  `JellyAssertionFailedError`
See Also:
  `assertSame(String, Object, Object)`

#### assertNotSame

    protected void assertNotSame(java.lang.String message,
                     java.lang.Object expected,
                     java.lang.Object actual)
                          throws JellyAssertionFailedError

Fail if expected == actual. If expected is null, actual must be.

Parameters:
  `message` - failure message.
  `expected` - expected value.
  `actual` - actual value to compare against expected.
Throws:
  `JellyAssertionFailedError` - to signify failure

#### assertNotSame

    protected void assertNotSame(java.lang.Object expected,
                     java.lang.Object actual)
                          throws JellyAssertionFailedError

Throws:
  `JellyAssertionFailedError`
See Also:
  `assertNotSame(String, Object, Object)`