Package junit.framework

Examples of junit.framework.AssertionFailedError.initCause()


        throw afe;
    }

    public static Error failure(Throwable t) {
        AssertionFailedError afe = new AssertionFailedError();
        afe.initCause(t);
        return afe;
    }

    public static Error failure(String msg, Throwable t) {
        AssertionFailedError afe = new AssertionFailedError(msg);
View Full Code Here


        return afe;
    }

    public static Error failure(String msg, Throwable t) {
        AssertionFailedError afe = new AssertionFailedError(msg);
        afe.initCause(t);
        return afe;
    }
}
View Full Code Here

            // Boot the container, this will associate the current thread with the portal container
            this.container = PortalContainer.getInstance();
        } catch (Exception e) {
            AssertionFailedError afe = new AssertionFailedError();
            afe.initCause(e);
            throw afe;
        } finally {
            Thread.currentThread().setContextClassLoader(realClassLoader);
        }
    }
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;
    }
   
    /**
     * assert a method from an executing test
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 (!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

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.