salmasri
asked on
testing delete request
In my HttpServlet I have overriden the method doDelete(HttpServletReques t, HttpServletResponse). I need to write unit tests for that code. I am using HttpUnit for testing the get and post request. However, I couldn't find anything in httpunit regarding testing delete requests. Any one knows how it should be done?
If not, is there any other unit testing package that can handle delete requests in addition to get and post?
If not, is there any other unit testing package that can handle delete requests in addition to get and post?
What is a 'delete request'?
Oh i see - as in the opposite of PUT. That and DELETE are uncommonly implemented or supported
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
>> In my HttpServlet I have overriden the method doDelete(HttpServletReques t, HttpServletResponse).
>Unless you have a specific reason to do this then you shouldn't.
Why not? I need to serve a delete request. If I didn't do it this way then I will just have to create a seperate "DeleteServlet" and in its doPost() I would do the deletion. But I think it would be cleaner to just override doDelete(), no?
>Unless you have a specific reason to do this then you shouldn't.
Why not? I need to serve a delete request. If I didn't do it this way then I will just have to create a seperate "DeleteServlet" and in its doPost() I would do the deletion. But I think it would be cleaner to just override doDelete(), no?
> I need to serve a delete request.
What do you mean by a delete request?
The DELETE method requests that the origin server delete the resource identified by the Request-URI. If this is what you want then it is a "specific reason", if it is a more general delete request then a seperate interface may be more appropriate.
What do you mean by a delete request?
The DELETE method requests that the origin server delete the resource identified by the Request-URI. If this is what you want then it is a "specific reason", if it is a more general delete request then a seperate interface may be more appropriate.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.