Package org.hamcrest

Examples of org.hamcrest.Description


    private String qualifiedMethodName() {
        return MockUtil.getMockName(mock) + "." + method.getName();
    }

    private String getArgumentsLine(List<Matcher> matchers) {
        Description result = new StringDescription();
        result.appendList("(", ", ", ");", matchers);
        return result.toString();
    }
View Full Code Here


        result.appendList("(", ", ", ");", matchers);
        return result.toString();
    }
   
    private String getArgumentsBlock(List<Matcher> matchers) {
        Description result = new StringDescription();
        result.appendList("(\n    ", ",\n    ", "\n);", matchers);
        return result.toString();
    }
View Full Code Here

    private String qualifiedMethodName() {
        return MockUtil.getMockName(mock) + "." + method.getName();
    }

    private String getArgumentsLine(List<Matcher> matchers) {
        Description result = new StringDescription();
        result.appendList("(", ", ", ");", matchers);
        return result.toString();
    }
View Full Code Here

        result.appendList("(", ", ", ");", matchers);
        return result.toString();
    }
   
    private String getArgumentsBlock(List<Matcher> matchers) {
        Description result = new StringDescription();
        result.appendList("(\n    ", ",\n    ", "\n);", matchers);
        return result.toString();
    }
View Full Code Here

@SuppressWarnings("unchecked")
public class MatchersPrinter {
   
    public String getArgumentsLine(List<Matcher> matchers, PrintSettings printSettings) {
        Description result = new StringDescription();
        result.appendList("(", ", ", ");", applyPrintSettings(matchers, printSettings));
        return result.toString();
    }
View Full Code Here

        result.appendList("(", ", ", ");", applyPrintSettings(matchers, printSettings));
        return result.toString();
    }

    public String getArgumentsBlock(List<Matcher> matchers, PrintSettings printSettings) {
        Description result = new StringDescription();
        result.appendList("(\n    ", ",\n    ", "\n);", applyPrintSettings(matchers, printSettings));
        return result.toString();
    }
View Full Code Here

    private String qualifiedMethodName() {
        return MockUtil.getMockName(mock) + "." + method.getName();
    }

    private String getArgumentsLine(List<Matcher> matchers) {
        Description result = new StringDescription();
        result.appendList("(", ", ", ");", matchers);
        return result.toString();
    }
View Full Code Here

        result.appendList("(", ", ", ");", matchers);
        return result.toString();
    }
   
    private String getArgumentsBlock(List<Matcher> matchers) {
        Description result = new StringDescription();
        result.appendList("(\n    ", ",\n    ", "\n);", matchers);
        return result.toString();
    }
View Full Code Here

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

  private <T> boolean genericThat(T actual, Matcher<? super T> matcher, Object category, String reason, Object... messageParameters) {
    if (!matcher.matches(actual)) {
          if (reason != null) {
            errors.add(i18nMessage(category, reason, messageParameters));
            } else {
                Description description = new ResourceBundleDescription();
                description.appendDescriptionOf(matcher);
                errors.add(i18nMessage(category, description.toString(), actual));
            }
            return false;
        }
        return true;
  }
View Full Code Here

TOP

Related Classes of org.hamcrest.Description

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.