Package org.jmock.matcher

Source Code of org.jmock.matcher.MethodNameMatcher

/* Copyright (c) 2000-2003, jMock.org. See bundled LICENSE.txt */
package org.jmock.matcher;

import org.jmock.Constraint;
import org.jmock.constraint.IsEqual;
import org.jmock.dynamic.Invocation;

public class MethodNameMatcher
        extends StatelessInvocationMatcher {
    private Constraint constraint;

    public MethodNameMatcher(Constraint constraint) {
        this.constraint = constraint;
    }

    public MethodNameMatcher(String methodName) {
        this(new IsEqual(methodName));
    }

    public boolean matches(Invocation invocation) {
        return constraint.eval(invocation.getMethodName());
    }
}
TOP

Related Classes of org.jmock.matcher.MethodNameMatcher

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.