本文整理了Java中org.easymock.EasyMock.createStrictControl()
方法的一些代码示例,展示了EasyMock.createStrictControl()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。EasyMock.createStrictControl()
方法的具体详情如下:
包路径:org.easymock.EasyMock
类名称:EasyMock
方法名:createStrictControl
[英]Creates a control, order checking is enabled by default.
[中]创建控件,默认情况下启用订单检查。
代码示例来源:origin: org.easymock/easymock
/**
* Creates a control, order checking is enabled by default.
*
* @return the control.
*/
public IMocksControl createStrictControl() {
IMocksControl ctrl = EasyMock.createStrictControl();
controls.add(ctrl);
return ctrl;
}
代码示例来源:origin: org.easymock/easymock
/**
* Creates a mock object that implements the given interface, order checking
* is enabled by default.
*
* @param toMock
* the class or interface that should be mocked.
* @param <T>
* the interface that the mock object should implement. It is expected to be of
* class {@code toMock}.
* @return the mock object.
*
* @since 3.4
*/
public static <T> T strictMock(Class<?> toMock) {
return createStrictControl().mock(toMock);
}
代码示例来源:origin: org.easymock/easymock
/**
* Creates a mock object that implements the given interface, order checking
* is enabled by default.
*
* @param name
* the name of the mock object.
* @param toMock
* the class or interface that should be mocked.
* @param <T>
* the interface that the mock object should implement. It is expected to be of
* class {@code toMock}.
* @return the mock object.
* @throws IllegalArgumentException
* if the name is not a valid Java identifier.
*
* @since 3.4
*/
public static <T> T strictMock(String name, Class<?> toMock) {
return createStrictControl().mock(name, toMock);
}
代码示例来源:origin: org.easymock/easymock
public <R> R createStrictMock(String name) {
IMocksControl control = (support == null ? EasyMock.createStrictControl() : support
.createStrictControl());
return createMock(name, control);
}
代码示例来源:origin: thinkaurelius/titan
ctrl = EasyMock.createStrictControl();
ctrl.checkOrder(true);
代码示例来源:origin: apache/shiro
IMocksControl ctrl = createStrictControl();
代码示例来源:origin: JanusGraph/janusgraph
ctrl = EasyMock.createStrictControl();
ctrl.checkOrder(true);
代码示例来源:origin: apache/shiro
@Test
public void testDoFilter() throws Exception {
IMocksControl ctrl = createStrictControl();
FilterChain originalChain = ctrl.createMock(FilterChain.class);
Filter filter1 = ctrl.createMock("filter1", Filter.class);
Filter filter2 = ctrl.createMock("filter2", Filter.class);
ServletRequest request = ctrl.createMock(ServletRequest.class);
ServletResponse response = ctrl.createMock(ServletResponse.class);
Capture<FilterChain> fc1 = new Capture<FilterChain>();
Capture<FilterChain> fc2 = new Capture<FilterChain>();
filter1.doFilter(same(request), same(response), and(anyObject(FilterChain.class), capture(fc1)));
filter2.doFilter(same(request), same(response), and(anyObject(FilterChain.class), capture(fc2)));
originalChain.doFilter(request, response);
ctrl.replay();
SimpleFilterChain underTest = new SimpleFilterChain(originalChain, Arrays.asList(filter1, filter2).iterator());
// all we actually care about is that, if we keep calling the filter chain, everything is called in the right
// order - we don't care what fc actually contains
underTest.doFilter(request, response);
fc1.getValue().doFilter(request, response);
fc2.getValue().doFilter(request, response);
ctrl.verify();
}
}
代码示例来源:origin: org.easymock/com.springsource.org.easymock
/**
* Creates a control, order checking is enabled by default.
*
* @return the control.
*/
public IMocksControl createStrictControl() {
IMocksControl ctrl = EasyMock.createStrictControl();
controls.add(ctrl);
return ctrl;
}
代码示例来源:origin: easymock/easymock
/**
* Creates a mock object that implements the given interface, order checking
* is enabled by default.
*
* @param <T>
* the interface that the mock object should implement.
* @param toMock
* the class of the interface that the mock object should
* implement.
* @return the mock object.
*/
public static <T> T createStrictMock(Class<T> toMock) {
return createStrictControl().createMock(toMock);
}
代码示例来源:origin: easymock/easymock
/**
* Creates a mock control object for the specified interface. The
* <code>MockControl</code> and its associated mock object will check the
* order of expected method calls. An unexpected method call on the mock
* object will lead to an <code>AssertionError</code>.
*
* @param toMock
* the class of the interface to mock.
* @return the mock control.
*/
public static <T> MockControl<T> createStrictControl(Class<T> toMock) {
return new MockControl<T>(
(MocksControl) EasyMock.createStrictControl(), toMock);
}
代码示例来源:origin: org.easymock/com.springsource.org.easymock
/**
* Creates a mock object that implements the given interface, order checking
* is enabled by default.
*
* @param <T>
* the interface that the mock object should implement.
* @param toMock
* the class of the interface that the mock object should
* implement.
* @return the mock object.
*/
public static <T> T createStrictMock(Class<T> toMock) {
return createStrictControl().createMock(toMock);
}
代码示例来源:origin: org.easymock/com.springsource.org.easymock
/**
* Creates a mock control object for the specified interface. The
* <code>MockControl</code> and its associated mock object will check the
* order of expected method calls. An unexpected method call on the mock
* object will lead to an <code>AssertionError</code>.
*
* @param <T> type of the mock controlled
* @param toMock
* the class of the interface to mock.
* @return the mock control.
*/
public static <T> MockControl<T> createStrictControl(Class<T> toMock) {
return new MockControl<T>(
(MocksControl) EasyMock.createStrictControl(), toMock);
}
代码示例来源:origin: org.easymock/com.springsource.org.easymock
/**
* Creates a mock object that implements the given interface, order checking
* is enabled by default.
* @param name the name of the mock object.
* @param toMock
* the class of the interface that the mock object should
* implement.
* @param <T>
* the interface that the mock object should implement.
* @return the mock object.
* @throws IllegalArgumentException if the name is not a valid Java identifier.
*/
public static <T> T createStrictMock(String name, Class<T> toMock) {
return createStrictControl().createMock(name, toMock);
}
代码示例来源:origin: org.apache.shindig/shindig-gadgets
@Before
public void setUp() throws Exception {
control = EasyMock.createStrictControl();
preloader = control.createMock(PipelinedDataPreloader.class);
preloaderService = new ConcurrentPreloaderService(Executors.newSingleThreadExecutor(), null);
executor = new PipelineExecutor(preloader, preloaderService, Expressions.forTesting());
context = new GadgetContext(){};
}
代码示例来源:origin: org.wso2.org.apache.shindig/shindig-gadgets
@Before
public void setUp() throws Exception {
control = EasyMock.createStrictControl();
preloader = control.createMock(PipelinedDataPreloader.class);
preloaderService = new ConcurrentPreloaderService(Executors.newSingleThreadExecutor(), null);
executor = new PipelineExecutor(preloader, preloaderService, Expressions.forTesting());
context = new GadgetContext(){};
}
代码示例来源:origin: com.lmco.shindig/shindig-gadgets
@Before
public void setUp() throws Exception {
control = EasyMock.createStrictControl();
preloader = control.createMock(PipelinedDataPreloader.class);
preloaderService = new ConcurrentPreloaderService(Executors.newSingleThreadExecutor(), null);
executor = new PipelineExecutor(preloader, preloaderService, Expressions.forTesting());
context = new GadgetContext(){};
}
代码示例来源:origin: org.wso2.org.apache.shindig/shindig-gadgets
@Before
public void setUp() throws Exception {
control = EasyMock.createStrictControl();
preloader = control.createMock(PipelinedDataPreloader.class);
preloaderService = new ConcurrentPreloaderService(Executors.newSingleThreadExecutor(), null);
rewriter = new PipelineDataGadgetRewriter(new PipelineExecutor(preloader, preloaderService,
Expressions.forTesting()));
}
代码示例来源:origin: com.lmco.shindig/shindig-gadgets
@Before
public void setUp() throws Exception {
control = EasyMock.createStrictControl();
preloader = control.createMock(PipelinedDataPreloader.class);
preloaderService = new ConcurrentPreloaderService(Executors.newSingleThreadExecutor(), null);
rewriter = new PipelineDataGadgetRewriter(new PipelineExecutor(preloader, preloaderService,
Expressions.forTesting()));
}
代码示例来源:origin: org.apache.shindig/shindig-gadgets
@Before
public void setUp() throws Exception {
control = EasyMock.createStrictControl();
preloader = control.createMock(PipelinedDataPreloader.class);
preloaderService = new ConcurrentPreloaderService(Executors.newSingleThreadExecutor(), null);
rewriter = new PipelineDataGadgetRewriter(new PipelineExecutor(preloader, preloaderService,
Expressions.forTesting()));
}
内容来源于网络,如有侵权,请联系作者删除!