How to use method of org.jmock.internal.matcher.ParametersMatcher class

Best Jmock-library code snippet using org.jmock.internal.matcher.ParametersMatcher.

Run Jmock-library automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

copy
1package org.jmock.internal.matcher;
2
3import java.util.List;
4
5import org.hamcrest.Matcher;
6import org.hamcrest.collection.IsArray;
7import org.hamcrest.core.IsEqual;
8
9public class ParametersMatcher extends IsArray<Object> {
10    public ParametersMatcher(Object[] expectedValues) {
11        super(equalMatchersFor(expectedValues));
12    }
13    
14    @SuppressWarnings("unchecked")
15    private static Matcher<Object>[] equalMatchersFor(Object[] expectedValues) {
16        Matcher<Object>[] matchers = new Matcher[expectedValues.length];
17        for (int i = 0; i < expectedValues.length; i++) {
18            matchers[i] = new IsEqual<Object>(expectedValues[i]);
19        }
20        return matchers;
21    }
22    
23    @SuppressWarnings("unchecked")
24    public ParametersMatcher(List<Matcher<?>> parameterMatchers) {
25        super(parameterMatchers.toArray(new Matcher[0]));
26    }
27
28    @Override
29    protected String descriptionStart() {
30        return "(";
31    }
32    
33    @Override
34    protected String descriptionEnd() {
35        return ")";
36    }
37}
38
Full Screen

Accelerate Your Automation Test Cycles With LambdaTest

Leverage LambdaTest’s cloud-based platform to execute your automation tests in parallel and trim down your test execution time significantly. Your first 100 automation testing minutes are on us.

Try LambdaTest

Trigger code on LambdaTest Cloud Grid

Execute automation tests with on a cloud-based Grid of 3000+ real browsers and operating systems for both web and mobile applications.

Test now for Free
LambdaTestX

We use cookies to give you the best experience. Cookies help to provide a more personalized experience and relevant advertising for you, and web analytics for us. Learn More in our Cookies policy, Privacy & Terms of service

Allow Cookie
Sarah

I hope you find the best code examples for your project.

If you want to accelerate automated browser testing, try LambdaTest. Your first 100 automation testing minutes are FREE.

Sarah Elson (Product & Growth Lead)