Examples of StringDescription


Examples of org.hamcrest.StringDescription

        }
        return contextProperty;
    }

    private static <T> String descriptionOf(final Matcher<T> matcher) {
        final StringDescription stringDescription = new StringDescription();
        matcher.describeTo(stringDescription);
        final String description = stringDescription.toString();
        return description;
    }
View Full Code Here

Examples of org.hamcrest.StringDescription

   * @see org.junit.matchers.JUnitMatchers
   */
  public static <T> void assertThat(String reason, T actual,
      Matcher<T> matcher) {
    if (!matcher.matches(actual)) {
      Description description= new StringDescription();
      description.appendText(reason);
      description.appendText("\nExpected: ");
      description.appendDescriptionOf(matcher);
      description.appendText("\n     got: ");
      description.appendValue(actual);
      description.appendText("\n");
      throw new java.lang.AssertionError(description.toString());
    }
  }
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.