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


Java Response.setState方法代码示例

本文整理汇总了Java中org.openqa.selenium.remote.Response.setState方法的典型用法代码示例。如果您正苦于以下问题:Java Response.setState方法的具体用法?Java Response.setState怎么用?Java Response.setState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.openqa.selenium.remote.Response的用法示例。


在下文中一共展示了Response.setState方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handle

import org.openqa.selenium.remote.Response; //导入方法依赖的package包/类
@Override
public Response handle() throws Exception {
  Response response = new Response();
  response.setStatus(ErrorCodes.SUCCESS);
  response.setState(ErrorCodes.SUCCESS_STRING);

  BuildInfo buildInfo = new BuildInfo();

  JsonObject info = new JsonObject();
  JsonObject build = new JsonObject();
  build.addProperty("version", buildInfo.getReleaseLabel());
  build.addProperty("revision", buildInfo.getBuildRevision());
  build.addProperty("time", buildInfo.getBuildTime());
  info.add("build", build);
  JsonObject os = new JsonObject();
  os.addProperty("name", System.getProperty("os.name"));
  os.addProperty("arch", System.getProperty("os.arch"));
  os.addProperty("version", System.getProperty("os.version"));
  info.add("os", os);
  JsonObject java = new JsonObject();
  java.addProperty("version", System.getProperty("java.version"));
  info.add("java", java);

  response.setValue(info);
  return response;
}
 
开发者ID:alexkogon,项目名称:grid-refactor-remote-server,代码行数:27,代码来源:Status.java

示例2: success

import org.openqa.selenium.remote.Response; //导入方法依赖的package包/类
/**
 * Creates a response object for a successful command execution.
 *
 * @param sessionId ID of the session that executed the command.
 * @param value the command result value.
 * @return the new response object.
 */
public static Response success(SessionId sessionId, Object value) {
  Response response = new Response();
  response.setSessionId(sessionId != null ? sessionId.toString() : null);
  response.setValue(value);
  response.setStatus(ErrorCodes.SUCCESS);
  response.setState(ErrorCodes.SUCCESS_STRING);
  return response;
}
 
开发者ID:alexkogon,项目名称:grid-refactor-remote-server,代码行数:16,代码来源:Responses.java

示例3: failure

import org.openqa.selenium.remote.Response; //导入方法依赖的package包/类
/**
 * Creates a response object for a failed command execution.
 *
 * @param sessionId ID of the session that executed the command.
 * @param reason the failure reason.
 * @return the new response object.
 */
public static Response failure(SessionId sessionId, Throwable reason) {
  Response response = new Response();
  response.setSessionId(sessionId != null ? sessionId.toString() : null);
  response.setValue(reason);
  response.setStatus(ERROR_CODES.toStatusCode(reason));
  response.setState(ERROR_CODES.toState(response.getStatus()));
  return response;
}
 
开发者ID:alexkogon,项目名称:grid-refactor-remote-server,代码行数:16,代码来源:Responses.java


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