本文整理了Java中org.easymock.EasyMock.matches()
方法的一些代码示例,展示了EasyMock.matches()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。EasyMock.matches()
方法的具体详情如下:
包路径:org.easymock.EasyMock
类名称:EasyMock
方法名:matches
[英]Expects a string that matches the given regular expression. For details, see the EasyMock documentation.
[中]需要与给定正则表达式匹配的字符串。有关详细信息,请参阅EasyMock文档。
代码示例来源:origin: iipc/openwayback
protected void setupRequest(String requestURI) {
request = EasyMock.createNiceMock(HttpServletRequest.class);
EasyMock.expect(request.getHeader(EasyMock.matches("(?i)"+MementoUtils.ACCEPT_DATETIME))).andStubReturn(acceptDatetime);
EasyMock.expect(request.getHeader(EasyMock.matches("(?i)accept-timestamp"))).andStubReturn(acceptTimestamp);
EasyMock.expect(request.getAttribute(RequestMapper.REQUEST_CONTEXT_PREFIX)).andStubReturn(null);
EasyMock.expect(request.getRequestURI()).andStubReturn(requestURI);
EasyMock.expect(request.getQueryString()).andStubReturn(null);
}
代码示例来源:origin: spring-projects/spring-webflow
public final void testRender() throws IOException {
EasyMock.expect(this.flashScope.put(EasyMock.matches(FlowFacesContext.RENDER_RESPONSE_KEY), EasyMock.anyObject()))
.andStubReturn(null);
EasyMock.replay(this.context, this.flowExecutionContext, this.flowMap, this.flashScope);
this.view.render();
}
代码示例来源:origin: spring-projects/spring-webflow
public final void testRenderException() {
EasyMock.expect(this.flashScope.put(EasyMock.matches(FlowFacesContext.RENDER_RESPONSE_KEY), EasyMock.anyObject()))
.andStubReturn(null);
EasyMock.replay(this.context, this.flowExecutionContext, this.flowMap, this.flashScope);
this.jsfMock.application().setViewHandler(new ExceptionalViewHandler());
try {
this.view.render();
} catch (Exception ex) {
}
}
代码示例来源:origin: iipc/openwayback
response.setHeader(EasyMock.matches("(?i)location"),
EasyMock.eq("/2604/20140101000000/http://example.com/"));
response.setHeader(EasyMock.matches("(?i)link"), EasyMock.<String>notNull());
EasyMock.expect(response.getWriter()).andReturn(new PrintWriter(new StringWriter()));
代码示例来源:origin: iipc/openwayback
response.setHeader(cut.getGuessedCharsetHeader(), "UTF-8");
response.setHeader("Content-Type", "text/html");
response.setHeader(EasyMock.matches("X-Archive-Orig-.*"), EasyMock.<String>notNull());
EasyMock.expectLastCall().anyTimes();
代码示例来源:origin: spring-projects/spring-webflow
/**
* View already exists in view scope and must be restored and the lifecycle executed, no event signaled
*/
public final void testProcessUserEvent_Restored_NoEvent() {
EasyMock.expect(this.flashScope.getBoolean(EasyMock.matches(FlowFacesContext.RENDER_RESPONSE_KEY))).andStubReturn(
false);
EasyMock.expect(this.flashScope.put(EasyMock.matches(FlowFacesContext.RENDER_RESPONSE_KEY), EasyMock.anyObject()))
.andStubReturn(null);
Lifecycle lifecycle = new NoEventLifecycle(this.jsfMock.lifecycle());
UIViewRoot existingRoot = new UIViewRoot();
existingRoot.setViewId(VIEW_ID);
EasyMock.replay(this.context, this.flowExecutionContext, this.flowMap, this.flashScope);
JsfView restoredView = new JsfView(existingRoot, lifecycle, this.context);
restoredView.processUserEvent();
assertFalse("An unexpected event was signaled,", restoredView.hasFlowEvent());
assertTrue("The lifecycle should have been invoked", ((NoEventLifecycle) lifecycle).executed);
}
代码示例来源:origin: iipc/openwayback
EasyMock.expect(response.getOutputStream()).andReturn(servletOutput);
response.setHeader("Content-Type", "text/html");
response.setHeader(EasyMock.eq("Location"), EasyMock.matches("/web/" + captureTimestamp + "/" + location));
代码示例来源:origin: spring-projects/spring-webflow
/**
* View already exists in view scope and must be restored and the lifecycle executed, an event is signaled
*/
public final void testProcessUserEvent_Restored_EventSignaled() {
EasyMock.expect(this.flashScope.getBoolean(EasyMock.matches(FlowFacesContext.RENDER_RESPONSE_KEY))).andStubReturn(
false);
EasyMock.expect(this.flashScope.put(EasyMock.matches(FlowFacesContext.RENDER_RESPONSE_KEY), EasyMock.anyObject()))
.andStubReturn(null);
Lifecycle lifecycle = new EventSignalingLifecycle(this.jsfMock.lifecycle());
UIViewRoot existingRoot = new UIViewRoot();
existingRoot.setViewId(VIEW_ID);
EasyMock.replay(this.context, this.flowExecutionContext, this.flowMap, this.flashScope);
JsfView restoredView = new JsfView(existingRoot, lifecycle, this.context);
restoredView.processUserEvent();
assertTrue("No event was signaled,", restoredView.hasFlowEvent());
assertEquals("Event should be " + this.event, this.event, restoredView.getFlowEvent().getId());
assertTrue("The lifecycle should have been invoked", ((EventSignalingLifecycle) lifecycle).executed);
}
代码示例来源:origin: iipc/openwayback
httpResponse.setStatus(403);
EasyMock.expectLastCall().once();
httpResponse.setHeader(EasyMock.eq(HttpCDXWriter.RUNTIME_ERROR_HEADER), EasyMock.matches("(?i).*Robot.*"));
代码示例来源:origin: iipc/openwayback
EasyMock.expect(request.getHeader(EasyMock.matches("(?i)range$")))
.andStubReturn(range);
EasyMock.expect(response.getOutputStream()).andReturn(servletOutput);
Capture<String> contentRange = new Capture<String>(CaptureType.FIRST);
response.setHeader(EasyMock.matches("(?i)content-range$"),
EasyMock.capture(contentRange));
EasyMock.expectLastCall().once();
Capture<String> contentLength = new Capture<String>(CaptureType.FIRST);
response.setHeader(EasyMock.matches("(?i)content-length$"),
EasyMock.capture(contentLength));
EasyMock.expectLastCall().once();
代码示例来源:origin: iipc/openwayback
response.setHeader(TextReplayRenderer.GUESSED_CHARSET_HEADER, "UTF-8");
response.setHeader("Content-Type", "text/html");
response.setHeader(EasyMock.matches("X-Archive-Orig-.*"), EasyMock.<String>notNull());
EasyMock.expectLastCall().anyTimes();
代码示例来源:origin: iipc/openwayback
EasyMock.expect(request.getHeader(EasyMock.matches("(?i)range$")))
.andStubReturn(range);
EasyMock.expect(response.getOutputStream()).andReturn(servletOutput);
Capture<String> contentRange = new Capture<String>(CaptureType.FIRST);
response.setHeader(EasyMock.matches("(?i)content-range$"),
EasyMock.capture(contentRange));
EasyMock.expectLastCall().once();
Capture<String> contentLength = new Capture<String>(CaptureType.FIRST);
response.setHeader(EasyMock.matches("(?i)content-length$"),
EasyMock.capture(contentLength));
EasyMock.expectLastCall().once();
代码示例来源:origin: iipc/openwayback
EasyMock.expect(request.getHeader(EasyMock.matches("(?i)range$")))
.andStubReturn(range);
EasyMock.expect(response.getOutputStream()).andReturn(servletOutput);
Capture<String> contentRange = new Capture<String>(CaptureType.FIRST);
response.setHeader(EasyMock.matches("(?i)content-range$"),
EasyMock.capture(contentRange));
EasyMock.expectLastCall().once();
Capture<String> contentLength = new Capture<String>(CaptureType.FIRST);
response.setHeader(EasyMock.matches("(?i)content-length$"),
EasyMock.capture(contentLength));
EasyMock.expectLastCall().once();
代码示例来源:origin: iipc/openwayback
EasyMock.expect(request.getHeader(EasyMock.matches("(?i)range$")))
.andStubReturn(range);
EasyMock.expect(response.getOutputStream()).andReturn(servletOutput);
Capture<String> contentRange = new Capture<String>(CaptureType.FIRST);
response.setHeader(EasyMock.matches("(?i)content-range$"),
EasyMock.capture(contentRange));
EasyMock.expectLastCall().once();
Capture<String> contentLength = new Capture<String>(CaptureType.FIRST);
response.setHeader(EasyMock.matches("(?i)content-length$"),
EasyMock.capture(contentLength));
EasyMock.expectLastCall().once();
代码示例来源:origin: iipc/openwayback
response.setHeader(TextReplayRenderer.GUESSED_CHARSET_HEADER, "UTF-8");
response.setHeader("Content-Type", "text/html");
response.setHeader(EasyMock.matches("X-Archive-Orig-.*"), EasyMock.<String>notNull());
EasyMock.expectLastCall().anyTimes();
代码示例来源:origin: OpenNMS/opennms
m_rrdStrategy.updateFile(isA(Object.class), isA(String.class), matches(".*:" + matchValue));
m_rrdStrategy.closeFile(isA(Object.class));
内容来源于网络,如有侵权,请联系作者删除!