Results 1 to 3 of 3
- 03-11-2010, 10:42 AM #1
Member
- Join Date
- Mar 2010
- Posts
- 3
- Rep Power
- 0
How to test my proxy application on localhost?
Hi,
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
Adriano.
- 03-12-2010, 03:19 AM #2
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
- 04-18-2011, 10:15 AM #3
Member
- Join Date
- Apr 2011
- Posts
- 1
- Rep Power
- 0
Similar Threads
-
Mini network application test and help required
By louwhopley in forum NetworkingReplies: 0Last Post: 08-04-2009, 09:52 PM -
Test JEE application (already tetsed under tomcat6) under JBoss Eclipse
By kapusta117 in forum Web FrameworksReplies: 0Last Post: 07-23-2009, 03:37 PM -
Http - proxy or non-proxy ?
By Shiv in forum NetworkingReplies: 0Last Post: 04-11-2009, 08:07 AM -
A simple application to test the functionality of the OvalIcon class
By Java Tip in forum java.awtReplies: 0Last Post: 06-23-2008, 11:16 PM -
Not direct to localhost:8080/test/index.do and show This is my JSP page?
By techissue2008 in forum Web FrameworksReplies: 0Last Post: 06-07-2008, 09:02 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks