當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。