Class AbstractSpringJerseyRestTestCase

    • Field Detail

      • GET

        public static String GET
      • POST

        public static String POST
      • DELETE

        public static String DELETE
      • PUT

        public static String PUT
      • ACCEPT

        public static String ACCEPT
      • contextPath

        public static String contextPath
      • servletContext

        @Autowired
        protected javax.servlet.ServletContext servletContext
      • webApplicationContext

        @Autowired
        protected org.springframework.web.context.WebApplicationContext webApplicationContext
    • Constructor Detail

      • AbstractSpringJerseyRestTestCase

        public AbstractSpringJerseyRestTestCase()
      • AbstractSpringJerseyRestTestCase

        public AbstractSpringJerseyRestTestCase​(String cxfContextPath)
    • Method Detail

      • cleanUpImports

        protected static void cleanUpImports()
      • beforeServletStart

        protected void beforeServletStart()
                                   throws Exception
        By default, don't do anything.
        Throws:
        Exception
      • afterServletStart

        protected void afterServletStart()
                                  throws Exception
        By default, don't do anything.
        Throws:
        Exception
      • beforeServletDestroy

        protected void beforeServletDestroy()
                                     throws Exception
        By default, don't do anything.
        Throws:
        Exception
      • afterServletDestroy

        protected void afterServletDestroy()
                                    throws Exception
        By default, don't do anything.
        Throws:
        Exception
      • dispatch

        protected void dispatch​(org.springframework.mock.web.MockHttpServletRequest request,
                                org.springframework.mock.web.MockHttpServletResponse response)
                         throws Exception
        Throws:
        Exception
      • createRequest

        protected org.springframework.mock.web.MockHttpServletRequest createRequest​(String requestType,
                                                                                    String urlPath)
      • createResponse

        protected static org.springframework.mock.web.MockHttpServletResponse createResponse()
      • createRequest

        protected static org.springframework.mock.web.MockHttpServletRequest createRequest​(javax.servlet.ServletContext context,
                                                                                           String requestType,
                                                                                           String urlPath)
      • createRequest

        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)
      • createRequest

        protected static org.springframework.mock.web.MockHttpServletRequest createRequest​(javax.servlet.ServletContext context,
                                                                                           String requestType,
                                                                                           String urlPath,
                                                                                           String username,
                                                                                           Collection<String> roles)
      • setUser

        protected static void setUser​(String user,
                                      String[] roles)
      • getUser

        protected static String getUser()
      • sendPost

        protected org.springframework.mock.web.MockHttpServletResponse sendPost​(String url,
                                                                                String xml,
                                                                                int statusCode)
                                                                         throws Exception
        Throws:
        Exception
      • sendPost

        protected org.springframework.mock.web.MockHttpServletResponse sendPost​(String url,
                                                                                String xml,
                                                                                int statusCode,
                                                                                String expectedUrlSuffix)
                                                                         throws Exception
        Throws:
        Exception
      • sendPut

        protected org.springframework.mock.web.MockHttpServletResponse sendPut​(String url,
                                                                               String formData,
                                                                               int statusCode)
                                                                        throws Exception
        Parameters:
        url -
        formData -
        statusCode -
        expectedUrlSuffix -
        Throws:
        Exception
      • sendPut

        protected org.springframework.mock.web.MockHttpServletResponse sendPut​(String url,
                                                                               String formData,
                                                                               int statusCode,
                                                                               String expectedUrlSuffix)
                                                                        throws Exception
        Parameters:
        url -
        formData -
        statusCode -
        expectedUrlSuffix -
        Throws:
        Exception
      • sendData

        protected org.springframework.mock.web.MockHttpServletResponse sendData​(String requestType,
                                                                                String contentType,
                                                                                String url,
                                                                                String data,
                                                                                int statusCode)
                                                                         throws Exception
        Parameters:
        requestType -
        contentType -
        url -
        data -
        statusCode -
        Throws:
        Exception
      • stringifyResponse

        protected String stringifyResponse​(org.springframework.mock.web.MockHttpServletResponse response)
      • getQueryString

        protected static String getQueryString​(Map<?,​?> parameters)
      • getJsonObject

        protected <T> T getJsonObject​(org.codehaus.jackson.map.ObjectMapper mapper,
                                      String url,
                                      Map<String,​String> parameterMap,
                                      int expectedStatus,
                                      Class<T> expectedClass)
                               throws Exception
        Throws:
        Exception
      • createNode

        protected void createNode​(int statusCode)
                           throws Exception
        Throws:
        Exception
      • createIpInterface

        protected void createIpInterface()
                                  throws Exception
        Throws:
        Exception
      • createSnmpInterface

        protected void createSnmpInterface()
                                    throws Exception
        Throws:
        Exception
      • setContextListener

        public void setContextListener​(org.springframework.web.context.ContextLoaderListener contextListener)
      • getContextListener

        public org.springframework.web.context.ContextLoaderListener getContextListener()
      • setServletConfig

        public void setServletConfig​(org.springframework.mock.web.MockServletConfig servletConfig)
      • getServletConfig

        public org.springframework.mock.web.MockServletConfig getServletConfig()
      • setFilter

        public void setFilter​(javax.servlet.Filter filter)
      • getFilter

        public javax.servlet.Filter getFilter()
      • setDispatcher

        public void setDispatcher​(javax.servlet.http.HttpServlet dispatcher)
      • getDispatcher

        public javax.servlet.http.HttpServlet getDispatcher()