Class ExpectException

  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by net.sf.jmatchparser.util.ExpectException
All Implemented Interfaces:

public class ExpectException
extends RuntimeException

This exception is thrown when an expectation fails. It tries to show useful information (like actual and expected values) in its message.

See Also:
Serialized Form

Constructor Summary
ExpectException(String actual, String expected)
          Create a new Expect exception
Method Summary
static ExpectException fromRegex(String actual, Pattern pattern)
          Create a new expect exception from a regular expression.
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail


public ExpectException(String actual,
                       String expected)
Create a new Expect exception

actual - Actual value
expected - Expected value
Method Detail


public static ExpectException fromRegex(String actual,
                                        Pattern pattern)
Create a new expect exception from a regular expression.

actual - Actual value
pattern - Pattern that should match

Copyright © 2011. All Rights Reserved.