Package org.fest.assertions.error

Examples of org.fest.assertions.error.BasicErrorMessageFactory


      Description d = gwtInfo.superDescription();
      String newDescription = d != null ? d.value() : this.actual.getClass().getSimpleName();
      info.description(newDescription);

      return failures.failure(info, new BasicErrorMessageFactory(format, arguments));
   }
View Full Code Here


   * @throws AssertionError if the given objects do not refer to the same instance.
   */
  public void assertSame(Description description, Object actual, Object expected) {
    if (actual != expected) {
      String format = "expected:<%s> and actual:<%s> should refer to the same instance";
      throw failures.failure(description, new BasicErrorMessageFactory(format, expected, actual));
    }
  }
View Full Code Here

   * @throws AssertionError if the given objects refer to the same instance.
   */
  public void assertNotSame(Description description, Object actual, Object other) {
    if (actual == other) {
      String format = "expected not same:<%s>";
      throw failures.failure(description, new BasicErrorMessageFactory(format, actual));
    }
  }
View Full Code Here

  public void assertIsInstanceOf(Description description, Object actual, Class<?> type) {
    checkNotNull(type);
    assertNotNull(description, actual);
    if (!type.isInstance(actual)) {
      String format = "expecting <%s> to be an instance of:<%s> but was instance of:<%s>";
      throw failures.failure(description, new BasicErrorMessageFactory(format, actual, type, actual.getClass()));
    }
  }
View Full Code Here

   */
  public void assertIsNotInstanceOf(Description description, Object actual, Class<?> type) {
    checkNotNull(type);
    if (type.isInstance(actual)) {
      String format = "expecting <%s> not to be an instance of:<%s>";
      throw failures.failure(description, new BasicErrorMessageFactory(format, actual, type));
    }
  }
View Full Code Here

  public void assertIsInstanceOfAny(Description description, Object actual, Class<?>[] types) {
    checkNotNullOrEmpty(types);
    assertNotNull(description, actual);
    if (!isInstanceOfAny(actual, types)) {
      String format = "expecting <%s> to be an instance of any of:<%s> but was instance of:<%s>";
      throw failures.failure(description, new BasicErrorMessageFactory(format, actual, types, actual.getClass()));
    }
  }
View Full Code Here

   */
  public void assertIsNotInstanceOfAny(Description description, Object actual, Class<?>[] types) {
    checkNotNullOrEmpty(types);
    if (isInstanceOfAny(actual, types)) {
      String format = "expecting <%s> not to be an instance of any of:<%s>";
      throw failures.failure(description, new BasicErrorMessageFactory(format, actual, types));
    }
  }
View Full Code Here

   */
  public void assertExists(Description description, File actual) {
    assertNotNull(description, actual);
    if (!actual.exists()) {
      String format = "expecting resource in path:<%s> to exist";
      throw failures.failure(description, new BasicErrorMessageFactory(format, actual));
    }
  }
View Full Code Here

   */
  public void assertDoesNotExist(Description description, File actual) {
    assertNotNull(description, actual);
    if (actual.exists()) {
      String format = "expecting resource in path:<%s> not to exist";
      throw failures.failure(description, new BasicErrorMessageFactory(format, actual));
    }
  }
View Full Code Here

   */
  public void assertIsFile(Description description, File actual) {
    assertNotNull(description, actual);
    if (!actual.isFile()) {
      String format = "expecting path:<%s> to represent an existing file";
      throw failures.failure(description, new BasicErrorMessageFactory(format, actual));
    }
  }
View Full Code Here

TOP

Related Classes of org.fest.assertions.error.BasicErrorMessageFactory

Copyright © 2018 www.massapicom. 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.