当前位置: 首页>>代码示例>>Java>>正文


Java Runtime类代码示例

本文整理汇总了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;
}
 
开发者ID:dgradecak,项目名称:alfresco-mvc,代码行数:35,代码来源:MockWebscriptServletRequest.java

示例2: getRuntime

import org.springframework.extensions.webscripts.Runtime; //导入依赖的package包/类
@Override
public Runtime getRuntime()
{
    return req.getRuntime();
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:6,代码来源:BufferedRequest.java

示例3: getRuntime

import org.springframework.extensions.webscripts.Runtime; //导入依赖的package包/类
public Runtime getRuntime()
{
    return res.getRuntime();
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:5,代码来源:BufferedResponse.java

示例4: PublicApiTenantWebScriptServletRequest

import org.springframework.extensions.webscripts.Runtime; //导入依赖的package包/类
public PublicApiTenantWebScriptServletRequest(Runtime container, HttpServletRequest req, Match serviceMatch, ServerProperties serverProperties)
{
    super(container, req, serviceMatch, serverProperties);
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:5,代码来源:PublicApiTenantWebScriptServletRequest.java

示例5: PublicApiTenantWebScriptServletRequest

import org.springframework.extensions.webscripts.Runtime; //导入依赖的package包/类
public PublicApiTenantWebScriptServletRequest(Runtime container, HttpServletRequest req, Match serviceMatch, ServerProperties serverProperties)
{
	super(container, req, serviceMatch, serverProperties);
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:5,代码来源:PublicApiTenantWebScriptServletRequest.java

示例6: MockWebScriptResponse

import org.springframework.extensions.webscripts.Runtime; //导入依赖的package包/类
private MockWebScriptResponse(Runtime mockedRuntime, MockHttpServletResponse mockHttpServletResponse) {
  super(mockedRuntime, mockHttpServletResponse);
  this.mockHttpServletResponse = mockHttpServletResponse;
}
 
开发者ID:dgradecak,项目名称:alfresco-mvc,代码行数:5,代码来源:MockWebScriptResponse.java

示例7: createMockWebScriptResponse

import org.springframework.extensions.webscripts.Runtime; //导入依赖的package包/类
static public MockWebScriptResponse createMockWebScriptResponse() {
  return new MockWebScriptResponse(mock(Runtime.class), new MockHttpServletResponse());
}
 
开发者ID:dgradecak,项目名称:alfresco-mvc,代码行数:4,代码来源:MockWebScriptResponse.java

示例8: MockWebscriptServletRequest

import org.springframework.extensions.webscripts.Runtime; //导入依赖的package包/类
private MockWebscriptServletRequest(Runtime mockedRuntime, MockHttpServletRequest mockHttpServletRequest, Match match) {
  super(mockedRuntime, mockHttpServletRequest, match, null);
}
 
开发者ID:dgradecak,项目名称:alfresco-mvc,代码行数:4,代码来源:MockWebscriptServletRequest.java

示例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();
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:14,代码来源:TenantWebScriptServletRequest.java


注:本文中的org.springframework.extensions.webscripts.Runtime类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。