Package junit.framework

Examples of junit.framework.AssertionFailedError.initCause()


      if (policy.isExpectedType(cause)) {
        return;
      }
      AssertionFailedError error = new AssertionFailedError(
          "wrong exception thrown from " + invokable + ": " + cause);
      error.initCause(cause);
      throw error;
    } catch (IllegalAccessException e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here


          try {
            nullPointerTester.testAllPublicInstanceMethods(instance);
          } catch (AssertionError e) {
            AssertionError error = new AssertionFailedError(
                "Null check failed on return value of " + factory);
            error.initCause(e);
            throw error;
          }
        }
      }
      return this;
View Full Code Here

          try {
            SerializableTester.reserialize(instance);
          } catch (RuntimeException e) {
            AssertionError error = new AssertionFailedError(
                "Serialization failed on return value of " + factory);
            error.initCause(e.getCause());
            throw error;
          }
        }
      }
      return this;
View Full Code Here

          try {
            SerializableTester.reserializeAndAssert(instance);
          } catch (RuntimeException e) {
            AssertionError error = new AssertionFailedError(
                "Serialization failed on return value of " + factory);
            error.initCause(e.getCause());
            throw error;
          } catch (AssertionFailedError e) {
            AssertionError error = new AssertionFailedError(
                "Return value of " + factory + " reserialized to an unequal value");
            error.initCause(e);
View Full Code Here

            error.initCause(e.getCause());
            throw error;
          } catch (AssertionFailedError e) {
            AssertionError error = new AssertionFailedError(
                "Return value of " + factory + " reserialized to an unequal value");
            error.initCause(e);
            throw error;
          }
        }
      }
      return this;
View Full Code Here

     * @return an AssertionFailedError
     */
    public static AssertionFailedError newAssertionFailedError(
            String message, Throwable cause) {
        AssertionFailedError e = new AssertionFailedError(message);
        e.initCause(cause);
        return e;
    }

    /**
     * assert a method from an executing test
View Full Code Here

     */
    public static void fail(String msg, Throwable t)
            throws AssertionFailedError {

        AssertionFailedError ae = new AssertionFailedError(msg);
        ae.initCause(t);
        throw ae;
    }
} // End class BaseTestCase
View Full Code Here

     */
    public static void fail(String msg, Throwable t)
            throws AssertionFailedError {

        AssertionFailedError ae = new AssertionFailedError(msg);
        ae.initCause(t);
        throw ae;
    }
   
    /**
     * assert a method from an executing test
View Full Code Here

     */
    public static void fail(String msg, Throwable t)
            throws AssertionFailedError {

        AssertionFailedError ae = new AssertionFailedError(msg);
        ae.initCause(t);
        throw ae;
    }
} // End class BaseTestCase
View Full Code Here

     */
    public static void fail(String msg, Exception e)
            throws AssertionFailedError {

        AssertionFailedError ae = new AssertionFailedError(msg);
        ae.initCause(e);
        throw ae;
    }
} // End class BaseTestCase
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.