Package org.hamcrest

Examples of org.hamcrest.Description


    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);
            if (assertion) {
                throw new AssertionError((msg == null ? "" : msg + "\n")
                        + message.toString());
            } else {
                throw new AssumptionError((msg == null ? "" : msg + "\n")
                        + message.toString());
            }
        }
    }
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.