com.googlecode.catchexception.throwable.apis.internal.hamcrest
Class ThrowableMessageMatcher<T extends Throwable>

java.lang.Object
  extended by org.hamcrest.BaseMatcher<T>
      extended by com.googlecode.catchexception.throwable.apis.internal.hamcrest.ThrowableMessageMatcher<T>
Type Parameters:
T - an throwable subclass
All Implemented Interfaces:
org.hamcrest.Matcher<T>, org.hamcrest.SelfDescribing

public class ThrowableMessageMatcher<T extends Throwable>
extends org.hamcrest.BaseMatcher<T>

Creates a matcher that matches an throwable with a certain message.

Author:
rwoo

Field Summary
private  org.hamcrest.Matcher<String> expectedMessageMatcher
          The string matcher that shall match throwable message.
 
Constructor Summary
ThrowableMessageMatcher(org.hamcrest.Matcher<String> expectedMessageMatcher)
           
ThrowableMessageMatcher(String expectedMessage)
           
 
Method Summary
 void describeTo(org.hamcrest.Description description)
           
 boolean matches(Object obj)
           
 
Methods inherited from class org.hamcrest.BaseMatcher
_dont_implement_Matcher___instead_extend_BaseMatcher_, describeMismatch, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

expectedMessageMatcher

private org.hamcrest.Matcher<String> expectedMessageMatcher
The string matcher that shall match throwable message.

Constructor Detail

ThrowableMessageMatcher

public ThrowableMessageMatcher(String expectedMessage)
Parameters:
expectedMessage - the expected throwable message

ThrowableMessageMatcher

public ThrowableMessageMatcher(org.hamcrest.Matcher<String> expectedMessageMatcher)
Parameters:
expectedMessageMatcher - a string matcher that shall match the throwable message
Method Detail

matches

public boolean matches(Object obj)

describeTo

public void describeTo(org.hamcrest.Description description)


Copyright © 2015. All rights reserved.