Package junit.framework

Examples of junit.framework.AssertionFailedError.initCause()


        new AsyncCallback<TypeCheckedNestedLists>() {
          @Override
          public void onFailure(Throwable caught) {
            AssertionFailedError er =
                new AssertionFailedError("Could not serialize/deserialize TypeCheckedNestedLists");
            er.initCause(caught);
            throw er;
          }

          @Override
          public void onSuccess(TypeCheckedNestedLists result) {
View Full Code Here


        new AsyncCallback<TypeCheckedGenericClass<Integer, String>>() {
          @Override
          public void onFailure(Throwable caught) {
            AssertionFailedError er =
                new AssertionFailedError("Could not serialize/deserialize TypeCheckedGenericClass");
            er.initCause(caught);
            throw er;
          }

          @Override
          public void onSuccess(TypeCheckedGenericClass<Integer, String> result) {
View Full Code Here

        new AsyncCallback<TypeCheckedSuperClass<Integer, String>>() {
          @Override
          public void onFailure(Throwable caught) {
            AssertionFailedError er =
                new AssertionFailedError("Could not serialize/deserialize TypeCheckedGenericClass");
            er.initCause(caught);
            throw er;
          }

          @Override
          public void onSuccess(TypeCheckedSuperClass<Integer, String> result) {
View Full Code Here

        new AsyncCallback<TypeUncheckedGenericClass<Integer, String>>() {
          @Override
          public void onFailure(Throwable caught) {
            AssertionFailedError er =
                new AssertionFailedError("Could not serialize/deserialize TypeUncheckedGenericClass");
            er.initCause(caught);
            throw er;
          }

          @Override
          public void onSuccess(TypeUncheckedGenericClass<Integer, String> result) {
View Full Code Here

    if (Math.abs(Math.random()) < 0) return; // Dummy code to prevent inlining

    // the next line should be LINE_NUMBER_1
    AssertionFailedError exception = new AssertionFailedError("stack_trace_msg");
    if (withCause) {
      exception.initCause(new RuntimeException("the_cause"));
    }
    throw exception;
  }

  private static void assertStackTrace(
View Full Code Here

      annotation.withAsserter().newInstance().assertException(annotation, t);
    } catch (AssertionFailedError e) {
      String msg = "Assertion failed for thrown exception: " + e.getMessage()
          + "\n(Actual thrown exception is reported below via 'caused by')";
      AssertionFailedError errorToReport = new AssertionFailedError(msg);
      errorToReport.initCause(t);
      errorToReport.setStackTrace(e.getStackTrace());
      super.addFailure(test, errorToReport);
    } catch (Exception e) {
      super.addError(test, e);
    }
View Full Code Here

  }

  static void fail(Throwable cause, Object message) {
    AssertionFailedError assertionFailedError =
        new AssertionFailedError(String.valueOf(message));
    assertionFailedError.initCause(cause);
    throw assertionFailedError;
  }

  public static <T> void testComparator(
      Comparator<? super T> comparator, T... valuesInExpectedOrder) {
View Full Code Here

        {
            if (!failureExpected)
            {
                AssertionFailedError error = new AssertionFailedError("parsing of " + idlFile.getName()
                        + " failed: " + writer.toString());
                error.initCause(e);
                throw error;
            }
        }

        TestUtils.log("[" + idlFile.getName() + " output]:\n" + writer.toString());
View Full Code Here

        catch (Exception e)
        {
            if (!failureExpected)
            {
                AssertionFailedError error = new AssertionFailedError("cmd: " + cmd);
                error.initCause(e);
                throw error;
            }
            else
            {
                return null;
View Full Code Here

      }
    }
    AssertionFailedError failure =
        new AssertionFailedError("Expected element " + clazz + "." + method
            + " not found in stack trace");
    failure.initCause(e);
    throw failure;
  }

  private ExecutionException getExpectingExecutionException(
      AbstractFuture<String> future) throws InterruptedException {
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.