Package junit.framework

Examples of junit.framework.AssertionFailedError.initCause()


        FsmParser p = new FsmParser(text);
        p.parse(this,Configuration.getDefaultConfiguration());
      }
      catch(IllegalArgumentException e)
      {
        Error th = new AssertionFailedError();th.initCause(e);
        throw th;
      }
      assertEquals("incorrect number of elements in the array",elements.length,i);
    }
  }
View Full Code Here


        throw err;
      } catch (Exception ex) {
        AssertionFailedError err = new AssertionFailedError(
            "Failed to escape `" + unescaped + "` with " + directiveVersion + ", got `" +
            outputCode + "`");
        err.initCause(ex);
        throw err;
      }
    }
  }
View Full Code Here

        }
        if (!expectedException.isAssignableFrom(t.getClass())) {
          // Wrap the unexpected throwable with an explicit message.
          AssertionFailedError assertionError = new AssertionFailedError("Unexpected exception, expected<" +
              expectedException.getName() + "> but was<" + t.getClass().getName() + ">");
          assertionError.initCause(t);
          throw assertionError;
        }
      }
    }
  }
View Full Code Here

        }
        if (!expectedException.isAssignableFrom(ex.getClass())) {
          // Wrap the unexpected throwable with an explicit message.
          AssertionFailedError assertionError = new AssertionFailedError("Unexpected exception, expected <"
              + expectedException.getName() + "> but was <" + ex.getClass().getName() + ">");
          assertionError.initCause(ex);
          throw assertionError;
        }
      }
    }
  }
View Full Code Here

        FsmParser p = new FsmParser(text);
        p.parse(this);
      }
      catch(IllegalArgumentException e)
      {
        Error th = new AssertionFailedError();th.initCause(e);
        throw th;
      }
      assertEquals("incorrect number of elements in the array",elements.length,i);
    }
  }
View Full Code Here

        fsmParser p = new fsmParser(text);
        p.parse(this);
      }
      catch(IllegalArgumentException e)
      {
        Error th = new AssertionFailedError();th.initCause(e);
        throw th;
      }
      assertEquals("incorrect number of elements in the array",elements.length,i);
    }
  }
View Full Code Here

        FsmParser p = new FsmParser(text);
        p.parse(this,Configuration.getDefaultConfiguration(),null);
      }
      catch(IllegalArgumentException e)
      {
        Error th = new AssertionFailedError();th.initCause(e);
        throw th;
      }
      assertEquals("incorrect number of elements in the array",elements.length,i);
    }
  }
View Full Code Here

   */
  protected void checkExceptionExpectations(Exception actualException) {
    if (!getExpectedException().isAssignableFrom(actualException.getClass())) {
      AssertionFailedError error =
          new AssertionFailedError(createMessageForWrongThrownExceptionType(actualException));
      error.initCause(actualException);
      throw error;
    }
  }

  /**
 
View Full Code Here

    mq.getMessages().clear();
    try {
      js(fromString(code));
    } catch (ParseException ex) {
      AssertionFailedError afe = new AssertionFailedError(code);
      afe.initCause(ex);
      throw afe;
    }
    try {
      assertNoErrors();
    } catch (AssertionFailedError e) {
View Full Code Here

          if (oldMessage != null) {
            msg += "\n" + exception.getMessage();
          }
          AssertionFailedError newException = new AssertionFailedError(msg);
          newException.setStackTrace(exception.getStackTrace());
          newException.initCause(exception.getCause());
          exception = newException;
        } else {
          exception = new RuntimeException(msg, exception);
        }
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.