public abstract class AbstractSpringJerseyRestTestCase extends Object
Modifier and Type | Field and Description |
---|---|
static String |
ACCEPT |
static String |
contextPath |
static String |
CXF_REST_V1_CONTEXT_PATH |
static String |
CXF_REST_V2_CONTEXT_PATH |
static String |
DELETE |
static String |
GET |
static String |
POST |
static String |
PUT |
protected javax.servlet.ServletContext |
servletContext |
protected org.springframework.web.context.WebApplicationContext |
webApplicationContext |
Constructor and Description |
---|
AbstractSpringJerseyRestTestCase() |
AbstractSpringJerseyRestTestCase(String cxfContextPath) |
Modifier and Type | Method and Description |
---|---|
protected void |
afterServletDestroy()
By default, don't do anything.
|
protected void |
afterServletStart()
By default, don't do anything.
|
protected void |
beforeServletDestroy()
By default, don't do anything.
|
protected void |
beforeServletStart()
By default, don't do anything.
|
protected static void |
cleanUpImports() |
protected void |
createCategory() |
protected void |
createIpInterface() |
protected void |
createNode() |
protected void |
createNode(int statusCode) |
protected static org.springframework.mock.web.MockHttpServletRequest |
createRequest(javax.servlet.ServletContext context,
String requestType,
String urlPath) |
protected static org.springframework.mock.web.MockHttpServletRequest |
createRequest(javax.servlet.ServletContext context,
String requestType,
String urlPath,
Map<String,String> parameterMap,
String username,
Collection<String> roles) |
protected static org.springframework.mock.web.MockHttpServletRequest |
createRequest(javax.servlet.ServletContext context,
String requestType,
String urlPath,
String username,
Collection<String> roles) |
protected org.springframework.mock.web.MockHttpServletRequest |
createRequest(String requestType,
String urlPath) |
protected static org.springframework.mock.web.MockHttpServletResponse |
createResponse() |
protected void |
createService() |
protected void |
createSnmpInterface() |
protected void |
dispatch(org.springframework.mock.web.MockHttpServletRequest request,
org.springframework.mock.web.MockHttpServletResponse response) |
org.springframework.web.context.ContextLoaderListener |
getContextListener() |
javax.servlet.http.HttpServlet |
getDispatcher() |
javax.servlet.Filter |
getFilter() |
protected <T> T |
getJsonObject(org.codehaus.jackson.map.ObjectMapper mapper,
String url,
Map<String,String> parameterMap,
int expectedStatus,
Class<T> expectedClass) |
protected static String |
getQueryString(Map<?,?> parameters) |
org.springframework.mock.web.MockServletConfig |
getServletConfig() |
protected static String |
getUser() |
protected static Collection<String> |
getUserRoles() |
protected <T> T |
getXmlObject(JAXBContext context,
String url,
int expectedStatus,
Class<T> expectedClass) |
protected <T> T |
getXmlObject(JAXBContext context,
String url,
Map<String,String> parameterMap,
int expectedStatus,
Class<T> expectedClass) |
protected static Map<String,String> |
parseParamData(String data) |
protected void |
putXmlObject(JAXBContext context,
String url,
int expectedStatus,
Object object) |
protected org.springframework.mock.web.MockHttpServletResponse |
sendData(String requestType,
String contentType,
String url,
String data,
int statusCode) |
protected org.springframework.mock.web.MockHttpServletResponse |
sendPost(String url,
String xml,
int statusCode) |
protected org.springframework.mock.web.MockHttpServletResponse |
sendPost(String url,
String xml,
int statusCode,
String expectedUrlSuffix) |
protected org.springframework.mock.web.MockHttpServletResponse |
sendPut(String url,
String formData,
int statusCode) |
protected org.springframework.mock.web.MockHttpServletResponse |
sendPut(String url,
String formData,
int statusCode,
String expectedUrlSuffix) |
protected String |
sendRequest(org.springframework.mock.web.MockHttpServletRequest request,
int expectedStatus) |
protected String |
sendRequest(org.springframework.mock.web.MockHttpServletRequest request,
int expectedStatus,
String expectedUrlSuffix) |
protected String |
sendRequest(String requestType,
String url,
int expectedStatus) |
protected String |
sendRequest(String requestType,
String url,
Map<?,?> parameters,
int expectedStatus) |
protected String |
sendRequest(String requestType,
String url,
Map<?,?> parameters,
int expectedStatus,
String expectedUrlSuffix) |
void |
setContextListener(org.springframework.web.context.ContextLoaderListener contextListener) |
void |
setDispatcher(javax.servlet.http.HttpServlet dispatcher) |
void |
setFilter(javax.servlet.Filter filter) |
void |
setServletConfig(org.springframework.mock.web.MockServletConfig servletConfig) |
void |
setUp() |
protected static void |
setUser(String user,
String[] roles) |
protected String |
stringifyResponse(org.springframework.mock.web.MockHttpServletResponse response) |
void |
tearDown() |
public static final String CXF_REST_V1_CONTEXT_PATH
public static final String CXF_REST_V2_CONTEXT_PATH
public static String GET
public static String POST
public static String DELETE
public static String PUT
public static String ACCEPT
public static String contextPath
@Autowired protected javax.servlet.ServletContext servletContext
@Autowired protected org.springframework.web.context.WebApplicationContext webApplicationContext
public AbstractSpringJerseyRestTestCase()
public AbstractSpringJerseyRestTestCase(String cxfContextPath)
protected static void cleanUpImports()
protected void beforeServletStart() throws Exception
Exception
protected void afterServletStart() throws Exception
Exception
protected void beforeServletDestroy() throws Exception
Exception
protected void afterServletDestroy() throws Exception
Exception
protected void dispatch(org.springframework.mock.web.MockHttpServletRequest request, org.springframework.mock.web.MockHttpServletResponse response) throws Exception
Exception
protected org.springframework.mock.web.MockHttpServletRequest createRequest(String requestType, String urlPath)
protected static org.springframework.mock.web.MockHttpServletResponse createResponse()
protected static org.springframework.mock.web.MockHttpServletRequest createRequest(javax.servlet.ServletContext context, String requestType, String urlPath)
protected static org.springframework.mock.web.MockHttpServletRequest createRequest(javax.servlet.ServletContext context, String requestType, String urlPath, Map<String,String> parameterMap, String username, Collection<String> roles)
protected static org.springframework.mock.web.MockHttpServletRequest createRequest(javax.servlet.ServletContext context, String requestType, String urlPath, String username, Collection<String> roles)
protected static String getUser()
protected static Collection<String> getUserRoles()
protected org.springframework.mock.web.MockHttpServletResponse sendPost(String url, String xml, int statusCode) throws Exception
Exception
protected org.springframework.mock.web.MockHttpServletResponse sendPost(String url, String xml, int statusCode, String expectedUrlSuffix) throws Exception
Exception
protected org.springframework.mock.web.MockHttpServletResponse sendPut(String url, String formData, int statusCode) throws Exception
url
- formData
- statusCode
- expectedUrlSuffix
- Exception
protected org.springframework.mock.web.MockHttpServletResponse sendPut(String url, String formData, int statusCode, String expectedUrlSuffix) throws Exception
url
- formData
- statusCode
- expectedUrlSuffix
- Exception
protected org.springframework.mock.web.MockHttpServletResponse sendData(String requestType, String contentType, String url, String data, int statusCode) throws Exception
requestType
- contentType
- url
- data
- statusCode
- Exception
protected String stringifyResponse(org.springframework.mock.web.MockHttpServletResponse response)
protected static Map<String,String> parseParamData(String data) throws UnsupportedEncodingException
UnsupportedEncodingException
protected String sendRequest(String requestType, String url, Map<?,?> parameters, int expectedStatus) throws Exception
Exception
protected String sendRequest(String requestType, String url, Map<?,?> parameters, int expectedStatus, String expectedUrlSuffix) throws Exception
Exception
protected String sendRequest(String requestType, String url, int expectedStatus) throws Exception
Exception
protected String sendRequest(org.springframework.mock.web.MockHttpServletRequest request, int expectedStatus) throws Exception, UnsupportedEncodingException
protected String sendRequest(org.springframework.mock.web.MockHttpServletRequest request, int expectedStatus, String expectedUrlSuffix) throws Exception, UnsupportedEncodingException
protected <T> T getJsonObject(org.codehaus.jackson.map.ObjectMapper mapper, String url, Map<String,String> parameterMap, int expectedStatus, Class<T> expectedClass) throws Exception
Exception
protected <T> T getXmlObject(JAXBContext context, String url, Map<String,String> parameterMap, int expectedStatus, Class<T> expectedClass) throws Exception
Exception
protected <T> T getXmlObject(JAXBContext context, String url, int expectedStatus, Class<T> expectedClass) throws Exception
Exception
protected void putXmlObject(JAXBContext context, String url, int expectedStatus, Object object) throws Exception
Exception
public void setContextListener(org.springframework.web.context.ContextLoaderListener contextListener)
public org.springframework.web.context.ContextLoaderListener getContextListener()
public void setServletConfig(org.springframework.mock.web.MockServletConfig servletConfig)
public org.springframework.mock.web.MockServletConfig getServletConfig()
public void setFilter(javax.servlet.Filter filter)
public javax.servlet.Filter getFilter()
public void setDispatcher(javax.servlet.http.HttpServlet dispatcher)
public javax.servlet.http.HttpServlet getDispatcher()
Copyright © 2020. All rights reserved.