Package junit.framework

Examples of junit.framework.AssertionFailedError.initCause()


        else if (t instanceof Error)
            throw (Error) t;
        else {
            AssertionFailedError afe =
                    new AssertionFailedError("unexpected exception: " + t);
            afe.initCause(t);
            throw afe;
        }
    }

    /**
 
View Full Code Here


        try {
            delay(millis);
        } catch (InterruptedException ie) {
            AssertionFailedError afe =
                    new AssertionFailedError("Unexpected InterruptedException");
            afe.initCause(ie);
            throw afe;
        }
    }

    /**
 
View Full Code Here

                if (!expectedExceptionClass.isInstance(t)) {
                    AssertionFailedError afe =
                            new AssertionFailedError
                                    ("Expected " + expectedExceptionClass.getName() +
                                            ", got " + t.getClass().getName());
                    afe.initCause(t);
                    threadUnexpectedException(afe);
                }
            }
            if (!threw)
                shouldThrow(expectedExceptionClass.getName());
View Full Code Here

            } catch (TimeoutException e) {
                throw new AssertionFailedError("timed out");
            } catch (Exception e) {
                AssertionFailedError afe =
                        new AssertionFailedError("Unexpected exception: " + e);
                afe.initCause(e);
                throw afe;
            }
        }
    }
}
View Full Code Here

        }
      }
      final AssertionFailedError err = new AssertionFailedError(
          b.toString());
      if (lastCause != null) {
        err.initCause(lastCause);
      }
      throw err;
    }
  }
View Full Code Here

      if (expected[i].equals(methodName)) {
        continue;
      }
      AssertionFailedError e = new AssertionFailedError("Incorrect frame at " + i + " - "
          + " Expected: " + expected[i] + " Actual: " + methodName);
      e.initCause(t);
      throw e;
    }
  }
}
View Full Code Here

        new AsyncCallback() {
          @Override
          public void onFailure(Throwable caught) {
            AssertionFailedError er = new AssertionFailedError(
                "Class UnserializableClass should be serializable because it has a custom field serializer");
            er.initCause(caught);
            throw er;
          }

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

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

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

        new AsyncCallback() {
          @Override
          public void onFailure(Throwable caught) {
            AssertionFailedError er = new AssertionFailedError(
                "Class SerializableSubclass should be serializable automatically");
            er.initCause(caught);
            throw er;
          }

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

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

          @Override
          public void onSuccess(TypeCheckedFieldClass<Integer, String> result) {
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.