org.axonframework.test
Class Reporter

java.lang.Object
  extended by org.axonframework.test.Reporter

public class Reporter
extends Object

The reporter generates extensive human readable reports of what the expected outcome of a test was, and what the actual results were.

Since:
0.6
Author:
Allard Buijze

Constructor Summary
Reporter()
           
 
Method Summary
 void reportDifferenceInStoredVsPublished(Collection<DomainEventMessage> storedEvents, Collection<EventMessage> publishedEvents, Throwable probableCause)
          Report a failed assertion due to a difference in the stored versus the published events.
 void reportDifferentEventContents(Class<?> eventType, Field field, Object actual, Object expected)
          Report an error due to a difference in on of the fields of an event.
 void reportUnexpectedException(Throwable actualException, org.hamcrest.Description expectation)
          Reports an error due to an unexpected exception.
 void reportUnexpectedReturnValue(Object actualReturnValue, org.hamcrest.Description description)
          Report an error due to an unexpected return value, while an exception was expected.
 void reportWrongEvent(Collection<?> actualEvents, Collection<?> expectedEvents, Throwable probableCause)
          Report an error in the ordering or count of events.
 void reportWrongEvent(Collection<?> actualEvents, org.hamcrest.StringDescription expectation, Throwable probableCause)
          Report an error in the ordering or count of events.
 void reportWrongException(Throwable actualException, org.hamcrest.Description description)
          Report an error due to a an exception of an unexpected type.
 void reportWrongResult(Object actualReturnValue, org.hamcrest.Description expectation)
          Reports an error due to a wrong return value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Reporter

public Reporter()
Method Detail

reportDifferenceInStoredVsPublished

public void reportDifferenceInStoredVsPublished(Collection<DomainEventMessage> storedEvents,
                                                Collection<EventMessage> publishedEvents,
                                                Throwable probableCause)
Report a failed assertion due to a difference in the stored versus the published events.

Parameters:
storedEvents - The events that were stored
publishedEvents - The events that were published
probableCause - An exception that might be the cause of the failure

reportWrongEvent

public void reportWrongEvent(Collection<?> actualEvents,
                             Collection<?> expectedEvents,
                             Throwable probableCause)
Report an error in the ordering or count of events. This is typically a difference that can be shown to the user by enumerating the expected and actual events

Parameters:
actualEvents - The events that were found
expectedEvents - The events that were expected
probableCause - An optional exception that might be the reason for wrong events

reportWrongEvent

public void reportWrongEvent(Collection<?> actualEvents,
                             org.hamcrest.StringDescription expectation,
                             Throwable probableCause)
Report an error in the ordering or count of events. This is typically a difference that can be shown to the user by enumerating the expected and actual events

Parameters:
actualEvents - The events that were found
expectation - A Description of what was expected
probableCause - An optional exception that might be the reason for wrong events

reportUnexpectedException

public void reportUnexpectedException(Throwable actualException,
                                      org.hamcrest.Description expectation)
Reports an error due to an unexpected exception. This means a return value was expected, but an exception was thrown by the command handler

Parameters:
actualException - The actual exception
expectation - A text describing what was expected

reportWrongResult

public void reportWrongResult(Object actualReturnValue,
                              org.hamcrest.Description expectation)
Reports an error due to a wrong return value.

Parameters:
actualReturnValue - The actual return value
expectation - A description of the expected value

reportUnexpectedReturnValue

public void reportUnexpectedReturnValue(Object actualReturnValue,
                                        org.hamcrest.Description description)
Report an error due to an unexpected return value, while an exception was expected.

Parameters:
actualReturnValue - The actual return value
description - A description describing the expected value

reportWrongException

public void reportWrongException(Throwable actualException,
                                 org.hamcrest.Description description)
Report an error due to a an exception of an unexpected type.

Parameters:
actualException - The actual exception
description - A description describing the expected value

reportDifferentEventContents

public void reportDifferentEventContents(Class<?> eventType,
                                         Field field,
                                         Object actual,
                                         Object expected)
Report an error due to a difference in on of the fields of an event.

Parameters:
eventType - The (runtime) type of event the difference was found in
field - The field that contains the difference
actual - The actual value of the field
expected - The expected value of the field


Copyright © 2010-2016. All Rights Reserved.