Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2010
    Rep Power

    Question How to test my proxy application on localhost?


    I have created a java method that take as arguments 2 object: httpServletRequest and httpServletRespose.

    This class must simply analyze remote http requests and return http responses.

    How can I test my application on localhost?

    public void processImage(HttpServletRequest request, HttpServletResponse response) {

    //process request

    //write response


    Thank you


  2. #2
    travishein's Avatar
    travishein is offline Senior Member
    Join Date
    Sep 2009
    Rep Power


    you mean outside of a servlet ? there is the concept of "Mock" objects, such as in springframework or "easymock" project, that provide stub implementations for interfaces, such as a stand alone faked HttpServletRequest, that you would populate such as inside a unit test case in a stand alone executable outside of a servlet container.

    That is only good for offline testing. for testing inside a servlet container (deployed on the localhost), you would need to invoke the servlet with a http client. to do this programatically, it is usually possible to create a HTTP GET or POST message using something such as the commons-httpclient, where a unit test case would invoke the http client, that you have built to generate the appropriate request

  3. #3
    snixnuatt is offline Member
    Join Date
    Apr 2011
    Rep Power

    Default do it safer next time

    You can urge it much safer if you will use <a href=''>proxy surf</a>. All transportation is sniffing via your provider, it's your chance...

Similar Threads

  1. Mini network application test and help required
    By louwhopley in forum Networking
    Replies: 0
    Last Post: 08-04-2009, 09:52 PM
  2. Replies: 0
    Last Post: 07-23-2009, 03:37 PM
  3. Http - proxy or non-proxy ?
    By Shiv in forum Networking
    Replies: 0
    Last Post: 04-11-2009, 08:07 AM
  4. Replies: 0
    Last Post: 06-23-2008, 11:16 PM
  5. Replies: 0
    Last Post: 06-07-2008, 09:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts