本文整理匯總了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例8: ExistsTest
import com.sun.jersey.api.client.ClientResponse; //導入方法依賴的package包/類
public ExistsTest(String path, ClientResponse.Status status) {
this.path = path;
this.expectedStatus = status;
}