Package org.hamcrest

Examples of org.hamcrest.StringDescription.appendText()


        super(explainTimeoutOf(condition));
    }

    private static String explainTimeoutOf(Condition condition) {
        Description description = new StringDescription();
        description.appendText("Timed out waiting until ");
        condition.describeTo(description);
        description.appendText("\n   because ");
        condition.describeDissatisfactionTo(description);
        return description.toString();
    }
View Full Code Here


    private static String explainTimeoutOf(Condition condition) {
        Description description = new StringDescription();
        description.appendText("Timed out waiting until ");
        condition.describeTo(description);
        description.appendText("\n   because ");
        condition.describeDissatisfactionTo(description);
        return description.toString();
    }
}
View Full Code Here

        return matcher.matches(listenersText);
      }

      public String getFailureMessage() {
        Description description = new StringDescription();
        description.appendText("\nExpected:\n").appendDescriptionOf(matcher).appendText("\ngot:\n").appendValue(text).appendText("\n");
        return description.toString();
      }
    });
  }
View Full Code Here

    }
   
    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: ");
            matcher.describeTo(description);
            description.appendText("\n     got: ").appendValue(actual).appendText("\n");
            throw new java.lang.AssertionError(description.toString());
        }
View Full Code Here

   
    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: ");
            matcher.describeTo(description);
            description.appendText("\n     got: ").appendValue(actual).appendText("\n");
            throw new java.lang.AssertionError(description.toString());
        }
    }
View Full Code Here

        if (!matcher.matches(actual)) {
            Description description = new StringDescription();
            description.appendText(reason);
            description.appendText("\nExpected: ");
            matcher.describeTo(description);
            description.appendText("\n     got: ").appendValue(actual).appendText("\n");
            throw new java.lang.AssertionError(description.toString());
        }
    }
}
View Full Code Here

    private final String msg;

    @Override
    public void is(Matcher<? super T> matching) {
        Description message = new StringDescription();
        message.appendText("expecting ");
        matching.describeTo(message);
        message.appendText(" but ");
        T obj = provider.get();
        if (!matching.matches(obj)) {
            matching.describeMismatch(obj, message);
View Full Code Here

    @Override
    public void is(Matcher<? super T> matching) {
        Description message = new StringDescription();
        message.appendText("expecting ");
        matching.describeTo(message);
        message.appendText(" but ");
        T obj = provider.get();
        if (!matching.matches(obj)) {
            matching.describeMismatch(obj, message);
            if (assertion) {
                throw new AssertionError((msg == null ? "" : msg + "\n")
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.