本文整理汇总了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;
}