org.eclipse.ease.modules.unittest.modules

## Class MergedAssertion

- java.lang.Object
- - org.eclipse.ease.modules.unittest.modules.MergedAssertion

All Implemented Interfaces:
  IAssertion

    public class MergedAssertion
    extends Object
    implements IAssertion

An assertion that merges the results of other assertions.

### Field Summary

### Fields inherited from interface org.eclipse.ease.modules.unittest.modules.IAssertion

`INVALID, VALID`

### Constructor Summary

Constructors
Constructor and Description
`MergedAssertion()` Constructor.
`MergedAssertion(String errorMessage)` Constructor.
`MergedAssertion(String validMessage, String errorMessage)` Constructor.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `add(IAssertion assertion)` Add an assertion.
`Collection<IAssertion>` `getAssertions()`
`boolean` `isValid()` Return `true` when assertion is valid.
`String` `toString()`

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

`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### MergedAssertion

    public MergedAssertion()

Constructor. Uses default message for valid case and the first error message from all stored assertion in an error case.

#### MergedAssertion

    public MergedAssertion(String validMessage,
                           String errorMessage)

Constructor. Accepts messages for the valid and for the error case.

Parameters:
  `validMessage` - message for result = valid
  `errorMessage` - message for error case

#### MergedAssertion

    public MergedAssertion(String errorMessage)

Constructor. Accepts a message for the error case.

Parameters:
  `errorMessage` - message for error case

### Method Detail

#### add

    public final void add(IAssertion assertion)

Add an assertion. Accumulates assertion result.

Parameters:
  `assertion` - assertion to add

#### isValid

    public final boolean isValid()

Description copied from interface: `IAssertion`
Return `true` when assertion is valid.

Specified by:
  `isValid` in interface `IAssertion`
Returns:
  `true` on valid assertion

#### toString

    public final String toString()

Overrides:
  `toString` in class `Object`

#### getAssertions

    public Collection<IAssertion> getAssertions()