本文整理汇总了Java中org.springframework.extensions.webscripts.Runtime类的典型用法代码示例。如果您正苦于以下问题:Java Runtime类的具体用法?Java Runtime怎么用?Java Runtime使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Runtime类属于org.springframework.extensions.webscripts包,在下文中一共展示了Runtime类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createMockWebscriptServletRequest
import org.springframework.extensions.webscripts.Runtime; //导入依赖的package包/类
static public MockWebscriptServletRequest createMockWebscriptServletRequest(AbstractWebScript webScript, String method, String webscriptUrl, String controllerMapping,
final Map<String, String> parameters, final Map<String, String> body, final Cookie[] cookies, final Map<String, Object> headers) {
Match match = new Match(null, ImmutableMap.of("", ""), webscriptUrl, webScript);
MockHttpServletRequest mockHttpServletRequest = new MockHttpServletRequest(method, "http://localhost/alfresco" + webscriptUrl + controllerMapping);
mockHttpServletRequest.setServletPath("alfresco");
mockHttpServletRequest.setContextPath("http://localhost/");
mockHttpServletRequest.setContentType("application/json");
if (parameters != null) {
mockHttpServletRequest.setParameters(parameters);
}
if (cookies != null) {
mockHttpServletRequest.setCookies(cookies);
}
if (headers != null && !headers.isEmpty()) {
for (Entry<String, Object> headerEntry : headers.entrySet()) {
mockHttpServletRequest.addHeader(headerEntry.getKey(), headerEntry.getValue());
}
}
try {
if (HttpMethod.POST.name().equals(method) && body != null) {
mockHttpServletRequest.setContent(new ObjectMapper().writeValueAsString(body).getBytes());
}
} catch (JsonProcessingException e) {
Throwables.propagate(e);
}
MockWebscriptServletRequest webscriptServletRequest = new MockWebscriptServletRequest(mock(Runtime.class), mockHttpServletRequest, match);
// if (content != null && !content.isEmpty()) {
// Content mockedContent = mock(Content.class);
// webscriptServletRequest.content = mockedContent;
// }
return webscriptServletRequest;
}
示例2: getRuntime
import org.springframework.extensions.webscripts.Runtime; //导入依赖的package包/类
@Override
public Runtime getRuntime()
{
return req.getRuntime();
}
示例3: getRuntime
import org.springframework.extensions.webscripts.Runtime; //导入依赖的package包/类
public Runtime getRuntime()
{
return res.getRuntime();
}
示例4: PublicApiTenantWebScriptServletRequest
import org.springframework.extensions.webscripts.Runtime; //导入依赖的package包/类
public PublicApiTenantWebScriptServletRequest(Runtime container, HttpServletRequest req, Match serviceMatch, ServerProperties serverProperties)
{
super(container, req, serviceMatch, serverProperties);
}
示例5: PublicApiTenantWebScriptServletRequest
import org.springframework.extensions.webscripts.Runtime; //导入依赖的package包/类
public PublicApiTenantWebScriptServletRequest(Runtime container, HttpServletRequest req, Match serviceMatch, ServerProperties serverProperties)
{
super(container, req, serviceMatch, serverProperties);
}
示例6: MockWebScriptResponse
import org.springframework.extensions.webscripts.Runtime; //导入依赖的package包/类
private MockWebScriptResponse(Runtime mockedRuntime, MockHttpServletResponse mockHttpServletResponse) {
super(mockedRuntime, mockHttpServletResponse);
this.mockHttpServletResponse = mockHttpServletResponse;
}
示例7: createMockWebScriptResponse
import org.springframework.extensions.webscripts.Runtime; //导入依赖的package包/类
static public MockWebScriptResponse createMockWebScriptResponse() {
return new MockWebScriptResponse(mock(Runtime.class), new MockHttpServletResponse());
}
示例8: MockWebscriptServletRequest
import org.springframework.extensions.webscripts.Runtime; //导入依赖的package包/类
private MockWebscriptServletRequest(Runtime mockedRuntime, MockHttpServletRequest mockHttpServletRequest, Match match) {
super(mockedRuntime, mockHttpServletRequest, match, null);
}
示例9: TenantWebScriptServletRequest
import org.springframework.extensions.webscripts.Runtime; //导入依赖的package包/类
/**
* Construction
*
* @param container Runtime
* @param req HttpServletRequest
* @param serviceMatch Match
* @param serverProperties ServerProperties
*/
public TenantWebScriptServletRequest(Runtime container, HttpServletRequest req, Match serviceMatch, ServerProperties serverProperties)
{
super(container, req, serviceMatch, serverProperties);
parse();
}