Package junit.framework

Examples of junit.framework.AssertionFailedError.initCause()


         return (StringPageListAccess)ois.readObject();
      }
      catch (Exception e)
      {
         AssertionFailedError afe = new AssertionFailedError();
         afe.initCause(e);
         throw afe;
      }
   }
}
View Full Code Here


         // Report error as a junit assertion failure
         if (failure != null)
         {
            AssertionFailedError err = new AssertionFailedError();
            err.initCause(failure);
            throw err;
         }
      }

      protected final void saveMOP()
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 <K, V> Comparator<Entry<K, V>> entryComparator(
      final Comparator<? super K> keyComparator) {
View Full Code Here

        StringWriter out = new StringWriter();
        try {
            f.printTo(out, dt);
        } catch (IOException ex) {
            AssertionFailedError failure = new AssertionFailedError();
            failure.initCause(ex);
            throw failure;
        }
        assertEquals(expected, out.toString());
    }
View Full Code Here

            catch ( final AssertionFailedError err )
            {
                final String message =
                    "MockControl: " + control + " of: " + control.getMock() + " failed.\n" + err.getMessage();
                final AssertionFailedError e = new AssertionFailedError( message );
                e.initCause( err );

                throw 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

     */
    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

          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

        throw failure(msg, t);
    }

    public static void fail(Throwable t) {
        AssertionFailedError afe = new AssertionFailedError();
        afe.initCause(t);
        throw afe;
    }

    public static Error failure(Throwable t) {
        AssertionFailedError afe = new AssertionFailedError();
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.