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


Java ClientResponse.Status方法代码示例

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


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

示例1: mockEntityClientResponse

import com.sun.jersey.api.client.ClientResponse; //导入方法依赖的package包/类
private static ClientResponse mockEntityClientResponse(
    TimelineClientImpl client, ClientResponse.Status status,
    boolean hasError, boolean hasRuntimeError) {
  ClientResponse response = mock(ClientResponse.class);
  if (hasRuntimeError) {
    doThrow(new ClientHandlerException(new ConnectException())).when(client)
        .doPostingObject(any(TimelineEntities.class), any(String.class));
    return response;
  }
  doReturn(response).when(client)
      .doPostingObject(any(TimelineEntities.class), any(String.class));
  when(response.getClientResponseStatus()).thenReturn(status);
  TimelinePutResponse.TimelinePutError error =
      new TimelinePutResponse.TimelinePutError();
  error.setEntityId("test entity id");
  error.setEntityType("test entity type");
  error.setErrorCode(TimelinePutResponse.TimelinePutError.IO_EXCEPTION);
  TimelinePutResponse putResponse = new TimelinePutResponse();
  if (hasError) {
    putResponse.addError(error);
  }
  when(response.getEntity(TimelinePutResponse.class)).thenReturn(putResponse);
  return response;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:25,代码来源:TestTimelineClient.java

示例2: SetTest

import com.sun.jersey.api.client.ClientResponse; //导入方法依赖的package包/类
public SetTest(String accept, String path, String encoding,
        ClientResponse.Status status, ZStat expectedStat, byte[] data)
{
    this.accept = accept;
    this.path = path;
    this.encoding = encoding;
    this.expectedStatus = status;
    this.expectedStat = expectedStat;
    this.data = data;
}
 
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:11,代码来源:SetTest.java

示例3: CreateTest

import com.sun.jersey.api.client.ClientResponse; //导入方法依赖的package包/类
public CreateTest(String accept, String path, String name, String encoding,
        ClientResponse.Status status, ZPath expectedPath, byte[] data,
        boolean sequence)
{
    this.accept = accept;
    this.path = path;
    this.name = name;
    this.encoding = encoding;
    this.expectedStatus = status;
    this.expectedPath = expectedPath;
    this.data = data;
    this.sequence = sequence;
}
 
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:14,代码来源:CreateTest.java

示例4: GetChildrenTest

import com.sun.jersey.api.client.ClientResponse; //导入方法依赖的package包/类
public GetChildrenTest(String accept, String path, ClientResponse.Status status,
        String expectedPath, List<String> expectedChildren)
{
    this.accept = accept;
    this.path = path;
    this.expectedStatus = status;
    this.expectedPath = expectedPath;
    this.expectedChildren = expectedChildren;
}
 
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:10,代码来源:GetChildrenTest.java

示例5: GetTest

import com.sun.jersey.api.client.ClientResponse; //导入方法依赖的package包/类
public GetTest(String accept, String path, String encoding,
        ClientResponse.Status status, ZStat stat)
{
    this.accept = accept;
    this.path = path;
    this.encoding = encoding;
    this.expectedStatus = status;
    this.expectedStat = stat;
}
 
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:10,代码来源:GetTest.java

示例6: mockDomainClientResponse

import com.sun.jersey.api.client.ClientResponse; //导入方法依赖的package包/类
private static ClientResponse mockDomainClientResponse(
    TimelineClientImpl client, ClientResponse.Status status,
    boolean hasRuntimeError) {
  ClientResponse response = mock(ClientResponse.class);
  if (hasRuntimeError) {
    doThrow(new ClientHandlerException(new ConnectException())).when(client)
        .doPostingObject(any(TimelineDomain.class), any(String.class));
    return response;
  }
  doReturn(response).when(client)
      .doPostingObject(any(TimelineDomain.class), any(String.class));
  when(response.getClientResponseStatus()).thenReturn(status);
  return response;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:15,代码来源:TestTimelineClient.java

示例7: DeleteTest

import com.sun.jersey.api.client.ClientResponse; //导入方法依赖的package包/类
public DeleteTest(String path, String zpath, ClientResponse.Status status) {
    this.zpath = zpath;
    this.expectedStatus = status;
}
 
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:5,代码来源:DeleteTest.java

示例8: ExistsTest

import com.sun.jersey.api.client.ClientResponse; //导入方法依赖的package包/类
public ExistsTest(String path, ClientResponse.Status status) {
    this.path = path;
    this.expectedStatus = status;
}
 
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:5,代码来源:ExistsTest.java


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