http-unit

How to run the servlet test by using HttpUnit servlet runner? Problems in Starting up with ServletUnit?

本小妞迷上赌 提交于 2020-01-05 06:06:05
问题 I was planning to unit test my Servlet through ServletUnit and ran across some problems : - As a starting point, we are supposed to create a ServletRunner object. One of the constructors expects File object with web.xml file. I provide the full path of my web.xml file but somehow it ignores the path provided and searches at the top level folder. The code-snippet and error message is below: Code Snippet ServletRunner sr = new ServletRunner(new File("* C:/eclipse-workspaces/pocs/lms-csd/src

Is HttpUnit deprecated / inactive / not supported?

﹥>﹥吖頭↗ 提交于 2019-12-30 06:49:06
问题 When I explored and worked on HttpUnit 3 yrs back I liked it for what it does. Though after 3 yrs of not tracking it, when I suggested a solution based on it to my colleague, he told me it is deprecated? The apache status tells it is active. No where I could find if this is true. I will be shocked if that is true. Went thro the bug list and found no assignees for last 1 year. Should I conclude from this inference that it is deprecated? 回答1: The news has not been updated because the website

 characters has occurred an error when i use the HttpUnit

落花浮王杯 提交于 2019-12-11 08:27:40
问题 I am using the HttpUnit to simulate the submit button click of the form that designed into the specified url. (I am using http://stu21.kntu.ac.ir/Login.aspx). I use the code as follow to get response page. WebConversation conversation = new WebConversation(); WebRequest request = new GetMethodWebRequest("http://stu21.kntu.ac.ir/Login.aspx"); WebResponse response = conversation.getResource(request); WebForm loginForm = response.getForms()[0]; //Form has been got successfully request =

Sending file with POST request with HttpUnit

假如想象 提交于 2019-12-10 21:18:36
问题 we have a REST service, which we would like to test. I thought about using HttpUnit for this purpose. We sent POST request to a resource URL and after receiving the request we retrieve the file from request. In our server code we have something like this: MultipartFormData body = request().body().asMultipartFormData(); FilePart file = body.getFile("upfile"); File pictureFile = file.getFile(); In my test I wrote: WebConversation wc = new WebConversation(); WebRequest wr = new

HttpUnit WebConversation SSL Issues

那年仲夏 提交于 2019-12-09 19:41:38
问题 How can I ignore SSL certificate issues from the context of the WebConversation or WebRequest object? I know I can create a fake TrustManager that accepts all certificates but how can I set this in the HttpUnit context? Here is the exception I am getting: [Security:090508]Certificate chain received from my.domain.com - NUM.NUM.NUM.NUM was incomplete., [Security:090477]Certificate chain received from my.domain.com - NUM.NUM.NUM.NUM was not trusted causing SSL handshake failure. I need to

HttpUnit WebConversation SSL Issues

邮差的信 提交于 2019-12-04 17:41:53
How can I ignore SSL certificate issues from the context of the WebConversation or WebRequest object? I know I can create a fake TrustManager that accepts all certificates but how can I set this in the HttpUnit context? Here is the exception I am getting: [Security:090508]Certificate chain received from my.domain.com - NUM.NUM.NUM.NUM was incomplete., [Security:090477]Certificate chain received from my.domain.com - NUM.NUM.NUM.NUM was not trusted causing SSL handshake failure. I need to somehow set the SSLSocket settings to the WebConversation or WebRequest object; looking at the JavaDocs for

HttpUnit/HtmlUnit equivalent for android

可紊 提交于 2019-11-26 18:26:41
问题 I'm looking for a browser-simulating library on android, which handles things like loading a website (http/https) Redirections: HTTP (3xx Status Codes), JavaScript, HMTL tags filling out html-forms easy html parsing (could fall back to JSoup for that one) HttpUnit or HtmlUnit would do just fine, but both of them are a pain to get running on android. Is there any other option other than (Android)HttpClient (and therefore doing lots of the above on my own)? Or can I somehow get use of the