Modifier and Type | Class and Description |
---|---|
protected static class |
BaseTest.RequestType |
Modifier and Type | Field and Description |
---|---|
protected com.sun.jersey.api.client.Client |
client |
protected org.codehaus.jackson.map.ObjectMapper |
mapper |
protected static String |
REST_API_URL |
protected com.sun.jersey.api.client.WebResource |
service |
CoreSession |
session |
Constructor and Description |
---|
BaseTest() |
Modifier and Type | Method and Description |
---|---|
protected void |
assertEntityEqualsDoc(InputStream in,
DocumentModel doc) |
protected void |
assertNodeEqualsDoc(org.codehaus.jackson.JsonNode node,
DocumentModel note) |
void |
doAfter() |
void |
doBefore() |
protected void |
fetchInvalidations()
Fetch session invalidations.
|
protected String |
getErrorMessage(org.codehaus.jackson.JsonNode node) |
protected List<org.codehaus.jackson.JsonNode> |
getLogEntries(org.codehaus.jackson.JsonNode node) |
protected CloseableClientResponse |
getResponse(BaseTest.RequestType requestType,
String path) |
protected CloseableClientResponse |
getResponse(BaseTest.RequestType requestType,
String path,
Map<String,String> headers) |
protected CloseableClientResponse |
getResponse(BaseTest.RequestType requestType,
String path,
com.sun.jersey.multipart.MultiPart mp) |
protected CloseableClientResponse |
getResponse(BaseTest.RequestType requestType,
String path,
com.sun.jersey.multipart.MultiPart mp,
Map<String,String> headers) |
protected CloseableClientResponse |
getResponse(BaseTest.RequestType requestType,
String path,
javax.ws.rs.core.MultivaluedMap<String,String> queryParams) |
protected CloseableClientResponse |
getResponse(BaseTest.RequestType requestType,
String path,
String data) |
protected CloseableClientResponse |
getResponse(BaseTest.RequestType requestType,
String path,
String data,
Map<String,String> headers) |
protected CloseableClientResponse |
getResponse(BaseTest.RequestType requestType,
String path,
String data,
javax.ws.rs.core.MultivaluedMap<String,String> queryParams,
com.sun.jersey.multipart.MultiPart mp,
Map<String,String> headers) |
protected org.codehaus.jackson.JsonNode |
getResponseAsJson(BaseTest.RequestType responseType,
String url) |
protected org.codehaus.jackson.JsonNode |
getResponseAsJson(BaseTest.RequestType responseType,
String url,
javax.ws.rs.core.MultivaluedMap<String,String> queryParams) |
protected com.sun.jersey.api.client.WebResource |
getServiceFor(String username,
String password)
Returns a
WebResource to perform REST API calls with the given credentials. |
protected com.sun.jersey.api.client.WebResource |
getServiceFor(String resource,
String username,
String password)
Returns a
WebResource to perform calls on the given resource with the given credentials. |
protected void |
setJSONContentTypeIfAbsent(com.sun.jersey.api.client.WebResource.Builder builder,
Map<String,String> headers) |
protected static final String REST_API_URL
protected org.codehaus.jackson.map.ObjectMapper mapper
protected com.sun.jersey.api.client.Client client
protected com.sun.jersey.api.client.WebResource service
@Inject public CoreSession session
public BaseTest()
protected com.sun.jersey.api.client.WebResource getServiceFor(String username, String password)
WebResource
to perform REST API calls with the given credentials.
Since 9.3, uses the Apache HTTP client, more reliable and much more configurable than the one from the JDK.
protected com.sun.jersey.api.client.WebResource getServiceFor(String resource, String username, String password)
WebResource
to perform calls on the given resource with the given credentials.
Uses the Apache HTTP client, more reliable and much more configurable than the one from the JDK.
protected CloseableClientResponse getResponse(BaseTest.RequestType requestType, String path)
protected CloseableClientResponse getResponse(BaseTest.RequestType requestType, String path, Map<String,String> headers)
protected CloseableClientResponse getResponse(BaseTest.RequestType requestType, String path, com.sun.jersey.multipart.MultiPart mp)
protected CloseableClientResponse getResponse(BaseTest.RequestType requestType, String path, com.sun.jersey.multipart.MultiPart mp, Map<String,String> headers)
protected CloseableClientResponse getResponse(BaseTest.RequestType requestType, String path, javax.ws.rs.core.MultivaluedMap<String,String> queryParams)
protected CloseableClientResponse getResponse(BaseTest.RequestType requestType, String path, String data)
protected CloseableClientResponse getResponse(BaseTest.RequestType requestType, String path, String data, Map<String,String> headers)
protected CloseableClientResponse getResponse(BaseTest.RequestType requestType, String path, String data, javax.ws.rs.core.MultivaluedMap<String,String> queryParams, com.sun.jersey.multipart.MultiPart mp, Map<String,String> headers)
protected void setJSONContentTypeIfAbsent(com.sun.jersey.api.client.WebResource.Builder builder, Map<String,String> headers)
protected org.codehaus.jackson.JsonNode getResponseAsJson(BaseTest.RequestType responseType, String url) throws IOException, org.codehaus.jackson.JsonProcessingException
IOException
org.codehaus.jackson.JsonProcessingException
protected org.codehaus.jackson.JsonNode getResponseAsJson(BaseTest.RequestType responseType, String url, javax.ws.rs.core.MultivaluedMap<String,String> queryParams) throws org.codehaus.jackson.JsonProcessingException, IOException
get
- string
- queryParamsForPage
- IOException
org.codehaus.jackson.JsonProcessingException
protected void fetchInvalidations()
protected void assertNodeEqualsDoc(org.codehaus.jackson.JsonNode node, DocumentModel note) throws Exception
Exception
protected List<org.codehaus.jackson.JsonNode> getLogEntries(org.codehaus.jackson.JsonNode node)
protected String getErrorMessage(org.codehaus.jackson.JsonNode node)
protected void assertEntityEqualsDoc(InputStream in, DocumentModel doc) throws Exception
Exception
Copyright © 2018 Nuxeo. All rights reserved.