org.ikasan.framework.exception.matching
Class ThrowableCauseMatcher

java.lang.Object
  extended by org.hamcrest.BaseMatcher<T>
      extended by org.hamcrest.TypeSafeMatcher<Throwable>
          extended by org.ikasan.framework.exception.matching.ThrowableCauseMatcher
All Implemented Interfaces:
org.hamcrest.Matcher<Throwable>, org.hamcrest.SelfDescribing

public class ThrowableCauseMatcher
extends org.hamcrest.TypeSafeMatcher<Throwable>

Implementation of TypeSafeMatcher for matching instances of Throwable by considering the cause of the Throwable When passed a throwable for matching, this implementation will apply another matcher to both that throwable and its cause. If the 'directly' flag is set to false, then it will also continue recursively up the cause stace of the throwable looking for a match

Author:
Ikasan Development Team

Constructor Summary
ThrowableCauseMatcher(org.hamcrest.Matcher<?> causeMatcher)
          Constructor
ThrowableCauseMatcher(org.hamcrest.Matcher<?> causeMatcher, boolean directly)
          Constructor
 
Method Summary
 void describeTo(org.hamcrest.Description description)
           
 boolean matchesSafely(Throwable throwable)
           
 
Methods inherited from class org.hamcrest.TypeSafeMatcher
matches
 
Methods inherited from class org.hamcrest.BaseMatcher
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ThrowableCauseMatcher

public ThrowableCauseMatcher(org.hamcrest.Matcher<?> causeMatcher,
                             boolean directly)
Constructor

Parameters:
causeMatcher -
directly -

ThrowableCauseMatcher

public ThrowableCauseMatcher(org.hamcrest.Matcher<?> causeMatcher)
Constructor

Parameters:
causeMatcher -
Method Detail

matchesSafely

public boolean matchesSafely(Throwable throwable)
Specified by:
matchesSafely in class org.hamcrest.TypeSafeMatcher<Throwable>

describeTo

public void describeTo(org.hamcrest.Description description)


Copyright © 2007-2012 Ikasan. All Rights Reserved.